One module per chapter of Murphy, Probabilistic Machine Learning: An Introduction (2022), with one function per figure, linked to the lecture notes. The code is written for this course with numpy, scipy, pandas, matplotlib, scikit-learn and PyTorch.
python3 ch11_linear_regression.py, list its figures with --list, make one with --fig 11.1, or run every chapter with python3 make_all.py --figures.Data come from scikit-learn's bundled data sets, small files in data/, and simulation; slow results are cached locally. Each figure is written to img/chNN/ as PNG, SVG and PDF. Shared helpers are in common.py.
Module: ch01_introduction.py · Notes: Introduction
Module: ch02_probability_univariate.py · Notes: Probability: Univariate Models
Module: ch03_probability_multivariate.py · Notes: Probability: Multivariate Models
Module: ch04_statistics.py · Notes: Statistics
Module: ch05_decision_theory.py · Notes: Decision Theory
Module: ch06_information_theory.py · Notes: Information Theory
Module: ch07_linear_algebra.py · Notes: Linear Algebra
Module: ch08_optimization.py · Notes: Optimization
Module: ch09_linear_discriminant_analysis.py · Notes: Linear Discriminant Analysis
Module: ch10_logistic_regression.py · Notes: Logistic Regression
Module: ch11_linear_regression.py · Notes: Linear Regression
Module: ch12_generalized_linear_models.py · Notes: Generalized Linear Models
Module: ch13_neural_networks_tabular.py · Notes: Neural Networks for Tabular Data
Module: ch14_neural_networks_images.py · Notes: Neural Networks for Images
Module: ch15_neural_networks_sequences.py · Notes: Neural Networks for Sequences
Module: ch16_exemplar_based_methods.py · Notes: Exemplar-based Methods
Module: ch17_kernel_methods.py · Notes: Kernel Methods
Module: ch18_trees_forests_boosting.py · Notes: Trees, Forests, Bagging, and Boosting
Module: ch19_learning_with_fewer_labels.py · Notes: Learning with Fewer Labeled Examples
Module: ch20_dimensionality_reduction.py · Notes: Dimensionality Reduction
Module: ch21_clustering.py · Notes: Clustering
Module: ch22_recommender_systems.py · Notes: Recommender Systems
Module: ch23_graph_embeddings.py · Notes: Graph Embeddings