Machine Learning Book

Author

Md Shafiqur Rahman

Published

October 22, 2026

Preface

Machine learning becomes easier to understand when its pieces form one complete workflow. A prediction equation is only one piece. We also need to know what the data represent, which information will be available at prediction time, how parameters are estimated, and whether an evaluation resembles the intended use.

This book is a place to learn those pieces carefully and return to them later. It combines explanations, mathematical derivations, executable Python, small experiments, and revision notes. Its intended uses are independent study, practical projects, and interview preparation. The curriculum covers general machine learning and deep learning, with a complete classical-ML reading path. Examples will span tabular data, text, images, recommendations, and time series. Sensor, gait, rehabilitation, and robotics examples are optional applications of the general methods.

What is available in this milestone

The current release contains the introduction, computing and mathematical foundations, a reliable first modeling workflow, and a complete Linear Regression chapter. The full table of contents and learning paths organizes the long-term scope into classical supervised and unsupervised learning, reliable model development, probabilistic methods, deep learning, specialized problems, applications, and revision. Later chapters are development plans, rather than existing teaching material.

Read the current book sequentially if these subjects are new:

  1. Orientation and computing: 1  Introduction to machine learning, 2  Python for Machine Learning, 3  NumPy and Numerical Computing, and 4  Working with Data and Plots.
  2. Essential mathematics: 5  Algebra, functions, and logarithms, 6  Vectors and matrices, 7  Probability and uncertainty, 8  Statistical estimation, 9  Calculus for learning, and 10  Numerical optimization.
  3. A reliable workflow: 11  Task definition and exploration, 12  Training, evaluation, and leakage, and 13  Data preparation and pipelines.
  4. First complete algorithm: 14  Linear regression.

If you already know Python and elementary mathematics, begin with the workflow chapters and follow prerequisite links when needed. For interview revision, use each chapter’s worked questions and final revision section, then check your explanation against the derivation and code. Being able to recite a formula is different from being able to identify when it applies.

The broader learning route is Foundations → Reliable Workflow → Supervised Learning → Model Development → Unsupervised Learning → End-to-End Projects. Deep Learning follows as a substantial continuation, with direct prerequisites listed in the contents page. Linear Regression is the first complete algorithm example because its objective, gradient, and evaluation can all be checked directly. The teaching order is not a historical invention order or a claim that each later method is universally better.

How to study an example

For each chapter:

  1. Read the problem and explain why the operation is needed before looking at code.
  2. Check the meaning, dimensions, and units of the mathematical symbols.
  3. Work through the small numerical calculation by hand.
  4. Run the code cells in order from a fresh session for that chapter.
  5. Compare actual output with the stated checks and interpretation.
  6. Attempt the exercises before reading their worked answers.
  7. Use the revision summary to reconstruct the reasoning later.

Code cells within a chapter share variables and must run in order. Each chapter starts its own imports and data, so it does not depend on hidden state from a previous chapter. Plain text or python fences may illustrate pseudocode or a deliberately discussed error; executable Quarto cells use {python}. Do not copy a pseudocode block into Python and expect it to run.

Notation and conventions

Symbol Usual meaning
\(n\) Number of observations used in a calculation or training set.
\(p\) Number of input features.
\(X\in\mathbb R^{n\times p}\) Feature matrix: observations in rows, features in columns.
\(x_{ij}\) Feature \(j\) of observation \(i\).
\(y_i\), \(\hat y_i\) Observed and predicted target for observation \(i\).
\(b\), \(\mathbf w\) Intercept and slope/weight vector in a linear prediction.
\(\theta\), \(\boldsymbol\theta\) A parameter or a vector collecting parameters, defined locally.
\(E\), \(\operatorname{Var}\) Expectation and variance of random quantities.

Subscripts usually index rows or columns; a superscript \(T\) denotes transpose. A hat usually marks an estimate or prediction. A bar denotes an arithmetic mean. Chapters define symbols again when they matter and state any changed convention. Code uses names such as training_features and predicted_targets so their purpose remains visible. Celsius, newtons, volts, and other units belong to the example data, not to machine learning in general.

Reproducibility and honest interpretation

Required examples use small synthetic or explicitly written data and fixed seeds when random draws are involved. Synthetic values illustrate mechanisms. They are not measurements, clinical evidence, or published benchmark results. Printed tables and plots are calculated during execution. A seed makes a chosen experiment repeatable in the documented software environment; it does not remove sampling uncertainty or prove robustness across datasets.

Training data estimate parameters. Validation data or cross-validation guide choices. Test data assess a procedure after those choices are fixed. Learned preprocessing belongs inside the training boundary. The workflow chapters introduce these rules before the regression experiment relies on them.

The repository’s existing Windows environment is .venv. The project _environment file selects its Python for Quarto when commands run from the project root. A separately set QUARTO_PYTHON can override that selection. See README.md for the tested versions, verification commands, and output locations. No package installation is needed merely to read the generated HTML.

Outputs and project layout

The .qmd files are the source of truth. _quarto.yml controls their book order. references.bib holds bibliographic entries; chapters also link to official API references. _book contains generated output, and .quarto contains working/cache files. Authoring standards are in AGENTS.md and the coding style guide.

HTML is the verified study format for this milestone. The PDF target remains configured, but a functioning TeX setup has not yet been verified. PDF installation or repair is a separate setup task. Source equations, tables, and code use portable Quarto features to keep future PDF rendering practical.

Quarto integrates prose and executable examples in the same source; the Quarto book guide explains that publishing model (Creating a Book, n.d.).