Skip to content

Commit 1edd0b5

Browse files
committed
full toc
1 parent ee168e7 commit 1edd0b5

File tree

15 files changed

+263
-42
lines changed

15 files changed

+263
-42
lines changed

code/README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Table of Contents and Code Notebooks
2+
3+
4+
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).
5+
**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.**
6+
7+
8+
1. Machine Learning - Giving Computers the Ability to Learn from Data [[dir](./ch01)] [[ipynb](./ch01/ch01.ipynb)] [[nbviewer](http://nbviewer.ipython.org/github/rasbt/python-machine-learning-book/blob/master/code/ch01/ch01.ipynb)]
9+
2. Training Machine Learning Algorithms for Classification [[dir](./ch02)] [[ipynb](./ch02/ch02.ipynb)] [[nbviewer](http://nbviewer.ipython.org/github/rasbt/python-machine-learning-book/blob/master/code/ch02/ch02.ipynb)]
10+
3. A Tour of Machine Learning Classifiers Using Scikit-Learn [[dir](./ch03)] [[ipynb](./ch03/ch03.ipynb)] [[nbviewer](http://nbviewer.ipython.org/github/rasbt/python-machine-learning-book/blob/master/code/ch03/ch03.ipynb)]
11+
4. Building Good Training Sets – Data Pre-Processing [[dir](./ch04)] [[ipynb](./ch04/ch04.ipynb)] [[nbviewer](http://nbviewer.ipython.org/github/rasbt/python-machine-learning-book/blob/master/code/ch04/ch04.ipynb)]
12+
5. Compressing Data via Dimensionality Reduction [[dir](./ch05)] [[ipynb](./ch05/ch05.ipynb)] [[nbviewer](http://nbviewer.ipython.org/github/rasbt/python-machine-learning-book/blob/master/code/ch05/ch05.ipynb)]
13+
6. Learning Best Practices for Model Evaluation and Hyperparameter Optimization [[dir](./ch06)] [[ipynb](./ch06/ch06.ipynb)] [[nbviewer](http://nbviewer.ipython.org/github/rasbt/python-machine-learning-book/blob/master/code/ch06/ch06.ipynb)]
14+
7. Combining Different Models for Ensemble Learning [[dir](./ch07)] [[ipynb](./ch07/ch07.ipynb)] [[nbviewer](http://nbviewer.ipython.org/github/rasbt/python-machine-learning-book/blob/master/code/ch07/ch07.ipynb)]
15+
8. Applying Machine Learning to Sentiment Analysis [[dir](./ch08)] [[ipynb](./ch08/ch08.ipynb)] [[nbviewer](http://nbviewer.ipython.org/github/rasbt/python-machine-learning-book/blob/master/code/ch08/ch08.ipynb)]
16+
9. Embedding a Machine Learning Model into a Web Application [[dir](./ch09)] [[ipynb](./ch09/ch09.ipynb)] [[nbviewer](http://nbviewer.ipython.org/github/rasbt/python-machine-learning-book/blob/master/code/ch09/ch09.ipynb)]
17+
10. Predicting Continuous Target Variables with Regression Analysis [[dir](./ch10)] [[ipynb](./ch10/ch10.ipynb)] [[nbviewer](http://nbviewer.ipython.org/github/rasbt/python-machine-learning-book/blob/master/code/ch10/ch10.ipynb)]
18+
11. Working with Unlabeled Data – Clustering Analysis [[dir](./ch11)] [[ipynb](./ch11/ch11.ipynb)] [[nbviewer](http://nbviewer.ipython.org/github/rasbt/python-machine-learning-book/blob/master/code/ch11/ch11.ipynb)]
19+
12. Training Artificial Neural Networks for Image Recognition [[dir](./ch12)] [[ipynb](./ch12/ch12.ipynb)] [[nbviewer](http://nbviewer.ipython.org/github/rasbt/python-machine-learning-book/blob/master/code/ch12/ch12.ipynb)]
20+
13. Parallelizing Neural Network Training via Theano [[dir](./ch13)] [[ipynb](.2/ch12.ipynb)]
21+
13. Parallelizing Neural Network Training via Theano [[dir](./ch13)] [[ipynb](./ch13/ch13.ipynb)] [[nbviewer](http://nbviewer.ipython.org/github/rasbt/python-machine-learning-book/blob/master/code/ch13/ch13.ipynb)]
22+
23+
## Contact
24+
25+
I am happy to answer questions! Just write me an [email](mailto:[email protected])
26+
or consider asking the question on the [Google Groups Email List](https://groups.google.com/forum/#!forum/python-machine-learning-book).
27+
28+
If you are interested in keeping in touch, I have quite a lively twitter stream ([@rasbt](https://twitter.com/rasbt)) all about data science and machine learning. I also maintain a [blog](http://sebastianraschka.com/articles.html) where I post all of the things I am particularly excited about.

code/_convenience_scripts/md_toc.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Sebastian Raschka, 2015
2+
# convenience function for myself to create nested TOC lists
3+
# use as `python md_toc.py /blank_tocs/ch01.toc`
4+
5+
import sys
6+
7+
ipynb = sys.argv[1]
8+
with open(ipynb, 'r') as f:
9+
for line in f:
10+
out_str = ' ' * (len(line) - len(line.lstrip()))
11+
line = line.strip()
12+
out_str += '- %s' % line
13+
print(out_str)

code/ch01/README.md

+24-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
11
Sebastian Raschka, 2015
22

3-
# Python Machine Learning
3+
Python Machine Learning - Code Examples
44

5-
# Chapter 1 Code Examples
65

7-
## Giving Computers the Ability to Learn from Data
6+
## Chapter 1 - Giving Computers the Ability to Learn from Data
87

9-
<hr>
8+
- Building intelligent machines to transform data into knowledge
9+
- The three different types of machine learning
10+
- Making predictions about the future with supervised learning
11+
- Classification for predicting class labels
12+
- Regression for predicting continuous outcomes
13+
- Solving interactive problems with reinforcement learning
14+
- Discovering hidden structures with unsupervised learning
15+
- Finding subgroups with clustering
16+
- Dimensionality reduction for data compression
17+
- An introduction to the basic terminology and notations
18+
- A roadmap for building machine learning systems
19+
- Preprocessing – getting data into shape
20+
- Training and selecting a predictive model
21+
- Evaluating models and predicting unseen data instances
22+
- Using Python for machine learning
23+
- Installing Python packages
24+
- Summary
25+
26+
27+
28+
---
1029

1130
**Chapter 1 does not contain any code examples.**
1231

13-
<hr>
32+
---
1433

1534
## Installing Python packages
1635

code/ch02/README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Sebastian Raschka, 2015
22

3-
# Python Machine Learning
4-
# Chapter 2 Code Examples
3+
Python Machine Learning - Code Examples
54

6-
## Training Machine Learning Algorithms for Classification
5+
## Chapter 2 - Training Machine Learning Algorithms for Classification
6+
7+
- Artificial neurons - a brief glimpse into the early history
8+
- of machine learning
9+
- Implementing a perceptron learning algorithm in Python
10+
- Training a perceptron model on the Iris dataset
11+
- Adaptive linear neurons and the convergence of learning
12+
- Minimizing cost functions with gradient descent
13+
- Implementing an Adaptive Linear Neuron in Python
14+
- Large scale machine learning and stochastic gradient descent
15+
- Summary

code/ch03/README.md

+24-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
Sebastian Raschka, 2015
22

3-
# Python Machine Learning
4-
# Chapter 3 Code Examples
3+
Python Machine Learning - Code Examples
54

6-
## A Tour of Machine Learning Classifiers Using Scikit-learn
5+
6+
## Chapter 3 - A Tour of Machine Learning Classifiers Using Scikit-learn
7+
8+
- Choosing a classification algorithm
9+
- First steps with scikit-learn
10+
- Training a perceptron via scikit-learn
11+
- Modeling class probabilities via logistic regression
12+
- Logistic regression intuition and conditional probabilities
13+
- Learning the weights of the logistic cost function
14+
- Training a logistic regression model with scikit-learn
15+
- Tackling overfitting via regularization
16+
- Maximum margin classification with support vector machines
17+
- Maximum margin intuition
18+
- Dealing with the nonlinearly separable case using slack variables
19+
- Alternative implementations in scikit-learn
20+
- Solving nonlinear problems using a kernel SVM
21+
- Using the kernel trick to find separating hyperplanes in higher dimensional space
22+
- Decision tree learning
23+
- Maximizing information gain – getting the most bang for the buck
24+
- Building a decision tree
25+
- Combining weak to strong learners via random forests
26+
- K-nearest neighbors – a lazy learning algorithm
27+
- Summary

code/ch04/README.md

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
Sebastian Raschka, 2015
22

3-
# Python Machine Learning
4-
# Chapter 4 Code Examples
3+
Python Machine Learning - Code Examples
54

6-
## Building Good Training Sets – Data Preprocessing
5+
## Chapter 4 - Building Good Training Sets – Data Preprocessing
6+
7+
- Dealing with missing data
8+
- Eliminating samples or features with missing values
9+
- Imputing missing values
10+
- Understanding the scikit-learn estimator API
11+
- Handling categorical data
12+
- Mapping ordinal features
13+
- Encoding class labels
14+
- Performing one-hot encoding on nominal features
15+
- Partitioning a dataset in training and test sets
16+
- Bringing features onto the same scale
17+
- Selecting meaningful features
18+
- Sparse solutions with L1 regularization
19+
- Sequential feature selection algorithms
20+
- Assessing feature importance with random forests
21+
- Summary

code/ch05/README.md

+20-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
Sebastian Raschka, 2015
22

3-
# Python Machine Learning
4-
# Chapter 5 Code Examples
3+
Python Machine Learning - Code Examples
54

6-
## Compressing Data via Dimensionality Reduction
5+
## Chapter 5 - Compressing Data via Dimensionality Reduction
6+
7+
- Unsupervised dimensionality reduction via principal component analysis 128
8+
- Total and explained variance
9+
- Feature transformation
10+
- Principal component analysis in scikit-learn
11+
- Supervised data compression via linear discriminant analysis
12+
- Computing the scatter matrices
13+
- Selecting linear discriminants for the new feature subspace
14+
- Projecting samples onto the new feature space
15+
- LDA via scikit-learn
16+
- Using kernel principal component analysis for nonlinear mappings
17+
- Kernel functions and the kernel trick
18+
- Implementing a kernel principal component analysis in Python
19+
- Example 1 – separating half-moon shapes
20+
- Example 2 – separating concentric circles
21+
- Projecting new data points
22+
- Kernel principal component analysis in scikit-learn
23+
- Summary

code/ch06/README.md

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
Sebastian Raschka, 2015
22

3-
# Python Machine Learning
3+
Python Machine Learning - Code Examples
44

5-
# Chapter 6 Code Examples
6-
7-
## Learning Best Practices for Model Evaluation and Hyperparameter Tuning
5+
## Chapter 6 - Learning Best Practices for Model Evaluation and Hyperparameter Tuning
86

7+
- Streamlining workflows with pipelines
8+
- Loading the Breast Cancer Wisconsin dataset
9+
- Combining transformers and estimators in a pipeline
10+
- Using k-fold cross-validation to assess model performance
11+
- The holdout method
12+
- K-fold cross-validation
13+
- Debugging algorithms with learning and validation curves
14+
- Diagnosing bias and variance problems with learning curves
15+
- Addressing overfitting and underfitting with validation curves
16+
- Fine-tuning machine learning models via grid search
17+
- Tuning hyperparameters via grid search
18+
- Algorithm selection with nested cross-validation
19+
- Looking at different performance evaluation metrics
20+
- Reading a confusion matrix
21+
- Optimizing the precision and recall of a classification model
22+
- Plotting a receiver operating characteristic
23+
- The scoring metrics for multiclass classification
24+
- Summary
925

code/ch07/README.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Sebastian Raschka, 2015
22

3-
# Python Machine Learning
4-
# Chapter 7 Code Examples
3+
Python Machine Learning - Code Examples
54

6-
## Combining Different Models for Ensemble Learning
5+
## Chapter 7 - Combining Different Models for Ensemble Learning
6+
7+
8+
- Learning with ensembles
9+
- Implementing a simple majority vote classifier
10+
- Combining different algorithms for classification with majority vote
11+
- Evaluating and tuning the ensemble classifier
12+
- Bagging – building an ensemble of classifiers from bootstrap samples
13+
- Leveraging weak learners via adaptive boosting
14+
- Summary

code/ch08/README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Sebastian Raschka, 2015
22

3-
# Python Machine Learning
4-
# Chapter 8 Code Examples
3+
Python Machine Learning - Code Examples
54

6-
## Applying Machine Learning to Sentiment Analysis
5+
## Chapter 8 - Applying Machine Learning to Sentiment Analysis
6+
7+
- Obtaining the IMDb movie review dataset
8+
- Introducing the bag-of-words model
9+
- Transforming words into feature vectors
10+
- Assessing word relevancy via term frequency-inverse document frequency
11+
- Cleaning text data
12+
- Processing documents into tokens
13+
- Training a logistic regression model for document classification
14+
- Working with bigger data – online algorithms and out-of-core learning
15+
- Summary

code/ch09/README.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
Sebastian Raschka, 2015
22

3-
# Python Machine Learning
4-
# Chapter 9 Code Examples
3+
Python Machine Learning - Code Examples
54

6-
## Embedding a Machine Learning Model into a Web Application
5+
## Chapter 9 - Embedding a Machine Learning Model into a Web Application
76

7+
- Serializing fitted scikit-learn estimators
8+
- Setting up a SQLite database for data storage
9+
- Developing a web application with Flask
10+
- Our first Flask web application
11+
- Form validation and rendering
12+
- Turning the movie classifier into a web application
13+
- Deploying the web application to a public server
14+
- Updating the movie review classifier
15+
- Summary
16+
17+
---
818

919
The code for the Flask web applications can be found in the following directories:
1020

code/ch10/README.md

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
Sebastian Raschka, 2015
22

3-
# Python Machine Learning
4-
# Chapter 10 Code Examples
3+
Python Machine Learning - Code Examples
54

6-
## Predicting Continuous Target Variables with Regression Analysis
5+
## Chapter 10 - Predicting Continuous Target Variables with Regression Analysis
6+
7+
- Introducing a simple linear regression model
8+
- Exploring the Housing Dataset
9+
- Visualizing the important characteristics of a dataset
10+
- Implementing an ordinary least squares linear regression model
11+
- Solving regression for regression parameters with gradient descent
12+
- Estimating the coefficient of a regression model via scikit-learn
13+
- Fitting a robust regression model using RANSAC
14+
- Evaluating the performance of linear regression models
15+
- Using regularized methods for regression
16+
- Turning a linear regression model into a curve – polynomial regression
17+
- Modeling nonlinear relationships in the Housing Dataset
18+
- Dealing with nonlinear relationships using random forests
19+
- Decision tree regression
20+
- Random forest regression
21+
- Summary

code/ch11/README.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
Sebastian Raschka, 2015
22

3-
# Python Machine Learning
4-
# Chapter 11 Code Examples
3+
Python Machine Learning - Code Examples
54

6-
## Working with Unlabeled Data – Clustering Analysis
5+
## Chapter 11 - Working with Unlabeled Data – Clustering Analysis
6+
7+
- Grouping objects by similarity using k-means
8+
- K-means++
9+
- Hard versus soft clustering
10+
- Using the elbow method to find the optimal number of clusters
11+
- Quantifying the quality of clustering via silhouette plots
12+
- Organizing clusters as a hierarchical tree
13+
- Performing hierarchical clustering on a distance matrix
14+
- Attaching dendrograms to a heat map
15+
- Applying agglomerative clustering via scikit-learn
16+
- Locating regions of high density via DBSCAN
17+
- Summary

code/ch12/README.md

+21-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
Sebastian Raschka, 2015
22

3-
# Python Machine Learning
4-
# Chapter 12 Code Examples
3+
Python Machine Learning - Code Examples
54

6-
## Training Artificial Neural Networks for Image
5+
## Chapter 12 - Training Artificial Neural Networks for Image
6+
7+
- Modeling complex functions with artificial neural networks
8+
- Single-layer neural network recap
9+
- Introducing the multi-layer neural network architecture
10+
- Activating a neural network via forward propagation
11+
- Classifying handwritten digits
12+
- Obtaining the MNIST dataset
13+
- Implementing a multi-layer perceptron
14+
- Training an artificial neural network
15+
- Computing the logistic cost function
16+
- Training neural networks via backpropagation
17+
- Developing your intuition for backpropagation
18+
- Debugging neural networks with gradient checking
19+
- Convergence in neural networks
20+
- Other neural network architectures
21+
- Convolutional Neural Networks
22+
- Recurrent Neural Networks
23+
- A few last words about neural network implementation
24+
- Summary

code/ch13/README.md

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
Sebastian Raschka, 2015
22

3-
# Python Machine Learning
4-
# Chapter 13 Code Examples
3+
Python Machine Learning - Code Examples
54

6-
## Parallelizing Neural Network Training with Theano
5+
## Chapter 13 - Parallelizing Neural Network Training with Theano
6+
7+
- Building, compiling, and running expressions with Theano
8+
- What is Theano?
9+
- First steps with Theano
10+
- Configuring Theano
11+
- Working with array structures
12+
- Wrapping things up – a linear regression example
13+
- Choosing activation functions for feedforward neural networks
14+
- Logistic function recap
15+
- Estimating probabilities in multi-class classification via the softmax function
16+
- Broadening the output spectrum by using a hyperbolic tangent
17+
- Training neural networks efficiently using Keras
18+
- Summary

0 commit comments

Comments
 (0)