Skip to content

ML Book

From baselines to neural networks. Leakage, metrics, cross-validation, error analysis.

48 chapters 678 code blocks 170943 words

Contents

48 chapters
01A new dataset: 12 steps27 code02What ML is, and when you need it15 code03SQL: getting data out of a database20 code04Visualisation: looking at the data14 code05Preparing the data: encoding, missing values, scaling20 code06Train / validation / test and leakage9 code07The baseline and the first model10 code08Confusion matrix, precision, recall, F112 code09ROC, PR, threshold and imbalanced data12 code10Cross-validation11 code11Error analysis: what to do when the result is bad14 code12Vectors and matrices: the language of data14 code13The cost function and gradient descent16 code14The normal equation vs gradient descent12 code15Linear regression15 code16Logistic regression12 code17Regularisation: Ridge, Lasso, Elastic Net14 code18Decision tree (CART)14 code19Bagging and Random Forest14 code20Boosting: XGBoost, LightGBM, CatBoost14 code21KNN and Naive Bayes14 code22Support Vector Machine (SVM)15 code23Feature engineering and selection15 code24Hyperparameter tuning13 code25Stacking, blending and voting14 code26SHAP: explaining the model12 code27PCA: reducing dimensions13 code28Clustering: K-Means, DBSCAN, hierarchical19 code29LDA: dimension reduction that knows the target15 code30Neural network basics14 code31Backpropagation and optimizers18 code32Keras in practice16 code33PyTorch18 code34CNN: convolutional neural networks15 code35RNN, LSTM and time series14 code36Attention and the Transformer12 code37Collecting your own data: scraping and APIs19 code38Building a dataset: cleaning, labels and the split18 code39Fine-tuning: adapting a pretrained model15 code40Saving and loading a model17 code41Django API: putting the model into service13 code42Unedited: a first encounter with titanic15 code43Exercise 1: penguins, three classes6 code44Exercise 2: dirty sales data7 code45Exercise 3: hidden leakage8 code46The confusion-solver16 code47Interview questions9 code48Cheat sheet and protocol card9 code