Python Machine Learning

From your first model to a deployed one. These 31 tutorials cover preprocessing, feature engineering, regression, decision trees, random forests, XGBoost, SVMs, clustering, PCA, model evaluation, hyperparameter tuning, and deployment, all with scikit-learn. The series wraps with a full house price prediction project.

ML: Decision Trees in Python: Splitting, Pruning, Visualization

A python decision tree learns by asking simple yes/no questions, one after another, until it lands on an answer. This guide walks you through the whole thing in plain language: Gini impurity, information gain, how the tree picks each split, how to draw the tree out, how to control its depth so it does not overfit, and the moments when a tree beats a straight-line model. “Trees provide the basis for some of the most effective prediction methods in use ... Read More

ML: Random Forest, Bagging and Feature Importance

Train a single decision tree, swap out just a handful of training rows, and the whole thing can rearrange itself while your accuracy swings around. That jumpiness is the exact problem a random forest fixes: it grows hundreds of trees on different random slices of your data and lets them vote. In this guide you will see why a crowd of “good enough” trees beats one clever tree, and work through bagging, out-of-bag scoring, feature importance, and the handful of ... Read More

ML: Gradient Boosting with XGBoost, LightGBM, CatBoost

Nearly every winning solution on Kaggle’s tabular leaderboards leans on the same trick, and it is not a neural network. It is gradient boosting: build one small tree, see what it got wrong, then build a second tree whose only job is to fix those mistakes, and repeat. This post shows you that engine in a short hand-rolled loop, then puts the three libraries that dominate it (XGBoost, LightGBM, and CatBoost) head to head so you know which one to ... Read More