Machine Learning with PyTorch and Scikit-Learn: Develop machine learning and deep learning models with Python

by: Sebastian Raschka (0)

This book of the bestselling and widely acclaimed Python Machine Learning series is a comprehensive guide to machine and deep learning using PyTorch's simple to code framework

Key Features

  • Learn applied machine learning with a solid foundation in theory
  • Clear, intuitive explanations take you deep into the theory and practice of Python machine learning
  • Fully updated and expanded to cover PyTorch, transformers, XGBoost, graph neural networks, and best practices

Book Description

Machine Learning with PyTorch and Scikit-Learn is a comprehensive guide to machine learning and deep learning with PyTorch. It acts as both a step-by-step tutorial and a reference you'll keep coming back to as you build your machine learning systems.

Packed with clear explanations, visualizations, and examples, the book covers all the essential machine learning techniques in depth. While some books teach you only to follow instructions, with this machine learning book, we teach the principles allowing you to build models and applications for yourself.

Why PyTorch?

PyTorch is the Pythonic way to learn machine learning, making it easier to learn and simpler to code with. This book explains the essential parts of PyTorch and how to create models using popular libraries, such as PyTorch Lightning and PyTorch Geometric.

You will also learn about generative adversarial networks (GANs) for generating new data and training intelligent agents with reinforcement learning. Finally, this new edition is expanded to cover the latest trends in deep learning, including graph neural networks and large-scale transformers used for natural language processing (NLP).

This PyTorch book is your companion to machine learning with Python, whether you're a Python developer new to machine learning or want to deepen your knowledge of the latest developments.

What you will learn

  • Explore frameworks, models, and techniques for machines to 'learn' from data
  • Use scikit-learn for machine learning and PyTorch for deep learning
  • Train machine learning classifiers on images, text, and more
  • Build and train neural networks, transformers, and boosting algorithms
  • Discover best practices for evaluating and tuning models
  • Predict continuous target outcomes using regression analysis
  • Dig deeper into textual and social media data using sentiment analysis

Who this book is for

If you have a good grasp of Python basics and want to start learning about machine learning and deep learning, then this is the book for you. This is an essential resource written for developers and data scientists who want to create practical machine learning and deep learning applications using scikit-learn and PyTorch.

Before you get started with this book, you'll need a good understanding of calculus, as well as linear algebra.

Table of Contents

  1. Giving Computers the Ability to Learn from Data
  2. Training Simple Machine Learning Algorithms for Classification
  3. A Tour of Machine Learning Classifiers Using Scikit-Learn
  4. Building Good Training Datasets – Data Preprocessing
  5. Compressing Data via Dimensionality Reduction
  6. Learning Best Practices for Model Evaluation and Hyperparameter Tuning
  7. Combining Different Models for Ensemble Learning
  8. Applying Machine Learning to Sentiment Analysis
  9. Predicting Continuous Target Variables with Regression Analysis
  10. Working with Unlabeled Data – Clustering Analysis

(N.B. Please use the Look Inside option to see further chapters)

The Reviews

This textbook is for the serious life-long learners of machine learning. There are at least two ways to ‘consume’ this book.For the expert in ML, this is a textbook to study as a clear comprehensive ML overview and then to dive into sections of interest or ignorance. The concepts are grounded in code examples and are well cited (with links) to sources. Further, this textbook is appropriate if you are TensorFlow-centric and want to broaden into cutting-edge ML models/tools coded in PyTorch.For a new learner to ML, this is a textbook to DO (not just READ) with hands-on and brain-engaged. If you realize that ML is a key life-long skill for your career, consider this textbook as part of a daily learning habit (10-30 min).From personal experience, my advice to the new learner is as follows… First, clone the GitHub repository, setup your Python environment, and study the textbook, while working through the notebooks. Go on tangents and break the code. Do this methodically as part of your daily learning habit, but do not hesitate to jump ahead several chapters to prepare for tomorrow’s meeting. There is enough excellent material here for a full year of ML adventures.I did a similar strategy with Raschka’s first textbook. About four years ago, I had finished Andrew Ng’s Deep Learning Specialization as a student in his first cohort. I knew the concepts well but could not do the actual application coding. I was surprised how my Python coding improved by following Raschka’s clean and elegant style. And Raschka’s code examples were meaty enough to be springboards into working applications.Several textbook editions later, what is different about this new edition?First, it moves you through scikit-Learn (a firm foundation) to PyTorch, instead of TensorFlow. PyTorch is a better stepping-stone, both conceptually and practically. With PyTorch, you will go further with less energy, while being able to convert your efforts into TensorFlow as needed. In addition, most of the cutting-edge ML/AI/DL research is in PyTorch. It is nice to read a recent arXiv paper, clone their repository, click on the Colab tutorial, and replicate their experiments, along with picking up a ton of new coding tricks & tips. I am excited to work through these PyTorch sections to hone my skills.Second, there is a clear recognition of model tracking and tuning practices. This is often a gap in other ML textbooks and courses. Once you progress beyond the simple demo examples in a lecture, you realize that the real work is experiments, more experiments, and still more experiments, so that you must understand what the model architecture and hyperparameters are doing to your dataset. There is good coverage of scikit-Learn pipeline, grid search, model performance, and the like.Third, ML/AI/DL practice is rapidly evolving. Every week new ML packages/services become available that could save much grief on your current project. What is refreshing about Raschka’s textbook series is that he constantly adding cutting-edge topics because he likes to stay current and to help us stay current. Hence, this edition contains recent ML treats as: transformers, self-supervised learning, autoencoders-to-GAN, graph neural networks, DBSCAN, t-SNE (with brief mention of UMAP), and PyTorch-Lightning.

I found a very interesting book and picked it up as quickly as I could. It's a complete guide to machine learning that focuses on PyTorch rather than TensorFlow. I greatly appreciate that this book exists as it gives developers a choice of which library to learn about.This is a great book for anyone wanting to get into machine learning as well as someone changing careers. I highly encourage both to check out this book.While the book isn't split up into sections, the divisions are clear. The first ten chapters discuss the fundamentals of machine learning, everything from basic definitions to cleaning data to a few projects. I always encourage people to do the projects and share them as a portfolio; this book makes it easier to do so.Chapter 11 looks at a general neural network before moving on to using PyTorch in chapters 12 and 13. The remaining chapters use PyTorch to build projects that give the reader a wide variety of experience.For the first time in any technical book that I've yet seen, the final section of the final chapter includes a book summary to help reinforce what the reader has learned. I appreciate this and hope more authors include this in the future.This really is a good book. I will be recommending this to anyone who wants a hands-on approach to learning machine learning.

I think the book is great in terms of covering the essential topics in the field of ML and Deep Learning. It covers three categories of ML: 1)supervised learning 2)unsupervised learning 3)reinforcement learning. It includes the hot topic of graph neural networks and the important advance of transformers in NLP.The code accompanying the essentials lets you get hands-on practice with both scikit-learn and PyTorch. The book focuses on the basics and provides in numerous places links to additional information beyond the scope of the book. This is nice in that it keeps a tight focus, but also allows the reader to branch out.At the very end of the book, the authors provide links to a subreddit community for ML, a daily updated list of the latest ML manuscripts uploaded to the arXiv preprint server, and a paper recommendation engine built on top of arXiv.I personally look forward to further study of the chapter on Graph Neural Networks which can be used for text classification, recommender systems, traffic forecasting, and drug discovery. Links to papers on the arXiv are given. The PyTorch Geometric library is introduced as a way to manage graph data for deep learning as well as implementing different kinds of graph layers to use in deep learning models. A tutorial is given which shows how to implement GNNs for molecular property prediction. The QM9 dataset of 133k+ small organic molecules and the TorchDrug library for working with molecules are both mentioned. Pointers to advanced GNN literature are given, including papers on “attention methods” that have been developed for GNNs and for graph transformers. Attention methods provide additional contexts.This book is well-written. It covers methods known for awhile such as linear regression and k-means clustering, as well as cutting edge approaches, all based on scikit-learn and PyTorch. I think it’s a very useful resource and can be very helpful in getting started on solving real-world problems.

Machine Learning with PyTorch and Scikit-Learn: Develop machine learning and deep learning models with Python
⭐ 4.8 💛 106
Buy the Book