Instead of writing 'if this then that' rules by hand, you feed a model examples (data) and it learns a function that maps inputs to outputs on its own.
- Supervised learning — learn from labeled examples (input → known output)
- Unsupervised learning — find structure in unlabeled data (clustering, dimensionality reduction)
- Reinforcement learning — an agent learns by trial, error and reward signals
from sklearn.linear_model import LinearRegression
model = LinearRegression()
model.fit(X_train, y_train) # learn from data
predictions = model.predict(X_test)Tip
A clean one-line definition interviewers like: 'ML is using data to learn a function, instead of hand-coding that function.'