Skip to content

decision_function


method decision_function(X, verbose=None) [source]

Transform new data through the current branch and return predicted confidence scores. Transformers that are only applied on the training set are skipped. If called from a trainer, the best model in the pipeline (under the winner attribute) is used. If called from a model, that model is used. The estimator must have a decision_function method.

Parameters:

X: dataframe-like
Feature set with shape=(n_samples, n_features).

verbose: int or None, optional (default=None)
Verbosity level of the output. If None, it uses the transformer's own verbosity.

Returns: p: np.array
Predicted confidence scores of the input samples, with shape=(n_samples,) for binary classification tasks and (n_samples, n_classes) for multiclass classification tasks.


Example

from atom import ATOMClassifier

atom = ATOMClassifier(X, y)
atom.run("kSVM", metric="accuracy")

# Predict confidence scores on new data
predictions = atom.ksvm.decision_function(X_new)
Back to top