Repository: scikit-learn/scikit-learn
File: sklearn/svm/_base.py (Python)

Code before:
        if sparse and self.kernel == "precomputed":
            raise TypeError("Sparse precomputed kernels are not supported.")
        self._sparse = sparse and not callable(self.kernel)

        if callable(self.kernel):
            check_consistent_length(X, y)
        else:
            X, y = validate_data(
                self,
                X,
                y,
                dtype=np.float64,
                order="C",
                accept_sparse="csr",
                accept_large_sparse=False,
            )

        y = self._validate_targets(y)

        sample_weight = np.asarray(
            [] if sample_weight is None else sample_weight, dtype=np.float64
        )
        solver_type = LIBSVM_IMPL.index(self._impl)

        self._effective_probability = self.probability
        if self._impl in ["c_svc", "nu_svc"]:
            if self._impl == "nu_scv":
                est_dep = "NuSVC"
            else:
                est_dep = "SVC"
            if self.probability != "deprecated":
                warnings.warn(
                    f"parameter `probability` will be deprecated in version 1.8, "
                    f"use `CalibratedClassifierCV({est_dep}(), ensemble=False)` "
                    f"instead of `{est_dep}(probability=True)`",
                    FutureWarning,
                )
            else:
                self._effective_probability = False

        # input validation
        n_samples = _num_samples(X)
        if solver_type != 2 and n_samples != y.shape[0]:
            raise ValueError(
                "X and y have incompatible shapes.\n"
                + "X has %s samples, but y has %s." % (n_samples, y.shape[0])
            )

        if self.kernel == "precomputed" and n_samples != X.shape[1]:
            raise ValueError(
                "Precomputed matrix must be a square matrix."

Review comment (suggestion):
```suggestion
        # TODO(1.11): remove probability
        self._effective_probability = self.probability
```

Code after:
        if sparse and self.kernel == "precomputed":
            raise TypeError("Sparse precomputed kernels are not supported.")
        self._sparse = sparse and not callable(self.kernel)

        if callable(self.kernel):
            check_consistent_length(X, y)
        else:
            X, y = validate_data(
                self,
                X,
                y,
                dtype=np.float64,
                order="C",
                accept_sparse="csr",
                accept_large_sparse=False,
            )

        y = self._validate_targets(y)

        sample_weight = np.asarray(
            [] if sample_weight is None else sample_weight, dtype=np.float64
        )
        solver_type = LIBSVM_IMPL.index(self._impl)

        # TODO(1.11): remove probability
        self._effective_probability = self.probability
        if self._impl in ["c_svc", "nu_svc"]:
            if self._impl == "nu_scv":
                est_dep = "NuSVC"
            else:
                est_dep = "SVC"
            if self.probability != "deprecated":
                warnings.warn(
                    f"The `probability` parameter was deprecated in 1.9 and "
                    f"will be removed in version 1.11. "
                    f"Use `CalibratedClassifierCV({est_dep}(), ensemble=False)` "
                    f"instead of `{est_dep}(probability=True)`",
                    FutureWarning,
                )
            else:
                self._effective_probability = False

        # input validation
        n_samples = _num_samples(X)
        if solver_type != 2 and n_samples != y.shape[0]:
            raise ValueError(
                "X and y have incompatible shapes.\n"
                + "X has %s samples, but y has %s." % (n_samples, y.shape[0])
            )

        if self.kernel == "precomputed" and n_samples != X.shape[1]: