Data Science ยท Chapter 23 of 43
Intro to Machine Learning
MACHINE LEARNING lets a computer LEARN patterns from data instead of being programmed with rules.
Main flavours: supervised (labels), unsupervised (no labels), reinforcement (reward).
Example 1 (python)
from sklearn.linear_model import LogisticRegression
model = LogisticRegression()
model.fit(X_train, y_train)
print(model.score(X_test, y_test))Output
0.87Train and evaluate โ the same API for every scikit-learn model.
Example 2 (python)
# Supervised: classification & regression
# Unsupervised: clustering, dimensionality reductionTwo big families in supervised learning.
Key points
- ML learns patterns from data.
- Supervised needs labels.
- Unsupervised finds structure.
- scikit-learn has a consistent fit/predict API.
๐ก Note: Start simple: a linear/logistic regression baseline is often within a few % of the fanciest model.
