SparseGaussianProcessClassifier#
- class SparseGaussianProcessClassifier(*, kernel: Literal['rbf', 'matern32', 'matern52'] | AbstractKernel = 'matern52', mean_function: Literal['zero', 'constant', 'linear'] | AbstractMeanFunction = 'constant', num_inducing: int | None = None, minibatch_size: int | None = None, random_state: int = 0, iterations: int = 2000)[source]#
skgp’s
SparseGPClassifieras a scikit-learn estimator: Gaussian process classification of two classes for data with too many rows for aGaussianProcessClassifier, with skgp’s settings.There are no
features,targetorschema(seeGaussianProcessRegressor). The settings, checked atfit, are aSparseGPClassifier’s:kernel,mean_function,num_inducing,minibatch_size,random_stateanditerations, as forSparseGaussianProcessRegressor.After
fit,classes_,fitted_,n_features_in_andfeature_names_in_are as forGaussianProcessClassifier.- fit(X: Any, y: Any) Self#
Fit to the inputs
Xand the classesy, and return this estimator, fitted.Xis a Polars or pandas dataframe, whose columns keep their names, or a numeric array, whose columns are calledx0,x1, …;yholds one of two classes per row, of any type. The two classes, in sorted order, areclasses_. The fitted skgp model isfitted_.
- predict_proba(X: Any) ndarray#
The probability of each class at each row of
X: a numpy array with a row for each row and a column for each class, in the order ofclasses_.
- sample_y(X: Any, n_samples: int = 1, random_state: int = 0) ndarray#
Random samples of the class at each row of
X: a numpy array of a row for each row and a column for each sample, holding the classes (seeskgp.ClassPrediction.sample). scikit-learn’s classifiers have nosample_y; skgp’s have one so that every estimator samples the same way.random_stateis a whole number.
- score(X: Any, y: Any, sample_weight: None = None) float#
The Brier loss of the predicted probabilities of
yat the rowsX, with its sign flipped, so that higher is better, as scikit-learn’sneg_brier_scorescorer gives it: the mean, over the rows, of the squared difference between the probability ofclasses_[1]and 1 where it is the class, 0 where it is not. It is whatcross_val_scoreandGridSearchCVuse when given noscoring, in place of the accuracy scikit-learn’s classifiers give. Rows cannot be weighted.