Machine learning and data science

A personal textbook for machine learning.

A practical guide to learning machine learning and building reliable models.

The learning path

  1. Foundations: understand the lifecycle, turn a business question into a measurable task, prepare data, and reason with probability, trees, and linear models.
  2. Core modeling: validate honestly, understand similarity and clustering, evaluate decisions, represent text, and connect associations and ensembles to their assumptions.
  3. Applied topics: study neural anomaly detection, manufacturing optimization, sensitive-text detection, reusable Python, deployment, and team delivery.
  4. Practice: rehearse explanations and design a small, demonstrable project with acceptance criteria, diagnostics, and a handoff.

What a complete data science project involves

A practical data science project should make functional, demonstrable progress and produce portfolio-ready work. The three example project areas are deep-learning anomaly detection, manufacturing optimization, and PII/PHI detection in natural language. Each area illustrates a different set of modeling and operational tradeoffs.

Across those areas, the recurring expectation is to frame the problem, develop and test a useful solution, write maintainable software, manage risk, and communicate results. A technically complex model that leaks labels or overwhelms reviewers with false alarms is not a successful deliverable.

Project concernSupporting evidence
Correct model selection and diagnostic scenariosLeakage-safe splitting, an appropriate baseline, representative metrics, error slices, and an untouched final evaluation.
High-quality Python and development toolsClear module boundaries, tests, Git review, reproducible dependencies, and an explanation of containers and CI/CD.
Business value and processesA measurable decision, acceptance criteria, prioritized work, approvals, and a concise demonstration with limitations.
Full data science lifecycleNot only a notebook: a versioned artifact, deployment or integration plan, monitoring, ownership, and a handoff.

Three reading passes

A reusable problem-solving framework

Decision → data → baseline → model → evaluation → delivery → monitoring. Name the prediction time and outcome horizon. Explain what information is available then. Choose the split before fitting preprocessing. Report a business-relevant metric and compare against a simple alternative. Finish with who acts on the output and what happens when it is wrong.

Example: “How would you approach anomaly detection for a factory?”

First establish whether an alert triggers inspection, maintenance, or an automatic stop, and quantify the cost of missed faults and unnecessary reviews. Audit machine and timestamp coverage; split by time and, where appropriate, machine. Start with a robust statistical baseline and compare it to an autoencoder trained on a defensible reference set. Choose thresholds on validation data under the review budget, then evaluate recall, alerts per day, detection delay, and performance on new machines. Deliver the scoring pipeline with model/data versions, monitoring, human escalation, and rollback.

What comes from the notes, and what is added?

The first two parts cover foundational concepts and core modeling methods. The applied chapters extend these ideas into engineering, optimization, and responsible delivery. Coverage and corrections maps the original material to the new organization and identifies important corrections. Original notes and figures preserves the complete supplied text and locally stored images for comparison.

This is an independent reference for machine learning and data science. Privacy and compliance examples are educational and require appropriate specialist review in real projects.

Download the interactive companion

Work through all 22 textbook sections in one guided Jupyter notebook, with model comparisons, interactive controls, and short practice tasks. This website only provides downloads: it does not render notebooks, run Python, or upload your work. Open the notebook locally in Jupyter or VS Code. Install the listed Python packages once; the examples then use built-in or synthetic data without network access.

The CSV downloads are optional: the notebook can generate the same examples if they are not present. To use the files, place them in a datasets folder beside the notebook. All records are invented for learning, not evidence of real-world model performance.

Opening, navigation, and offline behavior

Open index.html directly in a browser. Every chapter is a real HTML file with its own URL, so browser Back, bookmarks, and links work normally. The content and navigation remain available with JavaScript disabled; The portfolio’s paper-and-ink theme is the default, with a dark reading mode available. JavaScript adds theme controls, the mobile menu, glossary popups, and glossary filtering. The browser’s Find command searches the current chapter. The site shares the portfolio’s cream palette, pink accents, and typography. Fonts load online when available, with local fallbacks for offline reading. The back arrow returns to the portfolio’s Projects page. Use the print command for a clean reading copy.

Definition

View in glossary →