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

Code before:
        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

        X = validate_data(self, X)
        if X.shape[0] == X.shape[1] and (
            (self.dissimilarity != "precomputed") and (self._metric != "precomputed")
        ):
            warnings.warn(
                "The MDS API has changed. ``fit`` now constructs a"
                " dissimilarity matrix from data. To use a custom "
                "dissimilarity matrix, set "
                "``metric='precomputed'``."
            )

        if self.dissimilarity == "precomputed":
            self.dissimilarity_matrix_ = X
            self.dissimilarity_matrix_ = check_symmetric(
                self.dissimilarity_matrix_, raise_exception=True
            )
        elif self._metric == "precomputed":
            self.dissimilarity_matrix_ = X
            self.dissimilarity_matrix_ = check_symmetric(
                self.dissimilarity_matrix_, raise_exception=True
            )

Review comment (suggestion):
```suggestion
        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,
            )
            self._metric = "euclidean"
            self._metric_mds = self.metric
```

Code after:
                "'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":
                self._metric = "euclidean"
            self._metric_mds = self.metric
        else:
            if self.dissimilarity == "deprecated":
                self._metric = self.metric
            self._metric_mds = self.metric_mds

        X = validate_data(self, X)
        if X.shape[0] == X.shape[1] and self._metric != "precomputed":
            warnings.warn(
                "The provided input is a square matrix. Note that ``fit`` constructs "
                "a dissimilarity matrix from data and will treat rows as samples "
                "and columns as features. To use a pre-computed dissimilarity matrix, "
                "set ``metric='precomputed'``."
            )

        if self._metric == "precomputed":
            self.dissimilarity_matrix_ = X
            self.dissimilarity_matrix_ = check_symmetric(
                self.dissimilarity_matrix_, raise_exception=True
            )
        else: