sppam.SPPAM

class sppam.SPPAM[source]

The SPPAM (Saddle Point Problem for AUC Maximization) classifier

Attributes:
classes_ndarray of shape (n_classes, )

A list of class labels known to the classifier.

coef_feature weights of shape (1, n_features).
n_features_in_int

The number of features of the data passed to fit().

__init__()[source]
fit(X, y)[source]

Fit the model according to the given training data.

Parameters:
X{array-like, sparse matrix} of shape (n_samples, n_features)

Training vector, where n_samples is the number of samples and n_features is the number of features.

yarray-like of shape (n_samples,)

Target vector relative to X.

Returns:
self

Fitted estimator.

predict(X)[source]

Predict class labels for samples in X.

Parameters:

X{array-like, sparse matrix} of shape (n_samples, n_features)

The data matrix for which we want to get the predictions.

Returns:

y_predndarray of shape (n_samples,)

Vector containing the class labels for each sample.

predict_proba(X)[source]

Probability estimates for samples in X.

Parameters:

Xarray-like of shape (n_samples, n_features)

Vector to be scored, where n_samples is the number of samples and n_features is the number of features.

Returns:

T: array-like of shape (n_samples, n_classes)

Returns the probability of the sample for each class in the model, where classes are ordered as they are in self.classes_.

set_score_request(*, sample_weight: bool | None | str = '$UNCHANGED$') SPPAM

Request metadata passed to the score method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config()). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to score if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to score.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

New in version 1.3.

Note

This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a pipeline.Pipeline. Otherwise it has no effect.

Parameters:
sample_weightstr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED

Metadata routing for sample_weight parameter in score.

Returns:
selfobject

The updated object.

Examples using sppam.SPPAM

Plot the ROC curve

Plot the ROC curve

SPPAM comparison plot

SPPAM comparison plot

Compare SPPAM with LogisticRegression

Compare SPPAM with LogisticRegression

Decision boundaries

Decision boundaries