Supervised Learning
Supervised learning is a type of machine learning where the model learns from labeled examples — data where the correct answer is already known — so it can predict the answer for new, unseen data.
Data & AI
Each training example is a pair: the input features and the correct output (the label). The model's job is to learn the relationship so it can map new inputs to outputs. Predicting house prices from features (regression) and sorting email into spam or not (classification) are both supervised tasks.
It's called 'supervised' because the labeled answers act like a teacher correcting the model as it learns.
Examples
Python
from sklearn.tree import DecisionTreeClassifier
X = [[0, 0], [1, 1], [1, 0]] # features
y = ["no", "yes", "yes"] # labels (the answers)
clf = DecisionTreeClassifier().fit(X, y)
print(clf.predict([[1, 1]])[0])Output:
yes