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

Code before:

class BaseLibSVM(BaseEstimator, metaclass=ABCMeta):
    """Base class for estimators that use libsvm as backing library.

    This implements support vector machine classification and regression.

    Parameter documentation is in the derived `SVC` class.
    """

    _parameter_constraints: dict = {
        "kernel": [
            StrOptions({"linear", "poly", "rbf", "sigmoid", "precomputed"}),
            callable,
        ],
        "degree": [Interval(Integral, 0, None, closed="left")],
        "gamma": [
            StrOptions({"scale", "auto"}),
            Interval(Real, 0.0, None, closed="left"),
        ],
        "coef0": [Interval(Real, None, None, closed="neither")],
        "tol": [Interval(Real, 0.0, None, closed="neither")],
        "C": [Interval(Real, 0.0, None, closed="right")],
        "nu": [Interval(Real, 0.0, 1.0, closed="right")],
        "epsilon": [Interval(Real, 0.0, None, closed="left")],
        "shrinking": ["boolean"],
        "probability": ["boolean", StrOptions({"deprecated"})],
        "cache_size": [Interval(Real, 0, None, closed="neither")],
        "class_weight": [StrOptions({"balanced"}), dict, None],
        "verbose": ["verbose"],
        "max_iter": [Interval(Integral, -1, None, closed="left")],
        "random_state": ["random_state"],
    }

    # The order of these must match the integer values in LibSVM.
    # XXX These are actually the same in the dense case. Need to factor
    # this out.
    _sparse_kernels = ["linear", "poly", "rbf", "sigmoid", "precomputed"]

    @abstractmethod
    def __init__(
        self,
        kernel,
        degree,
        gamma,
        coef0,
        tol,
        C,
        nu,
        epsilon,
        shrinking,
        probability,

Review comment (suggestion):
```suggestion
        "probability": ["boolean", Hidden(StrOptions({"deprecated"}))],
```

Code after:

class BaseLibSVM(BaseEstimator, metaclass=ABCMeta):
    """Base class for estimators that use libsvm as backing library.

    This implements support vector machine classification and regression.

    Parameter documentation is in the derived `SVC` class.
    """

    _parameter_constraints: dict = {
        "kernel": [
            StrOptions({"linear", "poly", "rbf", "sigmoid", "precomputed"}),
            callable,
        ],
        "degree": [Interval(Integral, 0, None, closed="left")],
        "gamma": [
            StrOptions({"scale", "auto"}),
            Interval(Real, 0.0, None, closed="left"),
        ],
        "coef0": [Interval(Real, None, None, closed="neither")],
        "tol": [Interval(Real, 0.0, None, closed="neither")],
        "C": [Interval(Real, 0.0, None, closed="right")],
        "nu": [Interval(Real, 0.0, 1.0, closed="right")],
        "epsilon": [Interval(Real, 0.0, None, closed="left")],
        "shrinking": ["boolean"],
        "probability": ["boolean", Hidden(StrOptions({"deprecated"}))],
        "cache_size": [Interval(Real, 0, None, closed="neither")],
        "class_weight": [StrOptions({"balanced"}), dict, None],
        "verbose": ["verbose"],
        "max_iter": [Interval(Integral, -1, None, closed="left")],
        "random_state": ["random_state"],
    }

    # The order of these must match the integer values in LibSVM.
    # XXX These are actually the same in the dense case. Need to factor
    # this out.
    _sparse_kernels = ["linear", "poly", "rbf", "sigmoid", "precomputed"]

    @abstractmethod
    def __init__(
        self,
        kernel,
        degree,
        gamma,
        coef0,
        tol,
        C,
        nu,
        epsilon,
        shrinking,
        probability,