Loading…
Glossary term
Predicting which category an input belongs to.
Classification predicts which category an input belongs to: spam or not, which digit, which disease. A classifier learns from labelled examples and then assigns new inputs to a class, often with a probability. With two classes it is binary; with more it is multi-class.
Train a classifier
from sklearn.ensemble import RandomForestClassifier
clf = RandomForestClassifier().fit(X_train, y_train)
print(clf.predict(X_test[:3]))It is one of the two basic supervised tasks, alongside regression.