Scikit-learn is the go-to library for classical machine learning in Python. It provides a huge collection of algorithms — regression, classification, clustering, dimensionality reduction — behind one clean, consistent interface, built on NumPy and pandas.
What it covers
- Supervised learning — regression and classification (linear models, trees, forests, SVMs, boosting).
- Unsupervised learning — clustering (k-means) and dimensionality reduction (PCA).
- Model selection — cross-validation, hyperparameter search, metrics.
- Preprocessing — scaling, encoding, imputation, and pipelines to tie it together.
from sklearn.linear_model import LinearRegressionmodel = LinearRegression() # 1. choose a modelmodel.fit(X_train, y_train) # 2. train itpreds = model.predict(X_test) # 3. predict
Key takeaways
- 01Scikit-learn is the standard library for classical machine learning in Python.
- 02It covers supervised, unsupervised, model selection and preprocessing behind one consistent API.
- 03Built on NumPy/pandas; the pattern is always choose → fit → predict.
- 04Use it for tabular ML; use PyTorch/TensorFlow for deep learning.
