Machine Learning with PyTorch and Scikit-Learn
Official code repository for the book "Machine Learning with PyTorch and Scikit-Learn" by Sebastian Raschka, Yuxi Liu, and Vahid Mirjalili, containing Jupyter notebooks for all 19 chapters.
At a Glance
About Machine Learning with PyTorch and Scikit-Learn
The Machine Learning with PyTorch and Scikit-Learn repository is the official companion code resource for the 770-page Packt Publishing book of the same name, authored by Sebastian Raschka, Yuxi (Hayden) Liu, and Vahid Mirjalili and published in February 2022. It provides Jupyter notebooks for every chapter, covering the full arc from classical machine learning with scikit-learn through advanced deep learning with PyTorch.
What It Is
This is a GitHub-hosted open-source code repository (MIT License) that accompanies a comprehensive machine learning textbook. The repository is not a standalone software tool but a structured collection of runnable Jupyter notebooks that mirror the book's 19 chapters. Readers use it to follow along with the book's formulas and explanations by executing the code examples directly. The primary language is Jupyter Notebook, and the repository has accumulated over 5,100 stars and 1,800 forks on GitHub according to the project metadata.
What the Book Covers
The book and its companion notebooks span the full machine learning stack in two halves:
- Classical ML (Chapters 1–10): Classification algorithms, scikit-learn workflows, data preprocessing, dimensionality reduction, model evaluation, hyperparameter optimization, ensemble learning, sentiment analysis, regression, and clustering.
- Deep Learning (Chapters 11–19): Building neural networks from scratch, parallelizing training with PyTorch, convolutional networks for image classification, recurrent networks for sequential data, transformers and attention mechanisms, generative adversarial networks, graph neural networks, and reinforcement learning.
The book evolved from the 4th edition of Python Machine Learning and introduced major changes including a switch from TensorFlow to PyTorch, new chapters on graph neural networks and transformers, and a new section on gradient boosting.
Audience and Setup Path
The book targets readers with basic Python knowledge who want a ground-up understanding of machine learning and deep learning. Setup instructions are provided in the ch01/README.md file. A community-contributed guide for running notebooks on Google Colab is also included in the supplementary materials, making the content accessible without a local GPU setup.
Translations and Reach
The book has been translated into multiple languages, with confirmed editions in Japanese, Serbian, Spanish, and Korean. The repository itself serves as the central hub for code, with a GitHub Discussions forum for community questions.
Update: v1.1
The repository's latest tagged release is v1.1, published on February 25, 2022, coinciding with the book's official publication date. The repository was last updated in May 2026 according to project metadata, indicating ongoing maintenance. Sebastian Raschka has since authored additional books including Build a Large Language Model (From Scratch) and the in-progress Build a Reasoning Model (From Scratch), both of which have their own separate repositories.
Community Discussions
Be the first to start a conversation about Machine Learning with PyTorch and Scikit-Learn
Share your experience with Machine Learning with PyTorch and Scikit-Learn, ask questions, or help others learn from your insights.
Pricing
Open Source
Free and open-source code repository under the MIT License, available on GitHub.
- All 19 chapter Jupyter notebooks
- MIT License
- Google Colab guide
- GitHub Discussions forum
Capabilities
Key Features
- Jupyter notebooks for all 19 chapters
- Classical ML with scikit-learn
- Deep learning with PyTorch
- Chapters on transformers and attention mechanisms
- Graph neural networks chapter
- Generative adversarial networks chapter
- Reinforcement learning chapter
- Google Colab setup guide
- GitHub Discussions forum
- MIT License - free to use and modify
