Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rasbt committed Dec 24, 2019
2 parents 0679e4c + 1a1d1a8 commit a9b686b
Show file tree
Hide file tree
Showing 78 changed files with 1,848 additions and 2,707 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ ch12/t10k-labels-idx1-ubyte.gz
ch12/train-images-idx3-ubyte.gz
ch12/train-labels-idx1-ubyte.gz

# Ch18 data files
ch08/aclImdb/
ch08/aclImdb_v1.tar.gz
ch08/movie_data.csv

# Other
*checkpoint
*tfevents*
*.data-00000-of-00001
Expand Down
Binary file added .other/cover_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2019 SEBASTIAN RASCHKA ([email protected])

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
## Python Machine Learning (3rd Ed.) Code Repository

![Python 3.6](https://img.shields.io/badge/Python-3.7-blue.svg)
![License](https://img.shields.io/badge/Code%20License-MIT-blue.svg)

Code repositories for the 1st and 2nd edition are available at

- https://github.com/rasbt/python-machine-learning-book and
- https://github.com/rasbt/python-machine-learning-book-2nd-edition

**Python Machine Learning, 3rd Ed.**

to be published December 12th, 2019

Paperback: 770 pages
Publisher: Packt Publishing
Language: English

ISBN-10: 1789955750
ISBN-13: 978-1789955750
Kindle ASIN: B07VBLX2W7

[<img src="./.other/cover_1.jpg" width="248">](https://www.amazon.com/Python-Machine-Learning-scikit-learn-TensorFlow/dp/1789955750/)


## Links

- [Amazon Page](https://www.amazon.com/Python-Machine-Learning-scikit-learn-TensorFlow/dp/1789955750/)
- [Packt Page](https://www.packtpub.com/data/python-machine-learning-third-edition)



## Table of Contents and Code Notebooks

**Helpful installation and setup instructions can be found in the [README.md file of Chapter 1](ch01/README.md)**

**Please note that these are just the code examples accompanying the book, which we 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 [[open dir](ch01)]
2. Training Machine Learning Algorithms for Classification [[open dir](ch02)]
3. A Tour of Machine Learning Classifiers Using Scikit-Learn [[open dir](ch03)]
4. Building Good Training Sets – Data Pre-Processing [[open dir](ch04)]
5. Compressing Data via Dimensionality Reduction [[open dir](ch05)]
6. Learning Best Practices for Model Evaluation and Hyperparameter Optimization [[open dir](ch06)]
7. Combining Different Models for Ensemble Learning [[open dir](ch07)]
8. Applying Machine Learning to Sentiment Analysis [[open dir](ch08)]
9. Embedding a Machine Learning Model into a Web Application [[open dir](ch09)]
10. Predicting Continuous Target Variables with Regression Analysis [[open dir](ch10)]
11. Working with Unlabeled Data – Clustering Analysis [[open dir](ch11)]
12. Implementing a Multi-layer Artificial Neural Network from Scratch [[open dir](ch12)]
13. Parallelizing Neural Network Training with TensorFlow [[open dir](ch13)]
14. Going Deeper: The Mechanics of TensorFlow [[open dir](ch14)]
15. Classifying Images with Deep Convolutional Neural Networks [[open dir](ch15)]
16. Modeling Sequential Data Using Recurrent Neural Networks [[open dir](ch16)]
17. Generative Adversarial Networks for Synthesizing New Data [[open dir](ch17)]
18. Reinforcement Learning for Decision Making in Complex Environments [[open dir](ch18)]


---

<br>
<br>

Raschka, Sebastian, and Vahid Mirjalili. *Python Machine Learning, 3rd Ed*. Packt Publishing, 2019.

@book{RaschkaMirjalili2019,
address = {Birmingham, UK},
author = {Raschka, Sebastian and Mirjalili, Vahid},
edition = {3},
isbn = {978-1789955750},
publisher = {Packt Publishing},
title = {{Python Machine Learning, 3rd Ed.}},
year = {2019}
}
10 changes: 5 additions & 5 deletions ch01/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ Throughout this book, we will mainly use NumPy's multi-dimensional arrays to sto

The version numbers of the major Python packages that were used for writing this book are listed below. Please make sure that the version numbers of your installed packages are equal to, or greater than, those version numbers to ensure the code examples run correctly:

- [NumPy](http://www.numpy.org) >= 1.16.4
- [SciPy](http://www.scipy.org) >= 1.2.1
- [scikit-learn](http://scikit-learn.org/stable/) >= 0.21.1
- [NumPy](http://www.numpy.org) >= 1.17.4
- [SciPy](http://www.scipy.org) >= 1.3.1
- [scikit-learn](http://scikit-learn.org/stable/) >= 0.22.0
- [matplotlib](http://matplotlib.org) >= 3.1.0
- [pandas](http://pandas.pydata.org) >= 0.24.2
- [pandas](http://pandas.pydata.org) >= 0.25.3

## Python/Jupyter Notebook

Expand Down Expand Up @@ -115,4 +115,4 @@ and similar to starting Jupyter Notebooks, you can run the command

$ jupyter lab

in your command line terminal to launch a Jupyter Lab session in your browser. For more information about the Jupyter Lab project, please visit the official documentation at https://jupyterlab.readthedocs.io/en/stable/,
in your command line terminal to launch a Jupyter Lab session in your browser. For more information about the Jupyter Lab project, please visit the official documentation at https://jupyterlab.readthedocs.io/en/stable/,
53 changes: 26 additions & 27 deletions ch02/ch02.ipynb

Large diffs are not rendered by default.

53 changes: 30 additions & 23 deletions ch03/ch03.ipynb

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions ch03/ch03.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@



# *The use of `watermark` is optional. You can install this IPython extension via "`pip install watermark`". For more information, please see: https://github.com/rasbt/watermark.*
# *The use of `watermark` is optional. You can install this Jupyter extension via*
#
# conda install watermark -c conda-forge
#
# or
#
# pip install watermark
#
# *For more information, please see: https://github.com/rasbt/watermark.*

# ### Overview

Expand Down Expand Up @@ -627,7 +635,7 @@ def error(p):
plt.ylim([0, 1.1])
plt.xlabel('p(i=1)')
plt.ylabel('impurity index')
plt.savefig('images/03_19.png', dpi=300, bbox_inches='tight')
#plt.savefig('images/03_19.png', dpi=300, bbox_inches='tight')
plt.show()


Expand Down
2 changes: 1 addition & 1 deletion ch04/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Python Machine Learning - Code Examples


## Chapter 4: Building Good Training Sets – Data Preprocessing
## Chapter 4: Building Good Training Datasets – Data Preprocessing

### Chapter Outline

Expand Down
40 changes: 20 additions & 20 deletions ch04/ch04.ipynb

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions ch04/ch04.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# # Python Machine Learning - Code Examples

# # Chapter 4 - Building Good Training Sets – Data Preprocessing
# # Chapter 4 - Building Good Training Datasets – Data Preprocessing

# Note that the optional watermark extension is a small IPython notebook plugin that I developed to make the code reproducible. You can just skip the following line(s).

Expand Down Expand Up @@ -319,9 +319,10 @@
c_transf.fit_transform(X).astype(float)


# ## Optional: Ordinal Encoding

# If we are unsure about the numerical differences between the categories of ordinal features, we can also encode them using a thresholded one-hot encoded format. For example, we can split the feature "size" with values M, L, and XL into two new features "x > M", "x > L", and . For example, let's consider the original DataFrame:
# ## Optional: Encoding Ordinal Features

# If we are unsure about the numerical differences between the categories of ordinal features, or the difference between two ordinal values is not defined, we can also encode them using a threshold encoding with 0/1 values. For example, we can split the feature "size" with values M, L, and XL into two new features "x > M" and "x > L". Let's consider the original DataFrame:



Expand Down
Loading

0 comments on commit a9b686b

Please sign in to comment.