Repository: scikit-learn/scikit-learn
File: sklearn/manifold/_mds.py (Python)

Code before:
        Returns
        -------
        X_new : ndarray of shape (n_samples, n_components)
            X transformed in the new space.
        """

        if self.n_init == "warn":
            warnings.warn(
                "The default value of `n_init` will change from 4 to 1 in 1.9.",
                FutureWarning,
            )
            self._n_init = 4
        else:
            self._n_init = self.n_init

        if self.init == "warn":
            warnings.warn(
                "The default value of `init` will change from 'random' to "
                "'classical_mds' in 1.10.",
                FutureWarning,
            )
            self._init = "random"
        else:
            self._init = self.init

        if self.dissimilarity == "precomputed":
            warnings.warn(
                "The `dissimilarity` parameter is deprecated and will be removed "
                "in 1.10. Use `metric` instead.",
                FutureWarning,
            )

        if type(self.metric) == type(True) and self.metric:
            warnings.warn(
                "Use metric_mds='True' instead of metric='True'. The support for "
                "metric='True' will be dropped in 1.10",
                FutureWarning,
            )
            self._metric = "euclidean"
            self._metric_mds = True
        elif type(self.metric) == type(True) and not self.metric:
            warnings.warn(
                "Use metric_mds='False' instead of metric='False'. The support for "
                "metric='False' will be dropped in 1.10",
                FutureWarning,
            )
            self._metric = "euclidean"
            self._metric_mds = False
        else:
            self._metric = self.metric
            self._metric_mds = self.metric_mds

Review comment (suggestion):
`dissimilarity` also needs to have `"deprecated"` as default, and if it's anything but that, the warning should be raised.

Code after:
            algorithm. By default, the algorithm is initialized with a randomly
            chosen array.

        Returns
        -------
        X_new : ndarray of shape (n_samples, n_components)
            X transformed in the new space.
        """

        if self.n_init == "warn":
            warnings.warn(
                "The default value of `n_init` will change from 4 to 1 in 1.9. "
                "To suppress this warning, provide some value of `n_init`.",
                FutureWarning,
            )
            self._n_init = 4
        else:
            self._n_init = self.n_init

        if self.init == "warn":
            warnings.warn(
                "The default value of `init` will change from 'random' to "
                "'classical_mds' in 1.10. To suppress this warning, provide "
                "some value of `init`.",
                FutureWarning,
            )
            self._init = "random"
        else:
            self._init = self.init

        if self.dissimilarity != "deprecated":
            if not isinstance(self.metric, bool) and self.metric != "euclidean":
                raise ValueError(
                    "You provided both `dissimilarity` and `metric`. Please use "
                    "only `metric`."
                )
            else:
                warnings.warn(
                    "The `dissimilarity` parameter is deprecated and will be "
                    "removed in 1.10. Use `metric` instead.",
                    FutureWarning,
                )
                self._metric = self.dissimilarity

        if isinstance(self.metric, bool):
            warnings.warn(
                f"Use metric_mds={self.metric} instead of metric={self.metric}. The "
                "support for metric={True/False} will be dropped in 1.10.",
                FutureWarning,
            )
            if self.dissimilarity == "deprecated":