Sahin Boydas
Random theme
Select theme
Machine Learning with PyTorch and Scikit-Learn cover

Machine Learning with PyTorch and Scikit-Learn: Sebastian Raschka's Theory-and-Code Textbook

by Sebastian Raschka, Yuxi (Hayden) Liu & Vahid Mirjalili · Packt, 2015

By Sahin Boydas✓ Updated December 2026On 1 book list

Machine Learning with PyTorch and Scikit-Learn, published by Packt in 2022, is the successor to Sebastian Raschka's Python Machine Learning, first released in 2015. Raschka wrote it with Yuxi (Hayden) Liu and Vahid Mirjalili. Raschka was then a statistics professor at the University of Wisconsin-Madison and later moved to industry AI research.

The first half builds classic algorithms from scratch in NumPy before using Scikit-Learn: the perceptron, logistic regression, support vector machines, trees, dimensionality reduction, ensembles, regression and clustering. The second half moves to PyTorch for neural networks, convolutional and recurrent networks, transformers, GANs, graph neural networks and reinforcement learning. All the code is free on GitHub.

It is often compared with Géron's Hands-On Machine Learning. Raschka's book shows more of the mathematics and implements more from scratch. Readers who want to see the equation and then the code that runs it tend to prefer this one.

How Tech People Read It

Tom M. Mitchell

Mitchell, who founded the machine learning department at Carnegie Mellon and wrote an early standard textbook, recommends it to readers who learn best from working code. His endorsement carries weight because his own book shaped how the field was taught. He points to examples as the route into modern methods.

Mike James and Ben Dickson

Reviewing it for I Programmer and TechTalks, both writers single out the balance of theory and practice. The book explains without hiding the maths and then shows code. Readers who found other practical books too thin on reasoning often settle here.

Students in a first ML course

Implementing a perceptron or gradient descent by hand before calling a library makes later chapters easier. The book's structure follows a university course. Instructors can assign chapters in order.

The Main Ideas

  • Implementing an algorithm from scratch once makes the library version easier to trust and debug.
  • Preprocessing and model evaluation decide results as much as the model itself does.
  • Ensembles such as random forests and gradient boosting combine weak models into strong ones.
  • PyTorch's automatic differentiation lets the same few lines train very different networks.
  • Graph neural networks extend deep learning to data made of nodes and edges.

Who Should Read It

Read it if you want the mathematics explained next to working Python and do not mind a long book. It suits students, engineers and researchers coming from other sciences. Skip it if you want only practical recipes; Hands-On Machine Learning moves faster with less maths.

The Book

Cover of Machine Learning with PyTorch and Scikit-Learn by Sebastian Raschka, Yuxi (Hayden) Liu & Vahid Mirjalili

Book 01 Intermediate

Machine Learning with PyTorch and Scikit-Learn

by Sebastian Raschka, Yuxi (Hayden) Liu & Vahid Mirjalili

Publisher
Packt, 2022 (first published 2015)
Free online
No (the code is free)
Goodreads
4.38 of 5 from 123 ratings

Why read it

The successor to Python Machine Learning. The first half implements classic algorithms from scratch and with Scikit-Learn: perceptrons, classifiers, preprocessing, dimensionality reduction, model evaluation, ensembles, regression and clustering. The second half moves to PyTorch for neural networks, convolutional and recurrent networks, transformers, GANs, graph neural networks and reinforcement learning. Read it if you want the maths explained next to working code.

What people said

  • “… especially useful to anybody who wants to understand modern machine learning through examples of working code”

    Tom M. Mitchell, founder and former chair of the Machine Learning Department, Carnegie Mellon University, quoted on the author's site sebastianraschka.com ↗

  • “This book strikes a good balance between presenting things understandably without ignoring the math.”

    Mike James, reviewer, I Programmer i-programmer.info ↗

  • “… the authors of Machine Learning with PyTorch and Scikit-Learn have managed to strike the right balance of theory and practice.”

    Ben Dickson, TechTalks bdtechtalks.com ↗

Watch

Is this the BEST BOOK on Machine Learning? Machine Learning with PyTorch and Scikit-Learn ReviewBhavesh BhattA video review of the book, linked from the author's own book page.

On These Book Lists

Frequently Asked Questions

Is Machine Learning with PyTorch and Scikit-Learn good for beginners?

It suits beginners who know Python and some algebra. It explains the maths, so it is slower than purely practical books.

Is this the same as Python Machine Learning?

It is the successor. Python Machine Learning went through three editions, and this 2022 book replaces its deep learning half with PyTorch.

Which is better, Raschka or Géron?

Raschka's book shows more theory and implements more from scratch. Géron's Hands-On Machine Learning is more practical and more recent.

What else has Sebastian Raschka written?

Build a Large Language Model (From Scratch), which is on the deep learning list on this site.