0

Is there an equivalent to SKLearn's predict_proba in AutoSKLearn? I can't seem to find a way to determine the confidence of AutoSKLearns predictions.

John Westlund
  • 336
  • 1
  • 10

1 Answers1

0

A predict_proba method should be implemented for AutoSklearnClassifier

From auto-sklearn documentation:

predict_proba(X, batch_size=None, n_jobs=1)

Predict probabilities of classes for all samples X.

Parameters:

  • Xarray-like or sparse matrix of shape = [n_samples, n_features]
  • ...

Returns:

  • yarray of shape = [n_samples, n_classes] or [n_samples, n_labels]

Which in context looks something like this:

from autosklearn.classification import AutoSklearnClassifier
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split

X, y = make_classification(n_samples=1000)
X_train, X_test, y_train, y_test = train_test_split(X, y)

clf = AutoSklearnClassifier(time_left_for_this_task=30)
clf.fit(X_train, y_train)

predictions = clf.predict_proba(X_test)
print(predictions)
Alexander L. Hayes
  • 3,892
  • 4
  • 13
  • 34
  • Thanks, Alexander. Not sure how I completely missed that in the documentation. – John Westlund Jan 06 '23 at 17:55
  • I haven't seen many examples that use the method either, so there probably just were not very many hits when looking it up. That might change now that this question and answer exist! – Alexander L. Hayes Jan 09 '23 at 19:19