Skip to main content
Albero Academy

Machine Learning Cheat Sheet

Algorithms · metrics · pipelines

Supervised vs unsupervised, top algorithms, evaluation metrics, hyperparameter tuning, and pipeline visuals.

All sheets
PDF quick reference

MachineCheat sheet

Sections
3
Snippets
4
Pages
3
01

Algorithm selector

By problem type
Regression → Linear Reg, Random Forest, XGBoost
Classification → Logistic Reg, RF, XGBoost, SVM
Clustering → KMeans, DBSCAN, Hierarchical
Anomaly → Isolation Forest, One-class SVM
NLP → Transformers (BERT, GPT family)
02

Evaluation metrics

Classification
Accuracy = (TP + TN) / total
Precision = TP / (TP + FP)
Recall = TP / (TP + FN)
F1 = 2 * P * R / (P + R)
ROC-AUC classifier vs random
Regression
MAE mean(|y - ŷ|)
MSE mean((y - ŷ)²)
RMSE √MSE
R² 1 - SS_res / SS_tot
03

Sklearn pipeline

End-to-end pipeline
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
pipe = Pipeline([
("scaler", StandardScaler()),
("clf", LogisticRegression())
])
pipe.fit(X_train, y_train)
pipe.score(X_test, y_test)