• Stars
    star
    12,030
  • Rank 2,685 (Top 0.06 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created about 9 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The "Python Machine Learning (1st edition)" book code repository and info resource

Python Machine Learning book code repository

Google Group


IMPORTANT NOTE (09/21/2017):

This GitHub repository contains the code examples of the 1st Edition of Python Machine Learning book. If you are looking for the code examples of the 2nd Edition, please refer to this repository instead.


What you can expect are 400 pages rich in useful material just about everything you need to know to get started with machine learning ... from theory to the actual code that you can directly put into action! This is not yet just another "this is how scikit-learn works" book. I aim to explain all the underlying concepts, tell you everything you need to know in terms of best practices and caveats, and we will put those concepts into action mainly using NumPy, scikit-learn, and Theano.

You are not sure if this book is for you? Please checkout the excerpts from the Foreword and Preface, or take a look at the FAQ section for further information.


1st edition, published September 23rd 2015
Paperback: 454 pages
Publisher: Packt Publishing

Language: English
ISBN-10: 1783555130

ISBN-13: 978-1783555130
Kindle ASIN: B00YSILNL0



German ISBN-13: 978-3958454224
Japanese ISBN-13: 978-4844380603
Italian ISBN-13: 978-8850333974
Chinese (traditional) ISBN-13: 978-9864341405
Chinese (mainland) ISBN-13: 978-7111558804
Korean ISBN-13: 979-1187497035
Russian ISBN-13: 978-5970604090

Table of Contents and Code Notebooks

Simply click on the ipynb/nbviewer links next to the chapter headlines to view the code examples (currently, the internal document links are only supported by the NbViewer version). Please note that these are just the code examples accompanying the book, which I uploaded for your convenience; be aware that these notebooks may not be useful without the formulae and descriptive text.


  1. Machine Learning - Giving Computers the Ability to Learn from Data [dir] [ipynb] [nbviewer]
  2. Training Machine Learning Algorithms for Classification [dir] [ipynb] [nbviewer]
  3. A Tour of Machine Learning Classifiers Using Scikit-Learn [dir] [ipynb] [nbviewer]
  4. Building Good Training Sets – Data Pre-Processing [dir] [ipynb] [nbviewer]
  5. Compressing Data via Dimensionality Reduction [dir] [ipynb] [nbviewer]
  6. Learning Best Practices for Model Evaluation and Hyperparameter Optimization [dir] [ipynb] [nbviewer]
  7. Combining Different Models for Ensemble Learning [dir] [ipynb] [nbviewer]
  8. Applying Machine Learning to Sentiment Analysis [dir] [ipynb] [nbviewer]
  9. Embedding a Machine Learning Model into a Web Application [dir] [ipynb] [nbviewer]
  10. Predicting Continuous Target Variables with Regression Analysis [dir] [ipynb] [nbviewer]
  11. Working with Unlabeled Data – Clustering Analysis [dir] [ipynb] [nbviewer]
  12. Training Artificial Neural Networks for Image Recognition [dir] [ipynb] [nbviewer]
  13. Parallelizing Neural Network Training via Theano [dir] [ipynb] [nbviewer]

Equation Reference

[PDF] [TEX]

Slides for Teaching

A big thanks to Dmitriy Dligach for sharing his slides from his machine learning course that is currently offered at Loyola University Chicago.

Additional Math and NumPy Resources

Some readers were asking about Math and NumPy primers, since they were not included due to length limitations. However, I recently put together such resources for another book, but I made these chapters freely available online in hope that they also serve as helpful background material for this book:


Citing this Book

You are very welcome to re-use the code snippets or other contents from this book in scientific publications and other works; in this case, I would appreciate citations to the original source:

BibTeX:

@Book{raschka2015python,
 author = {Raschka, Sebastian},
 title = {Python Machine Learning},
 publisher = {Packt Publishing},
 year = {2015},
 address = {Birmingham, UK},
 isbn = {1783555130}
 }

MLA:

Raschka, Sebastian. Python machine learning. Birmingham, UK: Packt Publishing, 2015. Print.


Feedback & Reviews

Short review snippets


Sebastian Raschka’s new book, Python Machine Learning, has just been released. I got a chance to read a review copy and it’s just as I expected - really great! It’s well organized, super easy to follow, and it not only offers a good foundation for smart, non-experts, practitioners will get some ideas and learn new tricks here as well.
– Lon Riesberg at Data Elixir

Superb job! Thus far, for me it seems to have hit the right balance of theory and practice…math and code!
– Brian Thomas

I've read (virtually) every Machine Learning title based around Scikit-learn and this is hands-down the best one out there.
– Jason Wolosonovich

The best book I've seen to come out of PACKT Publishing. This is a very well written introduction to machine learning with Python. As others have noted, a perfect mixture of theory and application.
– Josh D.

A book with a blend of qualities that is hard to come by: combines the needed mathematics to control the theory with the applied coding in Python. Also great to see it doesn't waste paper in giving a primer on Python as many other books do just to appeal to the greater audience. You can tell it's been written by knowledgeable writers and not just DIY geeks.
– Amazon Customer

Sebastian Raschka created an amazing machine learning tutorial which combines theory with practice. The book explains machine learning from a theoretical perspective and has tons of coded examples to show how you would actually use the machine learning technique. It can be read by a beginner or advanced programmer.

Longer reviews

If you need help to decide whether this book is for you, check out some of the "longer" reviews linked below. (If you wrote a review, please let me know, and I'd be happy to add it to the list).


Links

Translations


Literature References & Further Reading Resources

Errata


Bonus Notebooks (not in the book)


"Related Content" (not in the book)


SciPy 2016

We had such a great time at SciPy 2016 in Austin! It was a real pleasure to meet and chat with so many readers of my book. Thanks so much for all the nice words and feedback! And in case you missed it, Andreas Mueller and I gave an Introduction to Machine Learning with Scikit-learn; if you are interested, the video recordings of Part I and Part II are now online!

PyData Chicago 2016

I attempted the rather challenging task of introducing scikit-learn & machine learning in just 90 minutes at PyData Chicago 2016. The slides and tutorial material are available at "Learning scikit-learn -- An Introduction to Machine Learning in Python."


Note

I have set up a separate library, mlxtend, containing additional implementations of machine learning (and general "data science") algorithms. I also added implementations from this book (for example, the decision region plot, the artificial neural network, and sequential feature selection algorithms) with additional functionality.



Translations



Dear readers,
first of all, I want to thank all of you for the great support! I am really happy about all the great feedback you sent me so far, and I am glad that the book has been so useful to a broad audience.

Over the last couple of months, I received hundreds of emails, and I tried to answer as many as possible in the available time I have. To make them useful to other readers as well, I collected many of my answers in the FAQ section (below).

In addition, some of you asked me about a platform for readers to discuss the contents of the book. I hope that this would provide an opportunity for you to discuss and share your knowledge with other readers:

Google Groups Discussion Board

(And I will try my best to answer questions myself if time allows! :))

The only thing to do with good advice is to pass it on. It is never of any use to oneself.
β€” Oscar Wilde


Examples and Applications by Readers

Once again, I have to say (big!) THANKS for all the nice feedback about the book. I've received many emails from readers, who put the concepts and examples from this book out into the real world and make good use of them in their projects. In this section, I am starting to gather some of these great applications, and I'd be more than happy to add your project to this list -- just shoot me a quick mail!

FAQ

General Questions

Questions about the Machine Learning Field

Questions about ML Concepts and Statistics

Cost Functions and Optimization
Regression Analysis
Tree models
Model evaluation
Logistic Regression
Neural Networks and Deep Learning
Other Algorithms for Supervised Learning
Unsupervised Learning
Semi-Supervised Learning
Ensemble Methods
Preprocessing, Feature Selection and Extraction
Naive Bayes
Other
Programming Languages and Libraries for Data Science and Machine Learning

Questions about the Book

Contact

I am happy to answer questions! Just write me an email or consider asking the question on the Google Groups Email List.

If you are interested in keeping in touch, I have quite a lively twitter stream (@rasbt) all about data science and machine learning. I also maintain a blog where I post all of the things I am particularly excited about.

More Repositories

1

deeplearning-models

A collection of various deep learning architectures, models, and tips
Jupyter Notebook
16,088
star
2

python-machine-learning-book-2nd-edition

The "Python Machine Learning (2nd edition)" book code repository and info resource
Jupyter Notebook
7,021
star
3

mlxtend

A library of extension and helper modules for Python's data analysis and machine learning libraries.
Python
4,631
star
4

python-machine-learning-book-3rd-edition

The "Python Machine Learning (3rd edition)" book code repository
Jupyter Notebook
4,483
star
5

pattern_classification

A collection of tutorials and examples for solving and understanding machine learning and pattern classification tasks
Jupyter Notebook
4,057
star
6

python_reference

Useful functions, tutorials, and other Python-related things
Jupyter Notebook
3,715
star
7

deep-learning-book

Repository for "Introduction to Artificial Neural Networks and Deep Learning: A Practical Guide with Applications in Python"
Jupyter Notebook
2,766
star
8

machine-learning-book

Code Repository for Machine Learning with PyTorch and Scikit-Learn
Jupyter Notebook
2,428
star
9

matplotlib-gallery

Examples of matplotlib codes and plots
Jupyter Notebook
1,135
star
10

watermark

An IPython magic extension for printing date and time stamps, version numbers, and hardware information
Python
845
star
11

machine-learning-notes

Collection of useful machine learning codes and snippets (originally intended for my personal use)
Jupyter Notebook
709
star
12

stat479-machine-learning-fs19

Course material for STAT 479: Machine Learning (FS 2019) taught by Sebastian Raschka at University Wisconsin-Madison
Jupyter Notebook
673
star
13

scipy2023-deeplearning

Jupyter Notebook
597
star
14

pyprind

PyPrind - Python Progress Indicator Utility
Python
545
star
15

stat453-deep-learning-ss20

STAT 453: Intro to Deep Learning @ UW-Madison (Spring 2020)
Jupyter Notebook
537
star
16

stat479-deep-learning-ss19

Course material for STAT 479: Deep Learning (SS 2019) at University Wisconsin-Madison
Jupyter Notebook
493
star
17

algorithms_in_ipython_notebooks

A repository with IPython notebooks of algorithms implemented in Python.
Jupyter Notebook
493
star
18

stat479-machine-learning-fs18

Course material for STAT 479: Machine Learning (FS 2018) at University Wisconsin-Madison
Jupyter Notebook
470
star
19

musicmood

A machine learning approach to classify songs by mood.
OpenEdge ABL
404
star
20

stat453-deep-learning-ss21

STAT 453: Intro to Deep Learning @ UW-Madison (Spring 2021)
Jupyter Notebook
363
star
21

stat451-machine-learning-fs20

STAT 451: Intro to Machine Learning @ UW-Madison (Fall 2020)
Jupyter Notebook
359
star
22

datacollect

A collection of tools to collect and download various data.
Jupyter Notebook
207
star
23

data-science-tutorial

Code material for a data science tutorial
Jupyter Notebook
188
star
24

LLM-finetuning-scripts

Jupyter Notebook
135
star
25

One-Python-benchmark-per-day

An ongoing fun challenge where I'll try to post one Python benchmark per day.
HTML
130
star
26

pydata-chicago2016-ml-tutorial

Machine learning with scikit-learn tutorial at PyData Chicago 2016
Jupyter Notebook
128
star
27

stat451-machine-learning-fs21

Jupyter Notebook
128
star
28

cvpr2023

Python
116
star
29

faster-pytorch-blog

Outlining techniques for improving the training performance of your PyTorch model without compromising its accuracy
Python
115
star
30

msu-datascience-ml-tutorial-2018

Machine learning with Python tutorial at MSU Data Science 2018
Jupyter Notebook
105
star
31

protein-science

A collection of useful tutorials for Protein Science
Python
96
star
32

markdown-toclify

A Python command line tool that creates a Table of Contents for Markdown documents
Python
92
star
33

cyclemoid-pytorch

Cyclemoid implementation for PyTorch
Python
85
star
34

MachineLearning-QandAI-book

Machine Learning Q and AI book
Jupyter Notebook
83
star
35

pydata-annarbor2017-dl-tutorial

Code snippets for "Introduction to Deep Learning with TensorFlow" at PyData Ann Arbor Aug 2017
Jupyter Notebook
80
star
36

smilite

A Python module to retrieve and compare SMILE strings of chemical compounds from the free ZINC online database
Python
73
star
37

pytorch-memory-optim

This code repository contains the code used for my "Optimizing Memory Usage for Training LLMs and Vision Transformers in PyTorch" blog post.
Python
68
star
38

DeepLearning-Gdansk2019-tutorial

Ordinal Regression tutorial for the International Summer School on Deep Learning 2019
Jupyter Notebook
66
star
39

model-eval-article-supplementary

Supplementary material for the article "Model Evaluation, Model Selection, and Algorithm Selection in Machine Learning"
Jupyter Notebook
62
star
40

nn_plus_gzip

Gzip and nearest neighbors for text classification
Jupyter Notebook
58
star
41

LLMs-from-scratch

Implementing ChatGPT-like LLMs from scratch, step by step
Jupyter Notebook
54
star
42

interpretable-ml-article

Code examples for my Interpretable Machine Learning Blog Series
Jupyter Notebook
54
star
43

R_snippets

R Scripts for general data analysis and plotting
R
45
star
44

numpy-intro-blogarticle-2020

Jupyter Notebook for the "Scientific Computing in Python: Introduction to NumPy and Matplotlib" blog article
Jupyter Notebook
40
star
45

blog-finetuning-llama-adapters

Supplementary material for "Understanding Parameter-Efficient Finetuning of Large Language Models: From Prefix Tuning to Adapters"
Jupyter Notebook
36
star
46

mputil

Utility functions for Python's multiprocessing standard library module
Python
35
star
47

pybibtex

Utility functions for parsing BibTeX files and creating citation reference lists.
Python
32
star
48

mytorch

Collection of PyTorch-related utility functions
Python
27
star
49

posit2023-python-ml

Workshop materials for posit::conf(2023)
Jupyter Notebook
25
star
50

comparing-automatic-augmentation-blog

Comparing four automatic image augmentation techniques in PyTorch: AutoAugment, RandAugment, AugMix, and TrivialAugment
Jupyter Notebook
25
star
51

pytorch-fabric-demo

Python
24
star
52

Hbind

Calculates hydrogen-bond interaction tables for protein-small molecule complexes, based on protein PDB and protonated ligand MOL2 structure input. Raschka et al. (2018) J. Computer-Aided Molec. Design
C
24
star
53

scipy2022-talk

Python
23
star
54

screenlamp

screenlamp is a Python toolkit for hypothesis-driven virtual screening
Python
22
star
55

gradient-accumulation-blog

Finetuning BLOOM on a single GPU using gradient-accumulation
Python
22
star
56

2021-issdl-gdansk

Intro to GAN Tutorial for the International Summer School of Deep Learning 2021 in Gdansk
Jupyter Notebook
21
star
57

predicting-activity-by-machine-learning

Activity From Virtual Screening Code Repository
Jupyter Notebook
20
star
58

BondPack

A collection of PyMOL plugins to visualize atomic bonds.
Python
20
star
59

uw-madison-datacience-club-talk-oct2019

Slides and code for the talk at UW-Madison's Data Science Club, 10 Oct 2019
Jupyter Notebook
20
star
60

siteinterlock

A novel approach to pose selection in protein-ligand docking based on graph theory.
Python
19
star
61

low-rank-adaptation-blog

Python
19
star
62

R-notes

Various R lang related material for teaching.
Python
19
star
63

2021-pydata-jeddah

Materials for "Transformers from the Ground Up" at PyData Jeddah on August 5, 2021
Jupyter Notebook
18
star
64

b3-basic-batchsize-benchmark

Experiments for the blog post "No, We Don't Have to Choose Batch Sizes As Powers Of 2"
Python
16
star
65

ViT-finetuning-scripts

Vision transformer finetuning scripts
Python
15
star
66

datapipes-blog

Code for the DataPipes article
Jupyter Notebook
14
star
67

srgan-lightning-blog

Sharing Deep Learning Research Models with Lightning Part 1: Building A Super Resolution App
Python
14
star
68

try-lion-optimizer

Jupyter Notebook
10
star
69

mnist-pngs

MNIST files in PNG format
Python
10
star
70

py-args

Python command line tools as productivity supplements for Posix systems
Python
10
star
71

ecml-teaching-ml-2021

Jupyter Notebook
10
star
72

HbindViz

Tools for generating hydrogen-bond interaction visualizations from Hbind
Python
9
star
73

protein-recognition-index

Protein Recognition Index (PRI), measuring the similarity between H-bonding features in a given complex (predicted or designed) and the characteristic H-bond trends from crystallographic complexes
Python
8
star
74

ord-torchhub

Ordinal Regression PyTorch Hub
Python
6
star
75

compair

Model evaluation utilities
Python
5
star
76

torchmetrics-blog

Code for "TorchMetrics -- How do we use it, and what's the difference between .update() and .forward()"
Jupyter Notebook
5
star
77

rasbt

5
star
78

advent-of-code-2016

My Solutions for the Advent of Code 2016
Python
5
star
79

bugreport

A repository to store code examples to reproduce issues for bug reports.
Jupyter Notebook
2
star
80

bookgiveaway-2022-wordcloud

Word cloud from the results of the book-giveaway
Jupyter Notebook
1
star
81

pycon2024

Tutorial Materials for "The Fundamentals of Modern Deep Learning with PyTorch"
1
star