├── .gitignore ├── LICENSE.txt ├── README.md ├── code ├── README.md ├── _convenience_scripts │ ├── blank_tocs │ │ ├── ch01.toc │ │ ├── ch02.toc │ │ ├── ch03.toc │ │ ├── ch04.toc │ │ ├── ch05.toc │ │ ├── ch06.toc │ │ ├── ch07.toc │ │ ├── ch08.toc │ │ ├── ch09.toc │ │ ├── ch10.toc │ │ ├── ch11.toc │ │ ├── ch12.toc │ │ └── ch13.toc │ ├── ipynb_toc_links.py │ └── md_toc.py ├── bonus │ ├── README.md │ ├── flask_webapp_ex01 │ │ ├── README.md │ │ ├── app.py │ │ ├── flask_webapp_ex01.zip │ │ ├── img │ │ │ └── img_1.png │ │ ├── static │ │ │ └── style.css │ │ └── templates │ │ │ ├── _formhelpers.html │ │ │ └── entry.html │ ├── images │ │ ├── logistic_regression_schematic.png │ │ ├── logistic_regression_schematic_2.png │ │ └── softmax_schematic_1.png │ ├── logistic_regression.ipynb │ ├── nested_cross_validation.ipynb │ ├── reading_mnist.ipynb │ ├── scikit-model-to-json.ipynb │ ├── sckit-model-to-json │ │ ├── attributes.json │ │ └── params.json │ ├── softmax-regression.ipynb │ └── svm_iris_pipeline_and_gridsearch.ipynb ├── ch01 │ ├── README.md │ ├── ch01.ipynb │ ├── images │ │ ├── 01_01.png │ │ ├── 01_02.png │ │ ├── 01_03.png │ │ ├── 01_04.png │ │ ├── 01_05.png │ │ ├── 01_06.png │ │ ├── 01_07.png │ │ ├── 01_08.png │ │ ├── 01_09.png │ │ ├── ipynb_ex1.png │ │ └── ipynb_ex2.png │ └── tests │ │ └── test_notebooks.py ├── ch02 │ ├── README.md │ ├── ch02.ipynb │ └── images │ │ ├── 02_01.png │ │ ├── 02_02.png │ │ ├── 02_03.png │ │ ├── 02_04.png │ │ ├── 02_05.png │ │ ├── 02_06.png │ │ ├── 02_07.png │ │ ├── 02_08.png │ │ ├── 02_09.png │ │ ├── 02_10.png │ │ ├── 02_11.png │ │ ├── 02_12.png │ │ ├── 02_13.png │ │ └── 02_14.png ├── ch03 │ ├── README.md │ ├── ch03.ipynb │ ├── images │ │ ├── 03_01.png │ │ ├── 03_02.png │ │ ├── 03_03.png │ │ ├── 03_04.png │ │ ├── 03_05.png │ │ ├── 03_06.png │ │ ├── 03_07.png │ │ ├── 03_08.png │ │ ├── 03_09.png │ │ ├── 03_10.png │ │ ├── 03_11.png │ │ ├── 03_12.png │ │ ├── 03_13.png │ │ ├── 03_14.png │ │ ├── 03_15.png │ │ ├── 03_16.png │ │ ├── 03_17.png │ │ ├── 03_18.png │ │ ├── 03_19.png │ │ ├── 03_20.png │ │ ├── 03_21.png │ │ ├── 03_22.png │ │ └── 03_23.png │ └── tree.dot ├── ch04 │ ├── README.md │ ├── ch04.ipynb │ └── images │ │ ├── 04_01.png │ │ ├── 04_02.png │ │ ├── 04_03.png │ │ ├── 04_04.png │ │ ├── 04_05.png │ │ ├── 04_06.png │ │ ├── 04_07.png │ │ ├── 04_08.png │ │ ├── 04_09.png │ │ ├── 04_10.png │ │ ├── 04_11.png │ │ ├── 04_12.png │ │ ├── 04_13.png │ │ ├── 04_14.png │ │ ├── 04_15.png │ │ └── 04_16.png ├── ch05 │ ├── README.md │ ├── ch05.ipynb │ └── images │ │ ├── 05_01.png │ │ ├── 05_02.png │ │ ├── 05_03.png │ │ ├── 05_04.png │ │ ├── 05_05.png │ │ ├── 05_06.png │ │ ├── 05_07.png │ │ ├── 05_08.png │ │ ├── 05_09.png │ │ ├── 05_10.png │ │ ├── 05_11.png │ │ ├── 05_12.png │ │ ├── 05_13.png │ │ ├── 05_14.png │ │ ├── 05_15.png │ │ ├── 05_16.png │ │ ├── 05_17.png │ │ ├── 05_18.png │ │ └── 05_19.png ├── ch06 │ ├── README.md │ ├── ch06.ipynb │ └── images │ │ ├── 06_01.png │ │ ├── 06_02.png │ │ ├── 06_03.png │ │ ├── 06_04.png │ │ ├── 06_05.png │ │ ├── 06_06.png │ │ ├── 06_07.png │ │ ├── 06_08.png │ │ ├── 06_09.png │ │ └── 06_10.png ├── ch07 │ ├── README.md │ ├── ch07.ipynb │ └── images │ │ ├── 07_01.png │ │ ├── 07_02.png │ │ ├── 07_03.png │ │ ├── 07_04.png │ │ ├── 07_05.png │ │ ├── 07_06.png │ │ ├── 07_07.png │ │ ├── 07_08.png │ │ ├── 07_09.png │ │ ├── 07_10.png │ │ └── 07_11.png ├── ch08 │ ├── README.md │ ├── ch08.ipynb │ └── images │ │ └── 08_01.png ├── ch09 │ ├── 1st_flask_app_1 │ │ ├── app.py │ │ └── templates │ │ │ └── first_app.html │ ├── 1st_flask_app_2 │ │ ├── app.py │ │ ├── static │ │ │ └── style.css │ │ └── templates │ │ │ ├── _formhelpers.html │ │ │ ├── first_app.html │ │ │ └── hello.html │ ├── README.md │ ├── ch09.ipynb │ ├── images │ │ ├── 09_01.png │ │ ├── 09_02.png │ │ ├── 09_03.png │ │ ├── 09_04.png │ │ ├── 09_05.png │ │ ├── 09_06.png │ │ ├── 09_07.png │ │ └── 09_08.png │ ├── movieclassifier │ │ ├── app.py │ │ ├── pkl_objects │ │ │ ├── classifier.pkl │ │ │ └── stopwords.pkl │ │ ├── reviews.sqlite │ │ ├── static │ │ │ └── style.css │ │ ├── templates │ │ │ ├── _formhelpers.html │ │ │ ├── results.html │ │ │ ├── reviewform.html │ │ │ └── thanks.html │ │ └── vectorizer.py │ ├── movieclassifier_with_update │ │ ├── app.py │ │ ├── pkl_objects │ │ │ ├── classifier.pkl │ │ │ └── stopwords.pkl │ │ ├── reviews.sqlite │ │ ├── static │ │ │ └── style.css │ │ ├── templates │ │ │ ├── _formhelpers.html │ │ │ ├── results.html │ │ │ ├── reviewform.html │ │ │ └── thanks.html │ │ ├── update.py │ │ └── vectorizer.py │ └── pickle-test-scripts │ │ ├── README.md │ │ ├── movie_data_small.csv │ │ ├── pickle-dump-test.py │ │ ├── pickle-load-test.py │ │ └── vectorizer.py ├── ch10 │ ├── README.md │ ├── ch10.ipynb │ └── images │ │ ├── 10_01.png │ │ ├── 10_02.png │ │ ├── 10_03.png │ │ ├── 10_04.png │ │ ├── 10_05.png │ │ ├── 10_06.png │ │ ├── 10_07.png │ │ ├── 10_08.png │ │ ├── 10_09.png │ │ ├── 10_10.png │ │ ├── 10_11.png │ │ ├── 10_12.png │ │ ├── 10_13.png │ │ └── 10_14.png ├── ch11 │ ├── README.md │ ├── ch11.ipynb │ └── images │ │ ├── 11_01.png │ │ ├── 11_02.png │ │ ├── 11_03.png │ │ ├── 11_04.png │ │ ├── 11_05.png │ │ ├── 11_06.png │ │ ├── 11_07.png │ │ ├── 11_08.png │ │ ├── 11_09.png │ │ ├── 11_10.png │ │ ├── 11_11.png │ │ ├── 11_12.png │ │ ├── 11_13.png │ │ ├── 11_14.png │ │ ├── 11_15.png │ │ └── 11_16.png ├── ch12 │ ├── README.md │ ├── ch12.ipynb │ ├── images │ │ ├── 12_01.png │ │ ├── 12_02.png │ │ ├── 12_03.png │ │ ├── 12_04.png │ │ ├── 12_05.png │ │ ├── 12_06.png │ │ ├── 12_07.png │ │ ├── 12_08.png │ │ ├── 12_09.png │ │ ├── 12_10.png │ │ ├── 12_11.png │ │ ├── 12_12.png │ │ ├── 12_13.png │ │ ├── 12_14.png │ │ ├── 12_15.png │ │ ├── 12_16.png │ │ └── 12_17.png │ ├── neuralnet.py │ └── optional-streamlined-neuralnet.py ├── ch13 │ ├── README.md │ ├── ch13.ipynb │ ├── images │ │ ├── 13_01.png │ │ ├── 13_02.png │ │ ├── 13_03.png │ │ ├── 13_04.png │ │ ├── 13_05.png │ │ └── bonus_softmax_1.png │ └── mnist_keras_mlp.py ├── check_environment.ipynb ├── datasets │ ├── README.md │ ├── housing │ │ ├── README.md │ │ ├── housing.data │ │ └── housing.names.txt │ ├── iris │ │ ├── README.md │ │ └── iris.data │ ├── mnist │ │ ├── README.md │ │ ├── t10k-images-idx3-ubyte.gz │ │ ├── t10k-labels-idx1-ubyte.gz │ │ ├── train-images-idx3-ubyte.gz │ │ └── train-labels-idx1-ubyte.gz │ ├── movie │ │ ├── README.md │ │ └── movie_data.csv.zip │ ├── wdbc │ │ ├── README.md │ │ ├── wdbc.data │ │ └── wdbc.names.txt │ └── wine │ │ ├── README.md │ │ ├── wine.data │ │ └── wine.names.txt └── optional-py-scripts │ ├── ch02.py │ ├── ch03.py │ ├── ch04.py │ ├── ch05.py │ ├── ch06.py │ ├── ch07.py │ ├── ch08.py │ ├── ch09.py │ ├── ch10.py │ ├── ch11.py │ ├── ch12.py │ └── ch13.py ├── docs ├── 2016-03-03-unicef.pdf ├── 2016-04-07-unicef.pdf ├── 2016-11-10-commoncause.png ├── equations │ ├── pymle-equations.pdf │ ├── pymle-equations.tex │ └── pymle-equations.toc ├── errata.md ├── feedback.md ├── foreword_ro.pdf ├── images │ ├── armand_g_tweet.png │ ├── boris_tweet.png │ ├── claus_tweet.png │ ├── dataelixir.png │ ├── errata │ │ ├── errata_2015-10-20.png │ │ └── errata_2016-04-22.jpg │ ├── jason_tweet.png │ ├── jonathon_m_tweet.png │ ├── josiah_tweet.png │ ├── matteo_tweet.png │ ├── matthew_m_tweet.png │ ├── penghui_tweet.png │ └── yong_cho_tweet.png ├── preface_sr.pdf ├── pymle.bib ├── references.md └── running_jupyter_nb.pdf ├── faq ├── README.md ├── ai-and-ml.md ├── ai-and-ml │ └── ai-and-ml-1.png ├── avoid-overfitting.md ├── bag-of-words-sparsity.md ├── bagging-boosting-rf.md ├── bagging-boosting-rf │ ├── bagging-regions.png │ ├── bagging.png │ ├── boosting-regions.png │ └── boosting.png ├── best-ml-algo.md ├── choosing-technique.md ├── choosing-technique │ └── scikit-cheatsheet.png ├── classifier-categories.md ├── classifier-history.md ├── classifier-history │ ├── activation-functions.png │ ├── adaline.png │ ├── lda.png │ ├── perceptron-figure.png │ └── perceptron-rule.png ├── classifier_categories │ └── master_chart.jpg ├── clf-behavior-data.md ├── clf-behavior-data │ ├── circles.png │ ├── iris.png │ ├── moons.png │ └── xor.png ├── closed-form-vs-gd.md ├── closed-form-vs-gd │ ├── adaptive_learning.png │ ├── ball.png │ ├── closed-form.png │ ├── decrease_const.png │ ├── dw.png │ ├── iter_gd.png │ ├── iter_sgd.png │ ├── j.png │ ├── linear_model.png │ ├── simple_regression.png │ ├── sse_mse.png │ ├── w_upd.png │ └── w_upd_expl.png ├── computing-the-f1-score.md ├── copyright.md ├── cost-vs-loss.md ├── data-science-career.md ├── datamining-overview.md ├── datamining-vs-ml.md ├── dataprep-vs-dataengin.md ├── datascience-ml.md ├── datascience-ml │ └── ml-overview.jpg ├── decision-tree-binary.md ├── decision-tree-binary │ ├── calc_1.png │ ├── calc_2.png │ ├── calc_3.png │ ├── calc_5.png │ ├── calc_6.png │ ├── empty-classes.png │ ├── entropy.png │ ├── error.png │ ├── gini-impurity.png │ ├── information-gain-2.png │ ├── information-gain.png │ ├── overview-plot.png │ └── split.png ├── decision-tree-disadvantages.md ├── decisiontree-error-vs-entropy.md ├── decisiontree-error-vs-entropy │ ├── Slide1.png │ ├── Slide2.png │ ├── Slide3.png │ ├── decisiontree-error-vs-entropy.ipynb │ ├── decisiontree-error-vs-entropy.pptx │ ├── entropy_annotated.png │ ├── entropy_eq.png │ ├── entropy_plot.png │ ├── error_eq.png │ ├── error_plot.png │ ├── ig.png │ └── ig_xp.png ├── deep-learning-resources.md ├── deeplearn-vs-svm-randomforest.md ├── deeplearning-criticism.md ├── definition_data-science.md ├── diff-perceptron-adaline-neuralnet.md ├── diff-perceptron-adaline-neuralnet │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ ├── 7.png │ └── 8.png ├── difference-deep-and-normal-learning.md ├── difference-deep-and-normal-learning │ ├── convnet.png │ ├── convolution.png │ └── mlp.png ├── difference_classifier_model.md ├── different.md ├── dimensionality-reduction.md ├── dimensionality-reduction │ ├── lle.png │ ├── rbf-kpca.png │ └── swiss-roll.png ├── dropout.md ├── euclidean-distance.md ├── euclidean-distance │ ├── eucl-1.png │ └── eucl-2.png ├── evaluate-a-model.md ├── evaluate-a-model │ ├── evaluate_overview.eps │ ├── evaluate_overview.pdf │ ├── evaluate_overview.png │ ├── k-fold.png │ └── nested-k-fold.png ├── feature_sele_categories.md ├── implementing-from-scratch.md ├── inventing-deeplearning.md ├── issues-with-clustering.md ├── issues-with-clustering │ ├── clusters_kmeans.png │ ├── clusters_unlabeled.png │ ├── elbow.png │ ├── silhouette_bad.png │ └── silhouette_good.png ├── large-num-features.md ├── large-num-features │ ├── concentric-circles.png │ ├── kpca-pc1.png │ ├── lle1.png │ ├── lle2.png │ ├── pca-pc1.png │ └── swiss-roll.png ├── lazy-knn.md ├── lda-vs-pca.md ├── lda-vs-pca │ ├── lda.png │ └── pca.png ├── linear-gradient-derivative.md ├── linear-gradient-derivative │ ├── 1.png │ ├── 10.png │ ├── 11.png │ ├── 12.png │ ├── 13.png │ ├── 14.png │ ├── 15.png │ ├── 16.png │ ├── 17.png │ ├── 18.png │ ├── 19.png │ ├── 2.png │ ├── 20.png │ ├── 21.png │ ├── 22.png │ ├── 23.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ ├── 7.png │ ├── 8.png │ ├── 9.png │ └── regression-vs-adaline.png ├── logistic-analytical.md ├── logistic-boosting.md ├── logistic-why-sigmoid.md ├── logistic-why-sigmoid │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ └── 7.png ├── logistic_regression_linear.md ├── logistic_regression_linear │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png ├── logisticregr-neuralnet.md ├── logisticregr-neuralnet │ ├── log-tanh.png │ ├── mlp.png │ ├── onehot.png │ ├── schematic.png │ ├── sigmoid.png │ ├── softmax.png │ └── unconvex.png ├── many-deeplearning-libs.md ├── median-vs-mean.md ├── median-vs-mean │ ├── FGCU_salary_dataset.csv │ ├── mean-vs-median.ipynb │ ├── salary.png │ └── std-normal.png ├── mentor.md ├── missing-data.md ├── ml-curriculum.md ├── ml-curriculum │ ├── bengio.png │ ├── bishop.jpeg │ ├── domingos.png │ ├── duda.jpg │ ├── ng.png │ ├── raschka.jpeg │ ├── tan.jpeg │ ├── three.png │ └── tibshirani.jpeg ├── ml-examples.md ├── ml-examples │ ├── fb.png │ ├── google.png │ ├── hiv-protease.png │ ├── letter.jpg │ ├── stars.jpg │ └── stock-market.png ├── ml-origins.md ├── ml-python-communities.md ├── ml-solvable.md ├── ml-solvable │ ├── bias-variance.png │ ├── learning_curve.png │ └── param_curve.png ├── ml-to-a-programmer.md ├── model-selection-in-datascience.md ├── multiclass-metric.md ├── multiclass-metric │ ├── conf_mat.png │ ├── macro.png │ ├── mcc.png │ ├── micro.png │ └── pre-rec.png ├── naive-bayes-boundary.md ├── naive-bayes-boundary │ ├── gaussian_1.png │ └── gaussian_2.png ├── naive-bayes-vartypes.md ├── naive-bayes-vartypes │ ├── bayes-theorem-in-words.png │ ├── bayes-theorem-notation.png │ ├── bayes-theorem.png │ ├── combined.png │ ├── gaussian-likelihood.png │ ├── likelihood-bernoulli.png │ ├── multi-variate-bernoulli.png │ ├── naive-bayes-decision.png │ ├── naive-bayes-likelihood.png │ └── naive-bayes-likelihood_shorter.png ├── naive-bayes-vs-logistic-regression.md ├── naive-naive-bayes.md ├── naive-naive-bayes │ ├── bayes-theorem-english.png │ ├── bayes_theorem.png │ ├── decision_rule.png │ ├── let.png │ └── likelihood.png ├── neuralnet-error.md ├── neuralnet-error │ ├── approx-grad-1.png │ ├── approx-grad-2.png │ ├── approx-grad-3.png │ ├── approx-grad-4.png │ ├── momentum.png │ └── standardizing.png ├── nnet-debugging-checklist.md ├── num-support-vectors.md ├── number-of-kfolds.md ├── open-source.md ├── overfitting.md ├── overfitting │ └── learning_curve_1.png ├── parametric_vs_nonparametric.md ├── pca-scaling.md ├── pca-scaling │ ├── 1.png │ ├── 10.png │ ├── 11.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ ├── 7.png │ ├── 8.png │ └── 9.png ├── pearson-r-vs-linear-regr.md ├── pearson-r-vs-linear-regr │ ├── covariance.png │ ├── example-1-fit.png │ ├── example-1.png │ ├── example-2-fit.png │ ├── example-2.png │ ├── intercept.png │ ├── pearson.png │ ├── sigma.png │ ├── slope.png │ ├── slope_r.png │ ├── slope_rewrite.png │ └── standardize.png ├── prerequisites.md ├── probablistic-logistic-regression.md ├── probablistic-logistic-regression │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ ├── 7.png │ ├── 8.png │ └── 9.png ├── py2py3.md ├── r-in-datascience.md ├── random-forest-perform-terribly.md ├── regularized-logistic-regression-performance.md ├── regularized-logistic-regression-performance │ ├── l2-term.png │ ├── regularized.png │ └── unregularized.png ├── return_self_idiom.md ├── scale-training-test.md ├── select_svm_kernels.md ├── select_svm_kernels │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ └── 5.png ├── semi-vs-supervised.md ├── softmax.md ├── softmax │ ├── logistic.png │ ├── net_input.png │ └── softmax_1.png ├── softmax_regression.md ├── softmax_regression │ ├── 1.png │ ├── 10.png │ ├── 11.png │ ├── 12.png │ ├── 13.png │ ├── 14.png │ ├── 15.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ ├── 7.png │ ├── 8.png │ ├── 9.png │ └── logistic_regression_schematic.png ├── standardize-param-reuse.md ├── svm_for_categorical_data.md ├── svm_for_categorical_data │ └── onehot-color.png ├── technologies.md ├── tensorflow-vs-scikitlearn.md ├── tensorflow-vs-scikitlearn │ ├── scikit-softmax.png │ ├── tf_cost.png │ └── tf_softmax.png ├── underscore-convention.md ├── version.md ├── visual-backpropagation.md ├── visual-backpropagation │ ├── backpropagation.png │ ├── chain_rule_1.png │ ├── chain_rule_2.png │ ├── forward-propagation.png │ └── nonconvex-cost.png ├── when-to-standardize.md ├── why-python.md └── why-python │ ├── automation.png │ ├── heatmap.png │ ├── ipython_notebook.png │ ├── julia_benchmark.png │ ├── python.png │ ├── revor.png │ ├── spectrum.jpg │ ├── the_general_problem.png │ └── tiobe.png └── images ├── CRBadgeNotableBook.jpg ├── check_env.png ├── cover_1.png ├── equation-ref-logo.png ├── image_gallery └── README.md ├── ml-overview.jpg ├── mlxtend_logo.png ├── pymle-cover_cn.jpg ├── pymle-cover_cn_mainland.jpg ├── pymle-cover_de.jpg ├── pymle-cover_de_old.jpg ├── pymle-cover_it.jpg ├── pymle-cover_jp.jpg ├── pymle-cover_kr.jpg ├── pymle-cover_pl.jpg ├── pymle-cover_ru.jpg ├── pymle_amzn.png ├── pymle_cover.jpg ├── pymle_cover_double_small.jpg ├── pymle_cover_small.jpg └── scipy2016.jpg /.gitignore: -------------------------------------------------------------------------------- 1 | docs/equations/*.aux 2 | docs/equations/*.log 3 | docs/equations/*.out 4 | docs/equations/*.synctex.gz 5 | code/ch12/mnist 6 | code/datasets/mnist/t10k-images-idx3-ubyte 7 | code/datasets/mnist/t10k-labels-idx1-ubyte 8 | code/datasets/mnist/train-images-idx3-ubyte 9 | code/datasets/mnist/train-labels-idx1-ubyte 10 | 11 | .ipynb_checkpoints 12 | .DS_Store 13 | code/datasets/movie/aclImdb_v1.tar.gz 14 | 15 | # Byte-compiled / optimized / DLL files 16 | __pycache__/ 17 | *.py[cod] 18 | 19 | # C extensions 20 | *.so 21 | 22 | # Distribution / packaging 23 | .Python 24 | env/ 25 | build/ 26 | develop-eggs/ 27 | dist/ 28 | downloads/ 29 | eggs/ 30 | .eggs/ 31 | lib/ 32 | lib64/ 33 | parts/ 34 | sdist/ 35 | var/ 36 | *.egg-info/ 37 | .installed.cfg 38 | *.egg 39 | 40 | # PyInstaller 41 | # Usually these files are written by a python script from a template 42 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 43 | *.manifest 44 | *.spec 45 | 46 | # Installer logs 47 | pip-log.txt 48 | pip-delete-this-directory.txt 49 | 50 | # Unit test / coverage reports 51 | htmlcov/ 52 | .tox/ 53 | .coverage 54 | .coverage.* 55 | .cache 56 | nosetests.xml 57 | coverage.xml 58 | *,cover 59 | 60 | # Translations 61 | *.mo 62 | *.pot 63 | 64 | # Django stuff: 65 | *.log 66 | 67 | # Sphinx documentation 68 | docs/_build/ 69 | 70 | # PyBuilder 71 | target/ 72 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015, 2016 SEBASTIAN RASCHKA (mail@sebastianraschka.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /code/_convenience_scripts/blank_tocs/ch01.toc: -------------------------------------------------------------------------------- 1 | Building intelligent machines to transform data into knowledge 2 | The three different types of machine learning 3 | Making predictions about the future with supervised learning 4 | Classification for predicting class labels 5 | Regression for predicting continuous outcomes 6 | Solving interactive problems with reinforcement learning 7 | Discovering hidden structures with unsupervised learning 8 | Finding subgroups with clustering 9 | Dimensionality reduction for data compression 10 | An introduction to the basic terminology and notations 11 | A roadmap for building machine learning systems 12 | Preprocessing – getting data into shape 13 | Training and selecting a predictive model 14 | Evaluating models and predicting unseen data instances 15 | Using Python for machine learning 16 | Installing Python packages 17 | Summary 18 | -------------------------------------------------------------------------------- /code/_convenience_scripts/blank_tocs/ch02.toc: -------------------------------------------------------------------------------- 1 | Artificial neurons - a brief glimpse into the early history 2 | of machine learning 3 | Implementing a perceptron learning algorithm in Python 4 | Training a perceptron model on the Iris dataset 5 | Adaptive linear neurons and the convergence of learning 6 | Minimizing cost functions with gradient descent 7 | Implementing an Adaptive Linear Neuron in Python 8 | Large scale machine learning and stochastic gradient descent 9 | Summary 10 | -------------------------------------------------------------------------------- /code/_convenience_scripts/blank_tocs/ch03.toc: -------------------------------------------------------------------------------- 1 | Choosing a classification algorithm 2 | First steps with scikit-learn 3 | Training a perceptron via scikit-learn 4 | Modeling class probabilities via logistic regression 5 | Logistic regression intuition and conditional probabilities 6 | Learning the weights of the logistic cost function 7 | Training a logistic regression model with scikit-learn 8 | Tackling overfitting via regularization 9 | Maximum margin classification with support vector machines 10 | Maximum margin intuition 11 | Dealing with the nonlinearly separable case using slack variables 12 | Alternative implementations in scikit-learn 13 | Solving nonlinear problems using a kernel SVM 14 | Using the kernel trick to find separating hyperplanes in higher dimensional space 15 | Decision tree learning 16 | Maximizing information gain – getting the most bang for the buck 17 | Building a decision tree 18 | Combining weak to strong learners via random forests 19 | K-nearest neighbors – a lazy learning algorithm 20 | Summary 21 | -------------------------------------------------------------------------------- /code/_convenience_scripts/blank_tocs/ch04.toc: -------------------------------------------------------------------------------- 1 | Dealing with missing data 2 | Eliminating samples or features with missing values 3 | Imputing missing values 4 | Understanding the scikit-learn estimator API 5 | Handling categorical data 6 | Mapping ordinal features 7 | Encoding class labels 8 | Performing one-hot encoding on nominal features 9 | Partitioning a dataset in training and test sets 10 | Bringing features onto the same scale 11 | Selecting meaningful features 12 | Sparse solutions with L1 regularization 13 | Sequential feature selection algorithms 14 | Assessing feature importance with random forests 15 | Summary 16 | -------------------------------------------------------------------------------- /code/_convenience_scripts/blank_tocs/ch05.toc: -------------------------------------------------------------------------------- 1 | Unsupervised dimensionality reduction via principal component analysis 128 2 | Total and explained variance 3 | Feature transformation 4 | Principal component analysis in scikit-learn 5 | Supervised data compression via linear discriminant analysis 6 | Computing the scatter matrices 7 | Selecting linear discriminants for the new feature subspace 8 | Projecting samples onto the new feature space 9 | LDA via scikit-learn 10 | Using kernel principal component analysis for nonlinear mappings 11 | Kernel functions and the kernel trick 12 | Implementing a kernel principal component analysis in Python 13 | Example 1 – separating half-moon shapes 14 | Example 2 – separating concentric circles 15 | Projecting new data points 16 | Kernel principal component analysis in scikit-learn 17 | Summary 18 | -------------------------------------------------------------------------------- /code/_convenience_scripts/blank_tocs/ch06.toc: -------------------------------------------------------------------------------- 1 | Streamlining workflows with pipelines Loading the Breast Cancer Wisconsin dataset Combining transformers and estimators in a pipeline Using k-fold cross-validation to assess model performance The holdout method K-fold cross-validation Debugging algorithms with learning and validation curves Diagnosing bias and variance problems with learning curves Addressing overfitting and underfitting with validation curves Fine-tuning machine learning models via grid search Tuning hyperparameters via grid search Algorithm selection with nested cross-validation Looking at different performance evaluation metrics Reading a confusion matrix 2 | Optimizing the precision and recall of a classification model 3 | Plotting a receiver operating characteristic The scoring metrics for multiclass classification 4 | Summary -------------------------------------------------------------------------------- /code/_convenience_scripts/blank_tocs/ch07.toc: -------------------------------------------------------------------------------- 1 | Learning with ensembles 2 | Implementing a simple majority vote classifier 3 | Combining different algorithms for classification with majority vote 4 | Evaluating and tuning the ensemble classifier Bagging – building an ensemble of classifiers from bootstrap samples 5 | Leveraging weak learners via adaptive boosting 6 | Summary -------------------------------------------------------------------------------- /code/_convenience_scripts/blank_tocs/ch08.toc: -------------------------------------------------------------------------------- 1 | Obtaining the IMDb movie review dataset 2 | Introducing the bag-of-words model Transforming words into feature vectors 3 | Assessing word relevancy via term frequency-inverse document frequency 4 | Cleaning text data 5 | Processing documents into tokens Training a logistic regression model for document classification 6 | Working with bigger data – online algorithms and out-of-core learning 7 | Summary -------------------------------------------------------------------------------- /code/_convenience_scripts/blank_tocs/ch09.toc: -------------------------------------------------------------------------------- 1 | Serializing fitted scikit-learn estimators 2 | Setting up a SQLite database for data storage 3 | Developing a web application with Flask 4 | Our first Flask web application 5 | Form validation and rendering 6 | Turning the movie classifier into a web application Deploying the web application to a public server Updating the movie review classifier Summary -------------------------------------------------------------------------------- /code/_convenience_scripts/blank_tocs/ch10.toc: -------------------------------------------------------------------------------- 1 | Introducing a simple linear regression model 2 | Exploring the Housing Dataset 3 | Visualizing the important characteristics of a dataset 4 | Implementing an ordinary least squares linear regression model 5 | Solving regression for regression parameters with gradient descent 6 | Estimating the coefficient of a regression model via scikit-learn 7 | Fitting a robust regression model using RANSAC 8 | Evaluating the performance of linear regression models 9 | Using regularized methods for regression Turning a linear regression model into a curve – polynomial regression 10 | Modeling nonlinear relationships in the Housing Dataset Dealing with nonlinear relationships using random forests 11 | Decision tree regression 12 | Random forest regression Summary -------------------------------------------------------------------------------- /code/_convenience_scripts/blank_tocs/ch11.toc: -------------------------------------------------------------------------------- 1 | Grouping objects by similarity using k-means 2 | K-means++ 3 | Hard versus soft clustering 4 | Using the elbow method to find the optimal number of clusters 5 | Quantifying the quality of clustering via silhouette plots 6 | Organizing clusters as a hierarchical tree 7 | Performing hierarchical clustering on a distance matrix 8 | Attaching dendrograms to a heat map 9 | Applying agglomerative clustering via scikit-learn 10 | Locating regions of high density via DBSCAN 11 | Summary -------------------------------------------------------------------------------- /code/_convenience_scripts/blank_tocs/ch12.toc: -------------------------------------------------------------------------------- 1 | Modeling complex functions with artificial neural networks 2 | Single-layer neural network recap 3 | Introducing the multi-layer neural network architecture 4 | Activating a neural network via forward propagation 5 | Classifying handwritten digits Obtaining the MNIST dataset Implementing a multi-layer perceptron Training an artificial neural network Computing the logistic cost function Training neural networks via backpropagation Developing your intuition for backpropagation 6 | Debugging neural networks with gradient checking 7 | Convergence in neural networks 8 | Other neural network architectures Convolutional Neural Networks Recurrent Neural Networks A few last words about neural network implementation 9 | Summary -------------------------------------------------------------------------------- /code/_convenience_scripts/blank_tocs/ch13.toc: -------------------------------------------------------------------------------- 1 | Building, compiling, and running expressions with Theano 2 | What is Theano? 3 | First steps with Theano 4 | Configuring Theano 5 | Working with array structures 6 | Wrapping things up – a linear regression example 7 | Choosing activation functions for feedforward neural networks 8 | Logistic function recap Estimating probabilities in multi-class classification via the softmax function 9 | Broadening the output spectrum by using a hyperbolic tangent Training neural networks efficiently using Keras Summary -------------------------------------------------------------------------------- /code/_convenience_scripts/ipynb_toc_links.py: -------------------------------------------------------------------------------- 1 | # Sebastian Raschka, 2015 2 | # convenience function for myself to add internal links to IPython toc 3 | # use as `python ipynb_toc_links.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 | out_str += '](#%s)' % line.replace(' ', '-') 14 | print(out_str) 15 | -------------------------------------------------------------------------------- /code/_convenience_scripts/md_toc.py: -------------------------------------------------------------------------------- 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) 14 | -------------------------------------------------------------------------------- /code/bonus/flask_webapp_ex01/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | Python Machine Learning - Code Examples (Bonus Material) 4 | 5 | 6 | # A Simple(r) Barebones Flask Webapp Template 7 | 8 | A simple Flask app that calculates the sum of two numbers entered in the respective input fields. 9 | 10 | You can run the app locally by executing `python app.py` within this directory. 11 | 12 |
13 | 14 | ![](./img/img_1.png) 15 | 16 | Click [here](https://github.com/rasbt/python-machine-learning-book/raw/master/code/bonus/flask_webapp_ex01/flask_webapp_ex01.zip) to download this example as zip-file. -------------------------------------------------------------------------------- /code/bonus/flask_webapp_ex01/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template, request 2 | from wtforms import Form, DecimalField, validators 3 | 4 | app = Flask(__name__) 5 | 6 | 7 | class EntryForm(Form): 8 | x_entry = DecimalField('x:', 9 | places=10, 10 | validators=[validators.NumberRange(-1e10, 1e10)]) 11 | y_entry = DecimalField('y:', 12 | places=10, 13 | validators=[validators.NumberRange(-1e10, 1e10)]) 14 | 15 | @app.route('/') 16 | def index(): 17 | form = EntryForm(request.form) 18 | return render_template('entry.html', form=form, z='') 19 | 20 | @app.route('/results', methods=['POST']) 21 | def results(): 22 | form = EntryForm(request.form) 23 | z = '' 24 | if request.method == 'POST' and form.validate(): 25 | x = request.form['x_entry'] 26 | y = request.form['y_entry'] 27 | z = float(x) + float(y) 28 | return render_template('entry.html', form=form, z=z) 29 | 30 | if __name__ == '__main__': 31 | app.run(debug=True) -------------------------------------------------------------------------------- /code/bonus/flask_webapp_ex01/flask_webapp_ex01.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/bonus/flask_webapp_ex01/flask_webapp_ex01.zip -------------------------------------------------------------------------------- /code/bonus/flask_webapp_ex01/img/img_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/bonus/flask_webapp_ex01/img/img_1.png -------------------------------------------------------------------------------- /code/bonus/flask_webapp_ex01/static/style.css: -------------------------------------------------------------------------------- 1 | body{ 2 | width:600px; 3 | } 4 | 5 | #button{ 6 | padding-top: 20px; 7 | } -------------------------------------------------------------------------------- /code/bonus/flask_webapp_ex01/templates/_formhelpers.html: -------------------------------------------------------------------------------- 1 | {% macro render_field(field) %} 2 |
{{ field.label }} 3 |
{{ field(**kwargs)|safe }} 4 | {% if field.errors %} 5 | 10 | {% endif %} 11 |
12 | {% endmacro %} -------------------------------------------------------------------------------- /code/bonus/flask_webapp_ex01/templates/entry.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Webapp Ex 1 5 | 6 | 7 | 8 | 9 | {% from "_formhelpers.html" import render_field %} 10 | 11 |
12 |
13 | {{ render_field(form.x_entry, cols='1', rows='1') }} 14 | {{ render_field(form.y_entry, cols='1', rows='1') }} 15 |
16 |
17 | 18 |
19 | 20 |
21 | x + y = {{ z }} 22 |
23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /code/bonus/images/logistic_regression_schematic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/bonus/images/logistic_regression_schematic.png -------------------------------------------------------------------------------- /code/bonus/images/logistic_regression_schematic_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/bonus/images/logistic_regression_schematic_2.png -------------------------------------------------------------------------------- /code/bonus/images/softmax_schematic_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/bonus/images/softmax_schematic_1.png -------------------------------------------------------------------------------- /code/bonus/sckit-model-to-json/attributes.json: -------------------------------------------------------------------------------- 1 | { 2 | "classes_":[ 3 | 0, 4 | 1, 5 | 2 6 | ], 7 | "coef_":[ 8 | [ 9 | 0.42625236403173844, 10 | -8.557501546363858 11 | ], 12 | [ 13 | 1.5644231337040186, 14 | -1.6783659020502222 15 | ], 16 | [ 17 | -1.990675497337773, 18 | 10.235867448186507 19 | ] 20 | ], 21 | "intercept_":[ 22 | 27.533384852155145, 23 | 4.18509910962595, 24 | -31.71848396177913 25 | ], 26 | "n_iter_":[ 27 | 27 28 | ] 29 | } -------------------------------------------------------------------------------- /code/bonus/sckit-model-to-json/params.json: -------------------------------------------------------------------------------- 1 | {"dual": false, "max_iter": 100, "warm_start": false, "verbose": 0, "C": 100.0, "class_weight": null, "random_state": 1, "fit_intercept": true, "multi_class": "multinomial", "intercept_scaling": 1, "penalty": "l2", "solver": "newton-cg", "n_jobs": 1, "tol": 0.0001} -------------------------------------------------------------------------------- /code/ch01/images/01_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch01/images/01_01.png -------------------------------------------------------------------------------- /code/ch01/images/01_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch01/images/01_02.png -------------------------------------------------------------------------------- /code/ch01/images/01_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch01/images/01_03.png -------------------------------------------------------------------------------- /code/ch01/images/01_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch01/images/01_04.png -------------------------------------------------------------------------------- /code/ch01/images/01_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch01/images/01_05.png -------------------------------------------------------------------------------- /code/ch01/images/01_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch01/images/01_06.png -------------------------------------------------------------------------------- /code/ch01/images/01_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch01/images/01_07.png -------------------------------------------------------------------------------- /code/ch01/images/01_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch01/images/01_08.png -------------------------------------------------------------------------------- /code/ch01/images/01_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch01/images/01_09.png -------------------------------------------------------------------------------- /code/ch01/images/ipynb_ex1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch01/images/ipynb_ex1.png -------------------------------------------------------------------------------- /code/ch01/images/ipynb_ex2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch01/images/ipynb_ex2.png -------------------------------------------------------------------------------- /code/ch01/tests/test_notebooks.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import os 3 | import subprocess 4 | import tempfile 5 | import watermark 6 | import nbformat 7 | 8 | 9 | def run_ipynb(path): 10 | error_cells = [] 11 | with tempfile.NamedTemporaryFile(suffix=".ipynb") as fout: 12 | args = ["python", "-m", "nbconvert", "--to", 13 | "notebook", "--execute", "--output", 14 | "--ExecutePreprocessor.kernel_name", "python" 15 | fout.name, path] 16 | subprocess.check_output(args) 17 | 18 | 19 | class TestNotebooks(unittest.TestCase): 20 | 21 | def test_appendix_g_tensorflow_basics(self): 22 | this_dir = os.path.dirname(os.path.abspath(__file__)) 23 | run_ipynb(os.path.join(this_dir, 24 | '../appendix_g_tensorflow-basics.ipynb')) 25 | 26 | 27 | if __name__ == '__main__': 28 | unittest.main() 29 | -------------------------------------------------------------------------------- /code/ch02/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | Python Machine Learning - Code Examples 4 | 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/ch02/images/02_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_01.png -------------------------------------------------------------------------------- /code/ch02/images/02_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_02.png -------------------------------------------------------------------------------- /code/ch02/images/02_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_03.png -------------------------------------------------------------------------------- /code/ch02/images/02_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_04.png -------------------------------------------------------------------------------- /code/ch02/images/02_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_05.png -------------------------------------------------------------------------------- /code/ch02/images/02_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_06.png -------------------------------------------------------------------------------- /code/ch02/images/02_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_07.png -------------------------------------------------------------------------------- /code/ch02/images/02_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_08.png -------------------------------------------------------------------------------- /code/ch02/images/02_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_09.png -------------------------------------------------------------------------------- /code/ch02/images/02_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_10.png -------------------------------------------------------------------------------- /code/ch02/images/02_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_11.png -------------------------------------------------------------------------------- /code/ch02/images/02_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_12.png -------------------------------------------------------------------------------- /code/ch02/images/02_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_13.png -------------------------------------------------------------------------------- /code/ch02/images/02_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch02/images/02_14.png -------------------------------------------------------------------------------- /code/ch03/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | Python Machine Learning - Code Examples 4 | 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/ch03/images/03_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_01.png -------------------------------------------------------------------------------- /code/ch03/images/03_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_02.png -------------------------------------------------------------------------------- /code/ch03/images/03_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_03.png -------------------------------------------------------------------------------- /code/ch03/images/03_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_04.png -------------------------------------------------------------------------------- /code/ch03/images/03_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_05.png -------------------------------------------------------------------------------- /code/ch03/images/03_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_06.png -------------------------------------------------------------------------------- /code/ch03/images/03_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_07.png -------------------------------------------------------------------------------- /code/ch03/images/03_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_08.png -------------------------------------------------------------------------------- /code/ch03/images/03_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_09.png -------------------------------------------------------------------------------- /code/ch03/images/03_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_10.png -------------------------------------------------------------------------------- /code/ch03/images/03_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_11.png -------------------------------------------------------------------------------- /code/ch03/images/03_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_12.png -------------------------------------------------------------------------------- /code/ch03/images/03_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_13.png -------------------------------------------------------------------------------- /code/ch03/images/03_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_14.png -------------------------------------------------------------------------------- /code/ch03/images/03_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_15.png -------------------------------------------------------------------------------- /code/ch03/images/03_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_16.png -------------------------------------------------------------------------------- /code/ch03/images/03_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_17.png -------------------------------------------------------------------------------- /code/ch03/images/03_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_18.png -------------------------------------------------------------------------------- /code/ch03/images/03_19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_19.png -------------------------------------------------------------------------------- /code/ch03/images/03_20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_20.png -------------------------------------------------------------------------------- /code/ch03/images/03_21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_21.png -------------------------------------------------------------------------------- /code/ch03/images/03_22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_22.png -------------------------------------------------------------------------------- /code/ch03/images/03_23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch03/images/03_23.png -------------------------------------------------------------------------------- /code/ch03/tree.dot: -------------------------------------------------------------------------------- 1 | digraph Tree { 2 | node [shape=box] ; 3 | 0 [label="petal width <= 0.75\nentropy = 1.5799\nsamples = 105\nvalue = [34, 32, 39]"] ; 4 | 1 [label="entropy = 0.0\nsamples = 34\nvalue = [34, 0, 0]"] ; 5 | 0 -> 1 [labeldistance=2.5, labelangle=45, headlabel="True"] ; 6 | 2 [label="petal length <= 4.95\nentropy = 0.993\nsamples = 71\nvalue = [0, 32, 39]"] ; 7 | 0 -> 2 [labeldistance=2.5, labelangle=-45, headlabel="False"] ; 8 | 3 [label="petal width <= 1.65\nentropy = 0.4306\nsamples = 34\nvalue = [0, 31, 3]"] ; 9 | 2 -> 3 ; 10 | 4 [label="entropy = 0.0\nsamples = 30\nvalue = [0, 30, 0]"] ; 11 | 3 -> 4 ; 12 | 5 [label="entropy = 0.8113\nsamples = 4\nvalue = [0, 1, 3]"] ; 13 | 3 -> 5 ; 14 | 6 [label="petal length <= 5.05\nentropy = 0.1793\nsamples = 37\nvalue = [0, 1, 36]"] ; 15 | 2 -> 6 ; 16 | 7 [label="entropy = 0.8113\nsamples = 4\nvalue = [0, 1, 3]"] ; 17 | 6 -> 7 ; 18 | 8 [label="entropy = 0.0\nsamples = 33\nvalue = [0, 0, 33]"] ; 19 | 6 -> 8 ; 20 | } -------------------------------------------------------------------------------- /code/ch04/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | Python Machine Learning - Code Examples 4 | 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/ch04/images/04_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_01.png -------------------------------------------------------------------------------- /code/ch04/images/04_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_02.png -------------------------------------------------------------------------------- /code/ch04/images/04_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_03.png -------------------------------------------------------------------------------- /code/ch04/images/04_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_04.png -------------------------------------------------------------------------------- /code/ch04/images/04_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_05.png -------------------------------------------------------------------------------- /code/ch04/images/04_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_06.png -------------------------------------------------------------------------------- /code/ch04/images/04_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_07.png -------------------------------------------------------------------------------- /code/ch04/images/04_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_08.png -------------------------------------------------------------------------------- /code/ch04/images/04_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_09.png -------------------------------------------------------------------------------- /code/ch04/images/04_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_10.png -------------------------------------------------------------------------------- /code/ch04/images/04_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_11.png -------------------------------------------------------------------------------- /code/ch04/images/04_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_12.png -------------------------------------------------------------------------------- /code/ch04/images/04_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_13.png -------------------------------------------------------------------------------- /code/ch04/images/04_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_14.png -------------------------------------------------------------------------------- /code/ch04/images/04_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_15.png -------------------------------------------------------------------------------- /code/ch04/images/04_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch04/images/04_16.png -------------------------------------------------------------------------------- /code/ch05/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | Python Machine Learning - Code Examples 4 | 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/ch05/images/05_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_01.png -------------------------------------------------------------------------------- /code/ch05/images/05_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_02.png -------------------------------------------------------------------------------- /code/ch05/images/05_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_03.png -------------------------------------------------------------------------------- /code/ch05/images/05_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_04.png -------------------------------------------------------------------------------- /code/ch05/images/05_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_05.png -------------------------------------------------------------------------------- /code/ch05/images/05_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_06.png -------------------------------------------------------------------------------- /code/ch05/images/05_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_07.png -------------------------------------------------------------------------------- /code/ch05/images/05_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_08.png -------------------------------------------------------------------------------- /code/ch05/images/05_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_09.png -------------------------------------------------------------------------------- /code/ch05/images/05_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_10.png -------------------------------------------------------------------------------- /code/ch05/images/05_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_11.png -------------------------------------------------------------------------------- /code/ch05/images/05_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_12.png -------------------------------------------------------------------------------- /code/ch05/images/05_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_13.png -------------------------------------------------------------------------------- /code/ch05/images/05_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_14.png -------------------------------------------------------------------------------- /code/ch05/images/05_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_15.png -------------------------------------------------------------------------------- /code/ch05/images/05_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_16.png -------------------------------------------------------------------------------- /code/ch05/images/05_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_17.png -------------------------------------------------------------------------------- /code/ch05/images/05_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_18.png -------------------------------------------------------------------------------- /code/ch05/images/05_19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch05/images/05_19.png -------------------------------------------------------------------------------- /code/ch06/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | Python Machine Learning - Code Examples 4 | 5 | ## Chapter 6 - Learning Best Practices for Model Evaluation and Hyperparameter Tuning 6 | 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 25 | 26 | -------------------------------------------------------------------------------- /code/ch06/images/06_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch06/images/06_01.png -------------------------------------------------------------------------------- /code/ch06/images/06_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch06/images/06_02.png -------------------------------------------------------------------------------- /code/ch06/images/06_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch06/images/06_03.png -------------------------------------------------------------------------------- /code/ch06/images/06_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch06/images/06_04.png -------------------------------------------------------------------------------- /code/ch06/images/06_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch06/images/06_05.png -------------------------------------------------------------------------------- /code/ch06/images/06_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch06/images/06_06.png -------------------------------------------------------------------------------- /code/ch06/images/06_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch06/images/06_07.png -------------------------------------------------------------------------------- /code/ch06/images/06_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch06/images/06_08.png -------------------------------------------------------------------------------- /code/ch06/images/06_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch06/images/06_09.png -------------------------------------------------------------------------------- /code/ch06/images/06_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch06/images/06_10.png -------------------------------------------------------------------------------- /code/ch07/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | Python Machine Learning - Code Examples 4 | 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/ch07/images/07_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch07/images/07_01.png -------------------------------------------------------------------------------- /code/ch07/images/07_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch07/images/07_02.png -------------------------------------------------------------------------------- /code/ch07/images/07_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch07/images/07_03.png -------------------------------------------------------------------------------- /code/ch07/images/07_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch07/images/07_04.png -------------------------------------------------------------------------------- /code/ch07/images/07_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch07/images/07_05.png -------------------------------------------------------------------------------- /code/ch07/images/07_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch07/images/07_06.png -------------------------------------------------------------------------------- /code/ch07/images/07_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch07/images/07_07.png -------------------------------------------------------------------------------- /code/ch07/images/07_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch07/images/07_08.png -------------------------------------------------------------------------------- /code/ch07/images/07_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch07/images/07_09.png -------------------------------------------------------------------------------- /code/ch07/images/07_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch07/images/07_10.png -------------------------------------------------------------------------------- /code/ch07/images/07_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch07/images/07_11.png -------------------------------------------------------------------------------- /code/ch08/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | Python Machine Learning - Code Examples 4 | 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/ch08/images/08_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch08/images/08_01.png -------------------------------------------------------------------------------- /code/ch09/1st_flask_app_1/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__) 4 | 5 | @app.route('/') 6 | def index(): 7 | return render_template('first_app.html') 8 | 9 | if __name__ == '__main__': 10 | app.run(debug=True) -------------------------------------------------------------------------------- /code/ch09/1st_flask_app_1/templates/first_app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | First app 5 | 6 | 7 | 8 |
9 | Hi, this is my first Flask web app! 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /code/ch09/1st_flask_app_2/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template, request 2 | from wtforms import Form, TextAreaField, validators 3 | 4 | app = Flask(__name__) 5 | 6 | class HelloForm(Form): 7 | sayhello = TextAreaField('',[validators.DataRequired()]) 8 | 9 | @app.route('/') 10 | def index(): 11 | form = HelloForm(request.form) 12 | return render_template('first_app.html', form=form) 13 | 14 | @app.route('/hello', methods=['POST']) 15 | def hello(): 16 | form = HelloForm(request.form) 17 | if request.method == 'POST' and form.validate(): 18 | name = request.form['sayhello'] 19 | return render_template('hello.html', name=name) 20 | return render_template('first_app.html', form=form) 21 | 22 | if __name__ == '__main__': 23 | app.run(debug=True) -------------------------------------------------------------------------------- /code/ch09/1st_flask_app_2/static/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: 2em; 3 | } -------------------------------------------------------------------------------- /code/ch09/1st_flask_app_2/templates/_formhelpers.html: -------------------------------------------------------------------------------- 1 | {% macro render_field(field) %} 2 |
{{ field.label }} 3 |
{{ field(**kwargs)|safe }} 4 | {% if field.errors %} 5 | 10 | {% endif %} 11 |
12 | 13 | {% endmacro %} 14 | -------------------------------------------------------------------------------- /code/ch09/1st_flask_app_2/templates/first_app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | First app 5 | 6 | 7 | 8 | 9 | {% from "_formhelpers.html" import render_field %} 10 | 11 |
What's your name?
12 |
13 | 14 |
15 | {{ render_field(form.sayhello) }} 16 |
17 | 18 | 19 | 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /code/ch09/1st_flask_app_2/templates/hello.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | First app 5 | 6 | 7 | 8 | 9 |
Hello {{ name }}
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /code/ch09/images/09_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/images/09_01.png -------------------------------------------------------------------------------- /code/ch09/images/09_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/images/09_02.png -------------------------------------------------------------------------------- /code/ch09/images/09_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/images/09_03.png -------------------------------------------------------------------------------- /code/ch09/images/09_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/images/09_04.png -------------------------------------------------------------------------------- /code/ch09/images/09_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/images/09_05.png -------------------------------------------------------------------------------- /code/ch09/images/09_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/images/09_06.png -------------------------------------------------------------------------------- /code/ch09/images/09_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/images/09_07.png -------------------------------------------------------------------------------- /code/ch09/images/09_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/images/09_08.png -------------------------------------------------------------------------------- /code/ch09/movieclassifier/pkl_objects/classifier.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/movieclassifier/pkl_objects/classifier.pkl -------------------------------------------------------------------------------- /code/ch09/movieclassifier/pkl_objects/stopwords.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/movieclassifier/pkl_objects/stopwords.pkl -------------------------------------------------------------------------------- /code/ch09/movieclassifier/reviews.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/movieclassifier/reviews.sqlite -------------------------------------------------------------------------------- /code/ch09/movieclassifier/static/style.css: -------------------------------------------------------------------------------- 1 | body{ 2 | width:600px; 3 | } 4 | 5 | .button{ 6 | padding-top: 20px; 7 | } 8 | -------------------------------------------------------------------------------- /code/ch09/movieclassifier/templates/_formhelpers.html: -------------------------------------------------------------------------------- 1 | {% macro render_field(field) %} 2 |
{{ field.label }} 3 |
{{ field(**kwargs)|safe }} 4 | {% if field.errors %} 5 | 10 | {% endif %} 11 |
12 | {% endmacro %} -------------------------------------------------------------------------------- /code/ch09/movieclassifier/templates/results.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Movie Classification 5 | 6 | 7 | 8 | 9 |

Your movie review:

10 |
{{ content }}
11 | 12 |

Prediction:

13 |
This movie review is {{ prediction }} 14 | (probability: {{ probability }}%).
15 | 16 |
17 |
18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 |
26 |
27 | 28 |
29 |
30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /code/ch09/movieclassifier/templates/reviewform.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Movie Classification 5 | 6 | 7 | 8 | 9 |

Please enter your movie review:

10 | 11 | {% from "_formhelpers.html" import render_field %} 12 | 13 |
14 |
15 | {{ render_field(form.moviereview, cols='30', rows='10') }} 16 |
17 |
18 | 19 |
20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /code/ch09/movieclassifier/templates/thanks.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Movie Classification 5 | 6 | 7 | 8 | 9 |

Thank you for your feedback!

10 | 11 |
12 |
13 | 14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /code/ch09/movieclassifier/vectorizer.py: -------------------------------------------------------------------------------- 1 | from sklearn.feature_extraction.text import HashingVectorizer 2 | import re 3 | import os 4 | import pickle 5 | 6 | cur_dir = os.path.dirname(__file__) 7 | stop = pickle.load(open( 8 | os.path.join(cur_dir, 9 | 'pkl_objects', 10 | 'stopwords.pkl'), 'rb')) 11 | 12 | def tokenizer(text): 13 | text = re.sub('<[^>]*>', '', text) 14 | emoticons = re.findall('(?::|;|=)(?:-)?(?:\)|\(|D|P)', 15 | text.lower()) 16 | text = re.sub('[\W]+', ' ', text.lower()) \ 17 | + ' '.join(emoticons).replace('-', '') 18 | tokenized = [w for w in text.split() if w not in stop] 19 | return tokenized 20 | 21 | vect = HashingVectorizer(decode_error='ignore', 22 | n_features=2**21, 23 | preprocessor=None, 24 | tokenizer=tokenizer) -------------------------------------------------------------------------------- /code/ch09/movieclassifier_with_update/pkl_objects/classifier.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/movieclassifier_with_update/pkl_objects/classifier.pkl -------------------------------------------------------------------------------- /code/ch09/movieclassifier_with_update/pkl_objects/stopwords.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/movieclassifier_with_update/pkl_objects/stopwords.pkl -------------------------------------------------------------------------------- /code/ch09/movieclassifier_with_update/reviews.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch09/movieclassifier_with_update/reviews.sqlite -------------------------------------------------------------------------------- /code/ch09/movieclassifier_with_update/static/style.css: -------------------------------------------------------------------------------- 1 | body{ 2 | width:600px; 3 | } 4 | 5 | .button{ 6 | padding-top: 20px; 7 | } 8 | -------------------------------------------------------------------------------- /code/ch09/movieclassifier_with_update/templates/_formhelpers.html: -------------------------------------------------------------------------------- 1 | {% macro render_field(field) %} 2 |
{{ field.label }} 3 |
{{ field(**kwargs)|safe }} 4 | {% if field.errors %} 5 | 10 | {% endif %} 11 |
12 | {% endmacro %} -------------------------------------------------------------------------------- /code/ch09/movieclassifier_with_update/templates/results.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Movie Classification 5 | 6 | 7 | 8 | 9 |

Your movie review:

10 |
{{ content }}
11 | 12 |

Prediction:

13 |
This movie review is {{ prediction }} 14 | (probability: {{ probability }}%).
15 | 16 |
17 |
18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 |
26 |
27 | 28 |
29 |
30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /code/ch09/movieclassifier_with_update/templates/reviewform.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Movie Classification 5 | 6 | 7 | 8 | 9 |

Please enter your movie review:

10 | 11 | {% from "_formhelpers.html" import render_field %} 12 | 13 |
14 |
15 | {{ render_field(form.moviereview, cols='30', rows='10') }} 16 |
17 |
18 | 19 |
20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /code/ch09/movieclassifier_with_update/templates/thanks.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Movie Classification 5 | 6 | 7 | 8 | 9 |

Thank you for your feedback!

10 | 11 |
12 |
13 | 14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /code/ch09/movieclassifier_with_update/update.py: -------------------------------------------------------------------------------- 1 | import pickle 2 | import sqlite3 3 | import numpy as np 4 | import os 5 | 6 | # import HashingVectorizer from local dir 7 | from vectorizer import vect 8 | 9 | def update_model(db_path, model, batch_size=10000): 10 | 11 | conn = sqlite3.connect(db_path) 12 | c = conn.cursor() 13 | c.execute('SELECT * from review_db') 14 | 15 | results = c.fetchmany(batch_size) 16 | while results: 17 | data = np.array(results) 18 | X = data[:, 0] 19 | y = data[:, 1].astype(int) 20 | 21 | classes = np.array([0, 1]) 22 | X_train = vect.transform(X) 23 | model.partial_fit(X_train, y, classes=classes) 24 | results = c.fetchmany(batch_size) 25 | 26 | conn.close() 27 | return model 28 | 29 | cur_dir = os.path.dirname(__file__) 30 | 31 | clf = pickle.load(open(os.path.join(cur_dir, 32 | 'pkl_objects', 33 | 'classifier.pkl'), 'rb')) 34 | db = os.path.join(cur_dir, 'reviews.sqlite') 35 | 36 | clf = update_model(db_path=db, model=clf, batch_size=10000) 37 | 38 | # Uncomment the following lines if you are sure that 39 | # you want to update your classifier.pkl file 40 | # permanently. 41 | 42 | # pickle.dump(clf, open(os.path.join(cur_dir, 43 | # 'pkl_objects', 'classifier.pkl'), 'wb') 44 | # , protocol=4) 45 | -------------------------------------------------------------------------------- /code/ch09/movieclassifier_with_update/vectorizer.py: -------------------------------------------------------------------------------- 1 | from sklearn.feature_extraction.text import HashingVectorizer 2 | import re 3 | import os 4 | import pickle 5 | 6 | cur_dir = os.path.dirname(__file__) 7 | stop = pickle.load(open( 8 | os.path.join(cur_dir, 9 | 'pkl_objects', 10 | 'stopwords.pkl'), 'rb')) 11 | 12 | def tokenizer(text): 13 | text = re.sub('<[^>]*>', '', text) 14 | emoticons = re.findall('(?::|;|=)(?:-)?(?:\)|\(|D|P)', 15 | text.lower()) 16 | text = re.sub('[\W]+', ' ', text.lower()) \ 17 | + ' '.join(emoticons).replace('-', '') 18 | tokenized = [w for w in text.split() if w not in stop] 19 | return tokenized 20 | 21 | vect = HashingVectorizer(decode_error='ignore', 22 | n_features=2**21, 23 | preprocessor=None, 24 | tokenizer=tokenizer) 25 | -------------------------------------------------------------------------------- /code/ch09/pickle-test-scripts/README.md: -------------------------------------------------------------------------------- 1 | **Note** 2 | 3 | The pickling-section may be a bit tricky so that I included simpler test scripts in this directory (pickle-test-scripts/) to check if your environment is set up correctly. Basically, it is just a trimmed-down version of the relevant sections from Ch08, including a very small movie_review_data subset. 4 | 5 | Executing 6 | 7 | python pickle-dump-test.py 8 | 9 | will train a small classification model from the `movie_data_small.csv` and create the 2 pickle files 10 | 11 | stopwords.pkl 12 | classifier.pkl 13 | 14 | Next, if you execute 15 | 16 | python pickle-load-test.py 17 | 18 | You should see the following 2 lines as output: 19 | 20 | Prediction: positive 21 | Probability: 85.71% -------------------------------------------------------------------------------- /code/ch09/pickle-test-scripts/pickle-load-test.py: -------------------------------------------------------------------------------- 1 | import pickle 2 | import re 3 | import os 4 | from vectorizer import vect 5 | import numpy as np 6 | 7 | clf = pickle.load(open('classifier.pkl', 'rb')) 8 | 9 | 10 | label = {0: 'negative', 1: 'positive'} 11 | example = ['I love this movie'] 12 | 13 | X = vect.transform(example) 14 | 15 | print('Prediction: %s\nProbability: %.2f%%' % 16 | (label[clf.predict(X)[0]], 17 | np.max(clf.predict_proba(X)) * 100)) 18 | -------------------------------------------------------------------------------- /code/ch09/pickle-test-scripts/vectorizer.py: -------------------------------------------------------------------------------- 1 | from sklearn.feature_extraction.text import HashingVectorizer 2 | import re 3 | import os 4 | import pickle 5 | 6 | 7 | stop = pickle.load(open('stopwords.pkl', 'rb')) 8 | 9 | 10 | def tokenizer(text): 11 | text = re.sub('<[^>]*>', '', text) 12 | emoticons = re.findall('(?::|;|=)(?:-)?(?:\)|\(|D|P)', 13 | text.lower()) 14 | text = re.sub('[\W]+', ' ', text.lower()) + \ 15 | ' '.join(emoticons).replace('-', '') 16 | tokenized = [w for w in text.split() if w not in stop] 17 | return tokenized 18 | 19 | vect = HashingVectorizer(decode_error='ignore', 20 | n_features=2**21, 21 | preprocessor=None, 22 | tokenizer=tokenizer) 23 | -------------------------------------------------------------------------------- /code/ch10/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | Python Machine Learning - Code Examples 4 | 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/ch10/images/10_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_01.png -------------------------------------------------------------------------------- /code/ch10/images/10_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_02.png -------------------------------------------------------------------------------- /code/ch10/images/10_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_03.png -------------------------------------------------------------------------------- /code/ch10/images/10_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_04.png -------------------------------------------------------------------------------- /code/ch10/images/10_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_05.png -------------------------------------------------------------------------------- /code/ch10/images/10_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_06.png -------------------------------------------------------------------------------- /code/ch10/images/10_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_07.png -------------------------------------------------------------------------------- /code/ch10/images/10_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_08.png -------------------------------------------------------------------------------- /code/ch10/images/10_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_09.png -------------------------------------------------------------------------------- /code/ch10/images/10_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_10.png -------------------------------------------------------------------------------- /code/ch10/images/10_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_11.png -------------------------------------------------------------------------------- /code/ch10/images/10_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_12.png -------------------------------------------------------------------------------- /code/ch10/images/10_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_13.png -------------------------------------------------------------------------------- /code/ch10/images/10_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch10/images/10_14.png -------------------------------------------------------------------------------- /code/ch11/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | Python Machine Learning - Code Examples 4 | 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/ch11/images/11_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_01.png -------------------------------------------------------------------------------- /code/ch11/images/11_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_02.png -------------------------------------------------------------------------------- /code/ch11/images/11_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_03.png -------------------------------------------------------------------------------- /code/ch11/images/11_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_04.png -------------------------------------------------------------------------------- /code/ch11/images/11_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_05.png -------------------------------------------------------------------------------- /code/ch11/images/11_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_06.png -------------------------------------------------------------------------------- /code/ch11/images/11_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_07.png -------------------------------------------------------------------------------- /code/ch11/images/11_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_08.png -------------------------------------------------------------------------------- /code/ch11/images/11_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_09.png -------------------------------------------------------------------------------- /code/ch11/images/11_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_10.png -------------------------------------------------------------------------------- /code/ch11/images/11_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_11.png -------------------------------------------------------------------------------- /code/ch11/images/11_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_12.png -------------------------------------------------------------------------------- /code/ch11/images/11_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_13.png -------------------------------------------------------------------------------- /code/ch11/images/11_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_14.png -------------------------------------------------------------------------------- /code/ch11/images/11_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_15.png -------------------------------------------------------------------------------- /code/ch11/images/11_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch11/images/11_16.png -------------------------------------------------------------------------------- /code/ch12/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | Python Machine Learning - Code Examples 4 | 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/ch12/images/12_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_01.png -------------------------------------------------------------------------------- /code/ch12/images/12_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_02.png -------------------------------------------------------------------------------- /code/ch12/images/12_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_03.png -------------------------------------------------------------------------------- /code/ch12/images/12_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_04.png -------------------------------------------------------------------------------- /code/ch12/images/12_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_05.png -------------------------------------------------------------------------------- /code/ch12/images/12_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_06.png -------------------------------------------------------------------------------- /code/ch12/images/12_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_07.png -------------------------------------------------------------------------------- /code/ch12/images/12_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_08.png -------------------------------------------------------------------------------- /code/ch12/images/12_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_09.png -------------------------------------------------------------------------------- /code/ch12/images/12_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_10.png -------------------------------------------------------------------------------- /code/ch12/images/12_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_11.png -------------------------------------------------------------------------------- /code/ch12/images/12_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_12.png -------------------------------------------------------------------------------- /code/ch12/images/12_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_13.png -------------------------------------------------------------------------------- /code/ch12/images/12_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_14.png -------------------------------------------------------------------------------- /code/ch12/images/12_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_15.png -------------------------------------------------------------------------------- /code/ch12/images/12_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_16.png -------------------------------------------------------------------------------- /code/ch12/images/12_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch12/images/12_17.png -------------------------------------------------------------------------------- /code/ch13/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | Python Machine Learning - Code Examples 4 | 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 -------------------------------------------------------------------------------- /code/ch13/images/13_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch13/images/13_01.png -------------------------------------------------------------------------------- /code/ch13/images/13_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch13/images/13_02.png -------------------------------------------------------------------------------- /code/ch13/images/13_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch13/images/13_03.png -------------------------------------------------------------------------------- /code/ch13/images/13_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch13/images/13_04.png -------------------------------------------------------------------------------- /code/ch13/images/13_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch13/images/13_05.png -------------------------------------------------------------------------------- /code/ch13/images/bonus_softmax_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/ch13/images/bonus_softmax_1.png -------------------------------------------------------------------------------- /code/datasets/iris/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | # Python Machine Learning - Supplementary Datasets 4 | 5 | ## Iris Flower Dataset 6 | 7 | - Used in chapters 1, 2, and 3 8 | 9 | The Iris dataset for classification. 10 | 11 | **Features** 12 | 13 | 1. Sepal length 14 | 2. Sepal width 15 | 3. Petal length 16 | 4. Petal width 17 | 18 | - Number of samples: 150 19 | 20 | - Target variable (discrete): {50x Setosa, 50x Versicolor, 50x Virginica} 21 | 22 | ### References 23 | 24 | - Source: [https://archive.ics.uci.edu/ml/datasets/Iris](https://archive.ics.uci.edu/ml/datasets/Iris) 25 | - Bache, K. & Lichman, M. (2013). UCI Machine Learning Repository. Irvine, CA: University of California, School of Information and Computer Science. 26 | -------------------------------------------------------------------------------- /code/datasets/mnist/t10k-images-idx3-ubyte.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/datasets/mnist/t10k-images-idx3-ubyte.gz -------------------------------------------------------------------------------- /code/datasets/mnist/t10k-labels-idx1-ubyte.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/datasets/mnist/t10k-labels-idx1-ubyte.gz -------------------------------------------------------------------------------- /code/datasets/mnist/train-images-idx3-ubyte.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/datasets/mnist/train-images-idx3-ubyte.gz -------------------------------------------------------------------------------- /code/datasets/mnist/train-labels-idx1-ubyte.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/datasets/mnist/train-labels-idx1-ubyte.gz -------------------------------------------------------------------------------- /code/datasets/movie/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | # Python Machine Learning - Supplementary Datasets 4 | 5 | ## The Large Movie Review Dataset 6 | 7 | - Used in chapters 8 and 9 8 | 9 | The movie dataset converted into a 2-column CSV format: The first column (`review`) contains the text, and the second column (`sentiment`) denotes the polarity, where 0=negative and 1=positive. The first 25,000 are the training samples and the remaining 25,000 rows are the test samples from the "Large Movie Review Dataset v1.0," respectively. 10 | 11 | - Source: [http://ai.stanford.edu/~amaas/data/sentiment/](http://ai.stanford.edu/~amaas/data/sentiment/) 12 | -------------------------------------------------------------------------------- /code/datasets/movie/movie_data.csv.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/code/datasets/movie/movie_data.csv.zip -------------------------------------------------------------------------------- /code/datasets/wdbc/README.md: -------------------------------------------------------------------------------- 1 | Sebastian Raschka, 2015 2 | 3 | # Python Machine Learning - Supplementary Datasets 4 | 5 | ## Breast Cancer Wisconsin (Diagnostic) Data Set 6 | 7 | - Used in chapter 6 8 | - Source: https://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wisconsin+(Diagnostic) 9 | -------------------------------------------------------------------------------- /code/optional-py-scripts/ch09.py: -------------------------------------------------------------------------------- 1 | # Sebastian Raschka, 2015 (http://sebastianraschka.com) 2 | # Python Machine Learning - Code Examples 3 | # 4 | # Chapter 9 - Embedding a Machine Learning Model into a Web Application 5 | # 6 | # S. Raschka. Python Machine Learning. Packt Publishing Ltd., 2015. 7 | # GitHub Repo: https://github.com/rasbt/python-machine-learning-book 8 | # 9 | # License: MIT 10 | # https://github.com/rasbt/python-machine-learning-book/blob/master/LICENSE.txt 11 | 12 | 13 | s = """ 14 | 15 | Due to the complexity of this chapter, and the many files involved, 16 | please refer to the IPython Notebook at 17 | https://github.com/rasbt/python-machine-learning-book/blob/master/code/ch09/ch09.ipynb 18 | 19 | The web application files can be obtained from 20 | https://github.com/rasbt/python-machine-learning-book/tree/master/code/ch09 21 | 22 | """ 23 | print(s) 24 | -------------------------------------------------------------------------------- /docs/2016-03-03-unicef.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/2016-03-03-unicef.pdf -------------------------------------------------------------------------------- /docs/2016-04-07-unicef.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/2016-04-07-unicef.pdf -------------------------------------------------------------------------------- /docs/2016-11-10-commoncause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/2016-11-10-commoncause.png -------------------------------------------------------------------------------- /docs/equations/pymle-equations.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/equations/pymle-equations.pdf -------------------------------------------------------------------------------- /docs/foreword_ro.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/foreword_ro.pdf -------------------------------------------------------------------------------- /docs/images/armand_g_tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/images/armand_g_tweet.png -------------------------------------------------------------------------------- /docs/images/boris_tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/images/boris_tweet.png -------------------------------------------------------------------------------- /docs/images/claus_tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/images/claus_tweet.png -------------------------------------------------------------------------------- /docs/images/dataelixir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/images/dataelixir.png -------------------------------------------------------------------------------- /docs/images/errata/errata_2015-10-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/images/errata/errata_2015-10-20.png -------------------------------------------------------------------------------- /docs/images/errata/errata_2016-04-22.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/images/errata/errata_2016-04-22.jpg -------------------------------------------------------------------------------- /docs/images/jason_tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/images/jason_tweet.png -------------------------------------------------------------------------------- /docs/images/jonathon_m_tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/images/jonathon_m_tweet.png -------------------------------------------------------------------------------- /docs/images/josiah_tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/images/josiah_tweet.png -------------------------------------------------------------------------------- /docs/images/matteo_tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/images/matteo_tweet.png -------------------------------------------------------------------------------- /docs/images/matthew_m_tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/images/matthew_m_tweet.png -------------------------------------------------------------------------------- /docs/images/penghui_tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/images/penghui_tweet.png -------------------------------------------------------------------------------- /docs/images/yong_cho_tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/images/yong_cho_tweet.png -------------------------------------------------------------------------------- /docs/preface_sr.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/preface_sr.pdf -------------------------------------------------------------------------------- /docs/running_jupyter_nb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/docs/running_jupyter_nb.pdf -------------------------------------------------------------------------------- /faq/ai-and-ml/ai-and-ml-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ai-and-ml/ai-and-ml-1.png -------------------------------------------------------------------------------- /faq/avoid-overfitting.md: -------------------------------------------------------------------------------- 1 | # How can I avoid overfitting? 2 | 3 | In short, the general strategies are to 4 | 5 | 1. collect more data 6 | 2. use ensembling methods that "average" models 7 | 3. choose simpler models / penalize complexity 8 | 9 | For the first point, it may help to plot learning curves, plotting the training vs. the validation or cross-validation performance. If you see a trend that more data helps with closing the cap between the two, and if you could afford collecting more data, then this would probably the best choice. 10 | 11 | In my experience, ensembling is probably the most convenient way to build robust predictive models on somewhat small-sized datasets. As in real life, consulting a bunch of "experts" is usually not a bad idea before making a decision ;). 12 | 13 | Regarding the third point, I usually start a predictive modeling task with the simplest model as a benchmark: usually logistic regression. Overfitting can be a real problem if our model has too much capacity — too many model parameters to fit, and too many hyperparameters to tune. If the dataset is small, a simple model is always a good option to prevent overfitting, and it is also a good benchmark for comparison to more "complex" alternatives. 14 | -------------------------------------------------------------------------------- /faq/bagging-boosting-rf/bagging-regions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/bagging-boosting-rf/bagging-regions.png -------------------------------------------------------------------------------- /faq/bagging-boosting-rf/bagging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/bagging-boosting-rf/bagging.png -------------------------------------------------------------------------------- /faq/bagging-boosting-rf/boosting-regions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/bagging-boosting-rf/boosting-regions.png -------------------------------------------------------------------------------- /faq/bagging-boosting-rf/boosting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/bagging-boosting-rf/boosting.png -------------------------------------------------------------------------------- /faq/choosing-technique/scikit-cheatsheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/choosing-technique/scikit-cheatsheet.png -------------------------------------------------------------------------------- /faq/classifier-history/activation-functions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/classifier-history/activation-functions.png -------------------------------------------------------------------------------- /faq/classifier-history/adaline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/classifier-history/adaline.png -------------------------------------------------------------------------------- /faq/classifier-history/lda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/classifier-history/lda.png -------------------------------------------------------------------------------- /faq/classifier-history/perceptron-figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/classifier-history/perceptron-figure.png -------------------------------------------------------------------------------- /faq/classifier-history/perceptron-rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/classifier-history/perceptron-rule.png -------------------------------------------------------------------------------- /faq/classifier_categories/master_chart.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/classifier_categories/master_chart.jpg -------------------------------------------------------------------------------- /faq/clf-behavior-data.md: -------------------------------------------------------------------------------- 1 | # What are the best toy datasets to help visualize and understand classifier behavior? 2 | 3 | The visualization part is a bit tricky since we as humans are limited to 1-3 D graphics. However, I'd still say Iris is one of the most useful toy datasets for looking at classifier behavior (see image below). 4 | 5 | ![](./clf-behavior-data/iris.png) 6 | 7 | (I've implemented this simple function here if you are interested: [mlxtend plot_decision_regions](http://rasbt.github.io/mlxtend/user_guide/plotting/plot_decision_regions/).) 8 | Other than that, I think that synthetic datasets like "XOR," "half-moons," or concentric circles would be good candidates for evaluating classifier on non-linear problems: 9 | 10 |
11 | 12 | ![](./clf-behavior-data/xor.png) 13 | 14 |
15 | 16 | ![](./clf-behavior-data/moons.png) 17 | 18 |
19 | 20 | ![](./clf-behavior-data/circles.png) 21 | -------------------------------------------------------------------------------- /faq/clf-behavior-data/circles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/clf-behavior-data/circles.png -------------------------------------------------------------------------------- /faq/clf-behavior-data/iris.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/clf-behavior-data/iris.png -------------------------------------------------------------------------------- /faq/clf-behavior-data/moons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/clf-behavior-data/moons.png -------------------------------------------------------------------------------- /faq/clf-behavior-data/xor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/clf-behavior-data/xor.png -------------------------------------------------------------------------------- /faq/closed-form-vs-gd/adaptive_learning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/closed-form-vs-gd/adaptive_learning.png -------------------------------------------------------------------------------- /faq/closed-form-vs-gd/ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/closed-form-vs-gd/ball.png -------------------------------------------------------------------------------- /faq/closed-form-vs-gd/closed-form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/closed-form-vs-gd/closed-form.png -------------------------------------------------------------------------------- /faq/closed-form-vs-gd/decrease_const.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/closed-form-vs-gd/decrease_const.png -------------------------------------------------------------------------------- /faq/closed-form-vs-gd/dw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/closed-form-vs-gd/dw.png -------------------------------------------------------------------------------- /faq/closed-form-vs-gd/iter_gd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/closed-form-vs-gd/iter_gd.png -------------------------------------------------------------------------------- /faq/closed-form-vs-gd/iter_sgd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/closed-form-vs-gd/iter_sgd.png -------------------------------------------------------------------------------- /faq/closed-form-vs-gd/j.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/closed-form-vs-gd/j.png -------------------------------------------------------------------------------- /faq/closed-form-vs-gd/linear_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/closed-form-vs-gd/linear_model.png -------------------------------------------------------------------------------- /faq/closed-form-vs-gd/simple_regression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/closed-form-vs-gd/simple_regression.png -------------------------------------------------------------------------------- /faq/closed-form-vs-gd/sse_mse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/closed-form-vs-gd/sse_mse.png -------------------------------------------------------------------------------- /faq/closed-form-vs-gd/w_upd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/closed-form-vs-gd/w_upd.png -------------------------------------------------------------------------------- /faq/closed-form-vs-gd/w_upd_expl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/closed-form-vs-gd/w_upd_expl.png -------------------------------------------------------------------------------- /faq/cost-vs-loss.md: -------------------------------------------------------------------------------- 1 | # What is the difference between a cost function and a loss function in machine learning? 2 | 3 | The terms *cost* and *loss* functions are synonymous (some people also call it error function). The more general scenario is to define an objective function first, which we want to optimize. This objective function could be to 4 | 5 | - maximize the posterior probabilities (e.g., naive Bayes) 6 | - maximize a fitness function (genetic programming) 7 | - maximize the total reward/value function (reinforcement learning) 8 | - maximize information gain/minimize child node impurities (CART decision tree classification) 9 | - minimize a mean squared error cost (or loss) function (CART, decision tree regression, linear regression, adaptive linear neurons, ... 10 | - maximize log-likelihood or minimize cross-entropy loss (or cost) function 11 | - minimize hinge loss (support vector machine) 12 | ... 13 | -------------------------------------------------------------------------------- /faq/datamining-overview.md: -------------------------------------------------------------------------------- 1 | # What are the different fields of study in data mining? 2 | 3 | 4 | I would roughly define the different application areas as 5 | 6 | 1) Clustering (unsupervised learning) 7 | e.g., to find groups of customers based on some similarity 8 | 9 | 2) Predictive modeling (supervised learning) 10 | 2.1) Classification 11 | e.g., medical diagnosis (sick/healthy), image classification etc. 12 | 2.2) Regression 13 | e.g., stock trade change prediction 14 | 2.3) Ranking 15 | e.g., search engine results 16 | 17 | 3) Association rule mining 18 | e.g., which products do customers frequently buy together 19 | 20 | 4) Anomaly detection 21 | e.g., credit fraud detection 22 | -------------------------------------------------------------------------------- /faq/datamining-vs-ml.md: -------------------------------------------------------------------------------- 1 | # What are differences in research nature between the two fields: Machine Learning & Data Mining? 2 | 3 | In a nutshell, Data Mining is about the discovery of patterns in datasets or "gaining knowledge and insights" from data. Machine Learning is closely related though. We can think of Machine Learning algorithms as one of the work horses of Data Mining; most Data Mining approaches are based on Machine Learning algorithms. Maybe it helps to think of Data Mining as a pipeline of steps and approaches, and the use of a Machine Learning algorithm is one part of this pipeline. 4 | Or in other words, Data Mining is not "just" Machine Learning. E.g., data visualization or summarization is also part of Data Mining. What I was trying to say is that Machine Learning is one part, one set of techniques, that is/are being used in Data Mining. 5 | -------------------------------------------------------------------------------- /faq/dataprep-vs-dataengin.md: -------------------------------------------------------------------------------- 1 | # Should data preparation/pre-processing step be considered one part of feature engineering? Why or why not? 2 | 3 | I think there's a fuzzy boundary between these two areas of tasks. I see data preparation more as a technical/computational task. E.g., if you think about getting the data into the "right" format, choosing the appropriate data structure / database, and so forth. 4 | Then, there's data cleaning, which can also be grouped into the "preparation / pre-processing" category. Here, you may want to think about detecting duplications, how to deal with outliers, and how to deal with missing data. 5 | 6 | To me, feature engineering is a bit different. I see it more as a "data/feature creation" step rather than a data "sanitizing" step. Feature engineering may include all different sorts of feature transformations in both directions: Higher-dimensional feature spaces (e.g., polynomials), lower dimensional feature spaces (dimensionality reduction like PCA, LDA, etc., hashing, clustering), or you keep the dimensions but change the distribution of your data (e.g., log transformation, standardization, min-max scaling etc.) 7 | -------------------------------------------------------------------------------- /faq/datascience-ml/ml-overview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/datascience-ml/ml-overview.jpg -------------------------------------------------------------------------------- /faq/decision-tree-binary/calc_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decision-tree-binary/calc_1.png -------------------------------------------------------------------------------- /faq/decision-tree-binary/calc_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decision-tree-binary/calc_2.png -------------------------------------------------------------------------------- /faq/decision-tree-binary/calc_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decision-tree-binary/calc_3.png -------------------------------------------------------------------------------- /faq/decision-tree-binary/calc_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decision-tree-binary/calc_5.png -------------------------------------------------------------------------------- /faq/decision-tree-binary/calc_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decision-tree-binary/calc_6.png -------------------------------------------------------------------------------- /faq/decision-tree-binary/empty-classes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decision-tree-binary/empty-classes.png -------------------------------------------------------------------------------- /faq/decision-tree-binary/entropy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decision-tree-binary/entropy.png -------------------------------------------------------------------------------- /faq/decision-tree-binary/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decision-tree-binary/error.png -------------------------------------------------------------------------------- /faq/decision-tree-binary/gini-impurity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decision-tree-binary/gini-impurity.png -------------------------------------------------------------------------------- /faq/decision-tree-binary/information-gain-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decision-tree-binary/information-gain-2.png -------------------------------------------------------------------------------- /faq/decision-tree-binary/information-gain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decision-tree-binary/information-gain.png -------------------------------------------------------------------------------- /faq/decision-tree-binary/overview-plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decision-tree-binary/overview-plot.png -------------------------------------------------------------------------------- /faq/decision-tree-binary/split.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decision-tree-binary/split.png -------------------------------------------------------------------------------- /faq/decisiontree-error-vs-entropy/Slide1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decisiontree-error-vs-entropy/Slide1.png -------------------------------------------------------------------------------- /faq/decisiontree-error-vs-entropy/Slide2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decisiontree-error-vs-entropy/Slide2.png -------------------------------------------------------------------------------- /faq/decisiontree-error-vs-entropy/Slide3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decisiontree-error-vs-entropy/Slide3.png -------------------------------------------------------------------------------- /faq/decisiontree-error-vs-entropy/decisiontree-error-vs-entropy.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decisiontree-error-vs-entropy/decisiontree-error-vs-entropy.pptx -------------------------------------------------------------------------------- /faq/decisiontree-error-vs-entropy/entropy_annotated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decisiontree-error-vs-entropy/entropy_annotated.png -------------------------------------------------------------------------------- /faq/decisiontree-error-vs-entropy/entropy_eq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decisiontree-error-vs-entropy/entropy_eq.png -------------------------------------------------------------------------------- /faq/decisiontree-error-vs-entropy/entropy_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decisiontree-error-vs-entropy/entropy_plot.png -------------------------------------------------------------------------------- /faq/decisiontree-error-vs-entropy/error_eq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decisiontree-error-vs-entropy/error_eq.png -------------------------------------------------------------------------------- /faq/decisiontree-error-vs-entropy/error_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decisiontree-error-vs-entropy/error_plot.png -------------------------------------------------------------------------------- /faq/decisiontree-error-vs-entropy/ig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decisiontree-error-vs-entropy/ig.png -------------------------------------------------------------------------------- /faq/decisiontree-error-vs-entropy/ig_xp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/decisiontree-error-vs-entropy/ig_xp.png -------------------------------------------------------------------------------- /faq/deep-learning-resources.md: -------------------------------------------------------------------------------- 1 | # What are some good books/papers for learning deep learning? 2 | 3 | 4 | A good overview and introduction is the recent deep learning review published in Nature (http://www.nature.com/nature/journal/v521/n7553/full/nature14539.html); it references a lot of useful literature to follow up on 5 | 6 | - LeCun, Yann, Yoshua Bengio, and Geoffrey Hinton. "Deep learning." Nature521.7553 (2015): 436-444. 7 | 8 | 9 | As a good textbook resource, I would like to recommend Yoshua Bengio's upcoming "Deep Learning" book. The book is freely accessible at: http://goodfeli.github.io/dlbook/ 10 | 11 | - Bengio, Yoshua, Ian Goodfellow, and Aaron Courville. "Deep learning." An MIT Press book in preparation. Draft chapters available at http://www. iro. umontreal. ca/∼ bengioy/dlbook (2014). 12 | -------------------------------------------------------------------------------- /faq/diff-perceptron-adaline-neuralnet/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/diff-perceptron-adaline-neuralnet/1.png -------------------------------------------------------------------------------- /faq/diff-perceptron-adaline-neuralnet/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/diff-perceptron-adaline-neuralnet/2.png -------------------------------------------------------------------------------- /faq/diff-perceptron-adaline-neuralnet/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/diff-perceptron-adaline-neuralnet/3.png -------------------------------------------------------------------------------- /faq/diff-perceptron-adaline-neuralnet/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/diff-perceptron-adaline-neuralnet/4.png -------------------------------------------------------------------------------- /faq/diff-perceptron-adaline-neuralnet/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/diff-perceptron-adaline-neuralnet/5.png -------------------------------------------------------------------------------- /faq/diff-perceptron-adaline-neuralnet/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/diff-perceptron-adaline-neuralnet/6.png -------------------------------------------------------------------------------- /faq/diff-perceptron-adaline-neuralnet/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/diff-perceptron-adaline-neuralnet/7.png -------------------------------------------------------------------------------- /faq/diff-perceptron-adaline-neuralnet/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/diff-perceptron-adaline-neuralnet/8.png -------------------------------------------------------------------------------- /faq/difference-deep-and-normal-learning/convnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/difference-deep-and-normal-learning/convnet.png -------------------------------------------------------------------------------- /faq/difference-deep-and-normal-learning/convolution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/difference-deep-and-normal-learning/convolution.png -------------------------------------------------------------------------------- /faq/difference-deep-and-normal-learning/mlp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/difference-deep-and-normal-learning/mlp.png -------------------------------------------------------------------------------- /faq/dimensionality-reduction/lle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/dimensionality-reduction/lle.png -------------------------------------------------------------------------------- /faq/dimensionality-reduction/rbf-kpca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/dimensionality-reduction/rbf-kpca.png -------------------------------------------------------------------------------- /faq/dimensionality-reduction/swiss-roll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/dimensionality-reduction/swiss-roll.png -------------------------------------------------------------------------------- /faq/euclidean-distance.md: -------------------------------------------------------------------------------- 1 | # What is Euclidean distance in terms of machine learning? 2 | 3 | 4 | It is just a distance measure between a pair of samples *p* and *q* in an *n*-dimensional feature space: 5 | 6 | ![](./euclidean-distance/eucl-1.png) 7 | 8 | For example, picture it as a "straight, connecting" line in a 2D feature space: 9 | 10 | ![](./euclidean-distance/eucl-2.png) 11 | 12 | The Euclidean is often the "default" distance used in e.g., K-nearest neighbors (classification) or K-means (clustering) to find the "k closest points" of a particular sample point. Another prominent example is hierarchical clustering, agglomerative clustering (complete and single linkage) where you want to find the distance between clusters. 13 | -------------------------------------------------------------------------------- /faq/euclidean-distance/eucl-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/euclidean-distance/eucl-1.png -------------------------------------------------------------------------------- /faq/euclidean-distance/eucl-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/euclidean-distance/eucl-2.png -------------------------------------------------------------------------------- /faq/evaluate-a-model/evaluate_overview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/evaluate-a-model/evaluate_overview.pdf -------------------------------------------------------------------------------- /faq/evaluate-a-model/evaluate_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/evaluate-a-model/evaluate_overview.png -------------------------------------------------------------------------------- /faq/evaluate-a-model/k-fold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/evaluate-a-model/k-fold.png -------------------------------------------------------------------------------- /faq/evaluate-a-model/nested-k-fold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/evaluate-a-model/nested-k-fold.png -------------------------------------------------------------------------------- /faq/inventing-deeplearning.md: -------------------------------------------------------------------------------- 1 | # Why did it take so long for deep networks to be invented? 2 | 3 | It's not that "deep networks" haven't been around in the 1960s, but the problem was how to train them. In the 1970s, backpropagation was "invented" or re-discovered -- I don't want to quote a single resource here not to offend any of the parties involved since this is a sensitive topic those days ... In any case, the problem was the "vanishing gradient," when gradient-based methods were used for learning the weights. It was observed that there was no gain going beyond 1-3 hidden layers. 4 | 5 | 6 | So back to the question: Deep network structures existed, but it was hard/impossible to train them appropriately. I'd say the 2 main reasons why this field experienced such a leap in the recent years 7 | are 8 | 9 | 10 | 1. availability of computing resources 11 | 2. clever ideas to pre-train a neural network 12 | 13 | 14 | The second point is what deep learning is all about; in a nutshell, we pre-train our deep neural networks using unsupervised learning, but this goes beyond the scope of the question ... 15 | -------------------------------------------------------------------------------- /faq/issues-with-clustering/clusters_kmeans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/issues-with-clustering/clusters_kmeans.png -------------------------------------------------------------------------------- /faq/issues-with-clustering/clusters_unlabeled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/issues-with-clustering/clusters_unlabeled.png -------------------------------------------------------------------------------- /faq/issues-with-clustering/elbow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/issues-with-clustering/elbow.png -------------------------------------------------------------------------------- /faq/issues-with-clustering/silhouette_bad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/issues-with-clustering/silhouette_bad.png -------------------------------------------------------------------------------- /faq/issues-with-clustering/silhouette_good.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/issues-with-clustering/silhouette_good.png -------------------------------------------------------------------------------- /faq/large-num-features/concentric-circles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/large-num-features/concentric-circles.png -------------------------------------------------------------------------------- /faq/large-num-features/kpca-pc1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/large-num-features/kpca-pc1.png -------------------------------------------------------------------------------- /faq/large-num-features/lle1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/large-num-features/lle1.png -------------------------------------------------------------------------------- /faq/large-num-features/lle2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/large-num-features/lle2.png -------------------------------------------------------------------------------- /faq/large-num-features/pca-pc1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/large-num-features/pca-pc1.png -------------------------------------------------------------------------------- /faq/large-num-features/swiss-roll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/large-num-features/swiss-roll.png -------------------------------------------------------------------------------- /faq/lazy-knn.md: -------------------------------------------------------------------------------- 1 | # Why is Nearest Neighbor a Lazy Algorithm? 2 | 3 | Although, Nearest neighbor algorithms, for instance, the K-Nearest Neighbors (K-NN) for classification, are very "simple" algorithms, that's not why they are called *lazy* ;). K-NN is a lazy learner because it doesn't learn a discriminative function from the training data but "memorizes" the training dataset instead. 4 | 5 | For example, the logistic regression algorithm learns its model weights (parameters) during training time. In contrast, there is no training time in K-NN. Although this may sound very convenient, this property doesn't come without a cost: The "prediction" step in K-NN is relatively expensive! Each time we want to make a prediction, K-NN is searching for the nearest neighbor(s) in the entire training set! (Note that there are certain tricks such as BallTrees and KDtrees to speed this up a bit.) 6 | 7 | To summarize: An eager learner has a model fitting or training step. A lazy learner does not have a training phase. 8 | -------------------------------------------------------------------------------- /faq/lda-vs-pca.md: -------------------------------------------------------------------------------- 1 | # What is the difference between LDA and PCA for dimensionality reduction? 2 | 3 | Both LDA and PCA are linear transformation techniques: LDA is a supervised whereas PCA is unsupervised -- PCA ignores class labels. 4 | 5 | We can picture PCA as a technique that finds the directions of maximal variance: 6 | 7 | ![](./lda-vs-pca/pca.png) 8 | 9 | In contrast to PCA, LDA attempts to find a feature subspace that maximizes class separability (note that LD 2 would be a very bad linear discriminant in the figure above). 10 | 11 | ![](./lda-vs-pca/lda.png) 12 | 13 | 14 | Remember that LDA makes assumptions about normally distributed classes and equal class covariances. 15 | If you are interested in an empirical comparison: A. M. Martinez and A. C. Kak. PCA versus LDA. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 23(2):228–233, 2001). (PCA tends to result in better classification results in an image recognition task if the number of samples for a given class was relatively small.) 16 | -------------------------------------------------------------------------------- /faq/lda-vs-pca/lda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/lda-vs-pca/lda.png -------------------------------------------------------------------------------- /faq/lda-vs-pca/pca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/lda-vs-pca/pca.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/1.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/10.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/11.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/12.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/13.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/14.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/15.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/16.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/17.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/18.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/19.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/2.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/20.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/21.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/22.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/23.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/3.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/4.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/5.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/6.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/7.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/8.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/9.png -------------------------------------------------------------------------------- /faq/linear-gradient-derivative/regression-vs-adaline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/linear-gradient-derivative/regression-vs-adaline.png -------------------------------------------------------------------------------- /faq/logistic-analytical.md: -------------------------------------------------------------------------------- 1 | # Is there an analytical solution to Logistic Regression similar to the Normal Equation for Linear Regression? 2 | 3 | Unfortunately, there is no closed-form solution for maximizing the log-likelihood (or minimizing the inverse, the logistic cost function); at least it has not been found, yet. 4 | 5 | There's the exception where you only have 2 obervations, and there is this paper 6 | 7 | *Lipovetsky, Stan. ["Analytical closed-form solution for binary logit regression by categorical predictors."](http://www.tandfonline.com/doi/abs/10.1080/02664763.2014.932760) Journal of Applied Statistics 42.1 (2015): 37-49. (Analytical closed-form solution for binary logit regression by categorical predictors)* 8 | 9 | which "shows that for categorical explanatory variables, it is possible to present the solution in the analytical closed-form formulae." 10 | The problem is that the logistic sigmoid function is non-linear -- in case of linear regression, you are assuming independent Gaussian noise. 11 | -------------------------------------------------------------------------------- /faq/logistic-boosting.md: -------------------------------------------------------------------------------- 1 | # Do bagging and boosting can be used with logistic regression? 2 | 3 | I am not sure if bagging would make much sense for logistic regression -- in bagging, we reduce the variance of the deep decision tree models that overfit the training data, which wouldn't really apply to logistic regression. 4 | 5 | Boosting could work though, however, I think that "stacking" would be a better approach here. Stacking would be more "powerful" since we don't use a pre-specified equation to adjust the weight, rather, we train a meta-classifier to learn the optimal weights to combine the models. 6 | 7 | 8 | Here's one of the many interesting, related papers, I recommend you to check out :) 9 | 10 | - "Is Combining Classifiers with Stacking Better than Selecting the Best One?" 11 | -------------------------------------------------------------------------------- /faq/logistic-why-sigmoid/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logistic-why-sigmoid/1.png -------------------------------------------------------------------------------- /faq/logistic-why-sigmoid/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logistic-why-sigmoid/2.png -------------------------------------------------------------------------------- /faq/logistic-why-sigmoid/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logistic-why-sigmoid/3.png -------------------------------------------------------------------------------- /faq/logistic-why-sigmoid/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logistic-why-sigmoid/4.png -------------------------------------------------------------------------------- /faq/logistic-why-sigmoid/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logistic-why-sigmoid/5.png -------------------------------------------------------------------------------- /faq/logistic-why-sigmoid/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logistic-why-sigmoid/6.png -------------------------------------------------------------------------------- /faq/logistic-why-sigmoid/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logistic-why-sigmoid/7.png -------------------------------------------------------------------------------- /faq/logistic_regression_linear/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logistic_regression_linear/1.png -------------------------------------------------------------------------------- /faq/logistic_regression_linear/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logistic_regression_linear/2.png -------------------------------------------------------------------------------- /faq/logistic_regression_linear/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logistic_regression_linear/3.png -------------------------------------------------------------------------------- /faq/logistic_regression_linear/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logistic_regression_linear/4.png -------------------------------------------------------------------------------- /faq/logisticregr-neuralnet/log-tanh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logisticregr-neuralnet/log-tanh.png -------------------------------------------------------------------------------- /faq/logisticregr-neuralnet/mlp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logisticregr-neuralnet/mlp.png -------------------------------------------------------------------------------- /faq/logisticregr-neuralnet/onehot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logisticregr-neuralnet/onehot.png -------------------------------------------------------------------------------- /faq/logisticregr-neuralnet/schematic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logisticregr-neuralnet/schematic.png -------------------------------------------------------------------------------- /faq/logisticregr-neuralnet/sigmoid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logisticregr-neuralnet/sigmoid.png -------------------------------------------------------------------------------- /faq/logisticregr-neuralnet/softmax.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logisticregr-neuralnet/softmax.png -------------------------------------------------------------------------------- /faq/logisticregr-neuralnet/unconvex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/logisticregr-neuralnet/unconvex.png -------------------------------------------------------------------------------- /faq/median-vs-mean.md: -------------------------------------------------------------------------------- 1 | # When should one use median, as opposed to the mean or average? 2 | 3 | It really depends on the distribution of the data and the question you are trying to address. 4 | 5 | Consider a symmetric distribution (here, I've drawn 10,000 random samples from a standard normal distribution): 6 | 7 | ![](./median-vs-mean/std-normal.png) 8 | 9 | In this case, the median and mean will be very similar (mean≈0.00337, median≈0.01690). In fact, the median and mean will be the same if your data sample is perfectly symmetrical distributed, for example, consider [1, 3, 5] or [1, 3, 3, 5]. 10 | 11 | Now, if you data is skewed, you are likely more interested in computing the median, which is less susceptible to outliers and extreme values. Let's consider a classic examples "salaries." Here, I plotted [FGCU salary dataset from OpenData](https://opendata.socrata.com/dataset/FGCU-salary-dataset/fjqw-ymup): 12 | 13 | ![](./median-vs-mean/salary.png) 14 | 15 | As we can see, there is a substantial difference between the mean and median value. Here, the mean picks up the relatively high but infrequent salaries at > 15,000. 16 | 17 | Again, it depends on the question you are asking of the data, however, if you question is "what is the average salary" in terms of "what is the typical salary of an employee," then median would be a much better measure than the mean. 18 | -------------------------------------------------------------------------------- /faq/median-vs-mean/salary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/median-vs-mean/salary.png -------------------------------------------------------------------------------- /faq/median-vs-mean/std-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/median-vs-mean/std-normal.png -------------------------------------------------------------------------------- /faq/mentor.md: -------------------------------------------------------------------------------- 1 | # How important do you think having a mentor is to the learning process? 2 | 3 | I guess it really depends on what type of learner you are. From what I understand, a mentor is like a "personal trainer," someone who gives you homework, tells you what books to read, etc. (in contrast to a teacher or professor who teaches a whole class at once). I think it is important to have friends who share similar interests to bounce of ideas, and I think it is important to know someone more knowledgeable than you who you could ask questions for your personal growth (e.g., a Prof who supervises your Ph.D. thesis would be such a person). However, I am not sure how important a "mentor" is for technical questions -- I think that's the 1-person equivalent of an answer poll via cross-validated or Quora. Anyways, I think a mentor may be a nice thing to have for certain people, but I wouldn't say everyone needs a dedicated "mentor." 4 | -------------------------------------------------------------------------------- /faq/missing-data.md: -------------------------------------------------------------------------------- 1 | # What are some common approaches for dealing with missing data? 2 | 3 | Many different approaches exist for dealing with missing values; I'd roughly categorize our options into a) deletion and b) imputation techniques. 4 | 5 | ## a) Deletion 6 | 7 | 1) We have a lot of training samples and can afford deleting some of those. Here, we can simply remove samples with missing feature values from the dataset entirely. 8 | 9 | 2) We have a large number of feature columns and some of them are redundant. Relatively many samples have a missing feature value in a certain column. In this scenario, it may be a good idea to remove these feature columns with missing values entirely. 10 | 11 | ## b) Imputation 12 | 13 | If we can't afford deleting data points, we could use imputation techniques to "guess" placeholder values from the remaining data points. 14 | 15 | 1) The simplest imputation technique may be the replacement of a missing feature value by its feature column's mean (median or mode). 16 | 17 | 2) Instead of replacing a feature value by its column mean, we can only consider the k-nearest neighbors of this datapoint for computing the mean (median or mode) -- we identify the neighbors based on the remaining feature columns that don't have missing values. 18 | -------------------------------------------------------------------------------- /faq/ml-curriculum/bengio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-curriculum/bengio.png -------------------------------------------------------------------------------- /faq/ml-curriculum/bishop.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-curriculum/bishop.jpeg -------------------------------------------------------------------------------- /faq/ml-curriculum/domingos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-curriculum/domingos.png -------------------------------------------------------------------------------- /faq/ml-curriculum/duda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-curriculum/duda.jpg -------------------------------------------------------------------------------- /faq/ml-curriculum/ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-curriculum/ng.png -------------------------------------------------------------------------------- /faq/ml-curriculum/raschka.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-curriculum/raschka.jpeg -------------------------------------------------------------------------------- /faq/ml-curriculum/tan.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-curriculum/tan.jpeg -------------------------------------------------------------------------------- /faq/ml-curriculum/three.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-curriculum/three.png -------------------------------------------------------------------------------- /faq/ml-curriculum/tibshirani.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-curriculum/tibshirani.jpeg -------------------------------------------------------------------------------- /faq/ml-examples/fb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-examples/fb.png -------------------------------------------------------------------------------- /faq/ml-examples/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-examples/google.png -------------------------------------------------------------------------------- /faq/ml-examples/hiv-protease.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-examples/hiv-protease.png -------------------------------------------------------------------------------- /faq/ml-examples/letter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-examples/letter.jpg -------------------------------------------------------------------------------- /faq/ml-examples/stars.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-examples/stars.jpg -------------------------------------------------------------------------------- /faq/ml-examples/stock-market.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-examples/stock-market.png -------------------------------------------------------------------------------- /faq/ml-python-communities.md: -------------------------------------------------------------------------------- 1 | # Where are the best online communities centered around data science/machine learning or python? 2 | 3 | I think [Twitter](https://twitter.com/rasbt) is great to stay in touch and see what other people are up to, and to share news of course. [Cross-validated](http://stats.stackexchange.com) & [Quora](https://www.quora.com/topic/Machine-Learning) are good websites to ask specific questions and collect multiple opinions about a topic. There's also a [machine learning group on Google+](https://plus.google.com/communities/107785538899595981479) that has a lot of members, but is not that active anymore I fear. The [MachineLearning subreddit](https://www.reddit.com/r/MachineLearning/) is another nice place to discuss certain news and articles. 4 | -------------------------------------------------------------------------------- /faq/ml-solvable/bias-variance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-solvable/bias-variance.png -------------------------------------------------------------------------------- /faq/ml-solvable/learning_curve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-solvable/learning_curve.png -------------------------------------------------------------------------------- /faq/ml-solvable/param_curve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/ml-solvable/param_curve.png -------------------------------------------------------------------------------- /faq/multiclass-metric/conf_mat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/multiclass-metric/conf_mat.png -------------------------------------------------------------------------------- /faq/multiclass-metric/macro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/multiclass-metric/macro.png -------------------------------------------------------------------------------- /faq/multiclass-metric/mcc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/multiclass-metric/mcc.png -------------------------------------------------------------------------------- /faq/multiclass-metric/micro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/multiclass-metric/micro.png -------------------------------------------------------------------------------- /faq/multiclass-metric/pre-rec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/multiclass-metric/pre-rec.png -------------------------------------------------------------------------------- /faq/naive-bayes-boundary.md: -------------------------------------------------------------------------------- 1 | # What is the decision boundary for Naive Bayes? 2 | 3 | 4 | It's a (piecewise) quadratic decision boundary for the Gaussian model. The multinomial model has a linear boundary. 5 | Below, I plotted some examples: 6 | 7 | 1) UCI Wine Dataset 8 | 9 | ![](./naive-bayes-boundary/gaussian_1.png) 10 | 11 | 2) An XOR toy dataset 12 | 13 | ![](./naive-bayes-boundary/gaussian_2.png) 14 | -------------------------------------------------------------------------------- /faq/naive-bayes-boundary/gaussian_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-bayes-boundary/gaussian_1.png -------------------------------------------------------------------------------- /faq/naive-bayes-boundary/gaussian_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-bayes-boundary/gaussian_2.png -------------------------------------------------------------------------------- /faq/naive-bayes-vartypes/bayes-theorem-in-words.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-bayes-vartypes/bayes-theorem-in-words.png -------------------------------------------------------------------------------- /faq/naive-bayes-vartypes/bayes-theorem-notation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-bayes-vartypes/bayes-theorem-notation.png -------------------------------------------------------------------------------- /faq/naive-bayes-vartypes/bayes-theorem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-bayes-vartypes/bayes-theorem.png -------------------------------------------------------------------------------- /faq/naive-bayes-vartypes/combined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-bayes-vartypes/combined.png -------------------------------------------------------------------------------- /faq/naive-bayes-vartypes/gaussian-likelihood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-bayes-vartypes/gaussian-likelihood.png -------------------------------------------------------------------------------- /faq/naive-bayes-vartypes/likelihood-bernoulli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-bayes-vartypes/likelihood-bernoulli.png -------------------------------------------------------------------------------- /faq/naive-bayes-vartypes/multi-variate-bernoulli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-bayes-vartypes/multi-variate-bernoulli.png -------------------------------------------------------------------------------- /faq/naive-bayes-vartypes/naive-bayes-decision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-bayes-vartypes/naive-bayes-decision.png -------------------------------------------------------------------------------- /faq/naive-bayes-vartypes/naive-bayes-likelihood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-bayes-vartypes/naive-bayes-likelihood.png -------------------------------------------------------------------------------- /faq/naive-bayes-vartypes/naive-bayes-likelihood_shorter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-bayes-vartypes/naive-bayes-likelihood_shorter.png -------------------------------------------------------------------------------- /faq/naive-naive-bayes.md: -------------------------------------------------------------------------------- 1 | # Why is the Naive Bayes Classifier naive? 2 | 3 | Let's start by taking a quick look at the Bayes' Theorem: 4 | 5 | ![](./naive-naive-bayes/bayes-theorem-english.png) 6 | 7 | In context of pattern classification, we can express it as 8 | 9 | ![](./naive-naive-bayes/bayes_theorem.png) 10 | 11 | ![](./naive-naive-bayes/let.png) 12 | 13 | If we use the Bayes Theorem in classification, our goal (or objective function) is to maximize the posterior probability 14 | 15 | ![](./naive-naive-bayes/decision_rule.png) 16 | 17 | Now, let's talk a bit more about the individual components. The priors are representing our expert (or any other prior) knowledge; in practice, the priors are often estimated via MLE (computed as class frequencies). The evidence term cancels because it is constant for all classes. 18 | 19 | Moving on to the "naive" part in the Naive Bayes Classifier: What makes it "naive" is that we compute the conditional probability (sometimes also called likelihoods) as the product of the individual probabilities for each feature: 20 | 21 | ![](./naive-naive-bayes/likelihood.png) 22 | 23 | Since this assumption (the absolute independence of features) is probably never met in practice, it's the truly "naive" part in naive Bayes. 24 | -------------------------------------------------------------------------------- /faq/naive-naive-bayes/bayes-theorem-english.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-naive-bayes/bayes-theorem-english.png -------------------------------------------------------------------------------- /faq/naive-naive-bayes/bayes_theorem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-naive-bayes/bayes_theorem.png -------------------------------------------------------------------------------- /faq/naive-naive-bayes/decision_rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-naive-bayes/decision_rule.png -------------------------------------------------------------------------------- /faq/naive-naive-bayes/let.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-naive-bayes/let.png -------------------------------------------------------------------------------- /faq/naive-naive-bayes/likelihood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/naive-naive-bayes/likelihood.png -------------------------------------------------------------------------------- /faq/neuralnet-error/approx-grad-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/neuralnet-error/approx-grad-1.png -------------------------------------------------------------------------------- /faq/neuralnet-error/approx-grad-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/neuralnet-error/approx-grad-2.png -------------------------------------------------------------------------------- /faq/neuralnet-error/approx-grad-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/neuralnet-error/approx-grad-3.png -------------------------------------------------------------------------------- /faq/neuralnet-error/approx-grad-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/neuralnet-error/approx-grad-4.png -------------------------------------------------------------------------------- /faq/neuralnet-error/momentum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/neuralnet-error/momentum.png -------------------------------------------------------------------------------- /faq/neuralnet-error/standardizing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/neuralnet-error/standardizing.png -------------------------------------------------------------------------------- /faq/num-support-vectors.md: -------------------------------------------------------------------------------- 1 | # When training an SVM classifier, is it better to have a large or small number of support vectors? 2 | 3 | 4 | Unfortunately, like so often in machine learning applications, it really depends on the dataset. If we train an RBF kernel SVM, we will typically end up with more support vectors than in a linear model. If our data is linearly separable, the latter may be better, and if that's not the case, the former may be better. 5 | 6 | Also, we have to differentiate between computational efficiency and generalization performance. If we increase the number of support vectors, our classification becomes more "expensive", especially in kernel SVM where we have to recalculate the distances between every new sample and the entire training set. 7 | 8 | 9 | I'd say the best way to tackle the predictive performance problem is simply to evaluate the model, plot learning curves, do k-fold and/or cross validation, and see what works best on our given dataset. 10 | -------------------------------------------------------------------------------- /faq/open-source.md: -------------------------------------------------------------------------------- 1 | # At what point should one start contributing to open source? 2 | 3 | Please don't feel pressured to contribute to open source if this is not your thing -- I see it more as an opportunity to learn and "give back" but it is certainly not a "duty" :). 4 | 5 | > ... small tasks like fixing typos [...] time could be spent learning instead 6 | 7 | I'd say it depends. I think contributing to open-source projects shouldn't be all about personal benefits, and expanding/fixing documentation where it is useful is also valuable for a project. Eventually, it is up to you where you want to be on the spectrum between "how does this benefit me personally" and "would this help the community and the people who put so much effort into the things that I am using daily for free." -- it's certainly not a black or white decision, and there is no right or wrong :) 8 | 9 | Btw. depending on your experience level, "fixing typos" can be a valuable learning experience as well. For instance, doing "data science" is not only about analyzing data, but communications skills and team skills are important as well. If you are not familiar with version control, see fixing typos as an opportunity to learn about it or practice working with certain frameworks/workflows. 10 | -------------------------------------------------------------------------------- /faq/overfitting/learning_curve_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/overfitting/learning_curve_1.png -------------------------------------------------------------------------------- /faq/pca-scaling/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pca-scaling/1.png -------------------------------------------------------------------------------- /faq/pca-scaling/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pca-scaling/10.png -------------------------------------------------------------------------------- /faq/pca-scaling/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pca-scaling/11.png -------------------------------------------------------------------------------- /faq/pca-scaling/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pca-scaling/2.png -------------------------------------------------------------------------------- /faq/pca-scaling/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pca-scaling/3.png -------------------------------------------------------------------------------- /faq/pca-scaling/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pca-scaling/4.png -------------------------------------------------------------------------------- /faq/pca-scaling/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pca-scaling/5.png -------------------------------------------------------------------------------- /faq/pca-scaling/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pca-scaling/6.png -------------------------------------------------------------------------------- /faq/pca-scaling/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pca-scaling/7.png -------------------------------------------------------------------------------- /faq/pca-scaling/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pca-scaling/8.png -------------------------------------------------------------------------------- /faq/pca-scaling/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pca-scaling/9.png -------------------------------------------------------------------------------- /faq/pearson-r-vs-linear-regr/covariance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pearson-r-vs-linear-regr/covariance.png -------------------------------------------------------------------------------- /faq/pearson-r-vs-linear-regr/example-1-fit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pearson-r-vs-linear-regr/example-1-fit.png -------------------------------------------------------------------------------- /faq/pearson-r-vs-linear-regr/example-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pearson-r-vs-linear-regr/example-1.png -------------------------------------------------------------------------------- /faq/pearson-r-vs-linear-regr/example-2-fit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pearson-r-vs-linear-regr/example-2-fit.png -------------------------------------------------------------------------------- /faq/pearson-r-vs-linear-regr/example-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pearson-r-vs-linear-regr/example-2.png -------------------------------------------------------------------------------- /faq/pearson-r-vs-linear-regr/intercept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pearson-r-vs-linear-regr/intercept.png -------------------------------------------------------------------------------- /faq/pearson-r-vs-linear-regr/pearson.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pearson-r-vs-linear-regr/pearson.png -------------------------------------------------------------------------------- /faq/pearson-r-vs-linear-regr/sigma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pearson-r-vs-linear-regr/sigma.png -------------------------------------------------------------------------------- /faq/pearson-r-vs-linear-regr/slope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pearson-r-vs-linear-regr/slope.png -------------------------------------------------------------------------------- /faq/pearson-r-vs-linear-regr/slope_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pearson-r-vs-linear-regr/slope_r.png -------------------------------------------------------------------------------- /faq/pearson-r-vs-linear-regr/slope_rewrite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pearson-r-vs-linear-regr/slope_rewrite.png -------------------------------------------------------------------------------- /faq/pearson-r-vs-linear-regr/standardize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/pearson-r-vs-linear-regr/standardize.png -------------------------------------------------------------------------------- /faq/probablistic-logistic-regression/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/probablistic-logistic-regression/1.png -------------------------------------------------------------------------------- /faq/probablistic-logistic-regression/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/probablistic-logistic-regression/2.png -------------------------------------------------------------------------------- /faq/probablistic-logistic-regression/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/probablistic-logistic-regression/3.png -------------------------------------------------------------------------------- /faq/probablistic-logistic-regression/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/probablistic-logistic-regression/4.png -------------------------------------------------------------------------------- /faq/probablistic-logistic-regression/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/probablistic-logistic-regression/5.png -------------------------------------------------------------------------------- /faq/probablistic-logistic-regression/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/probablistic-logistic-regression/6.png -------------------------------------------------------------------------------- /faq/probablistic-logistic-regression/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/probablistic-logistic-regression/7.png -------------------------------------------------------------------------------- /faq/probablistic-logistic-regression/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/probablistic-logistic-regression/8.png -------------------------------------------------------------------------------- /faq/probablistic-logistic-regression/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/probablistic-logistic-regression/9.png -------------------------------------------------------------------------------- /faq/py2py3.md: -------------------------------------------------------------------------------- 1 | # Which version of Python was used in the code examples? 2 | 3 | I wrote all code examples in 3.4. I tried to also make sure that everything works fine with Python 2.7, however, I stopped testing the code on Python 2.7 halfway through the book. The reason is that I really don't think that it is really crucial which Python version is being used since most of the libraries towards supporting both Python 2.7 and 3.4 anyways. 4 | 5 | Throughout the book, we will also implement our own machine learning algorithms from scratch (linear classifiers, ensemble classifiers, feature selection, and neural networks), and here I paid special attention that it works for Python 2.7 as well. 6 | 7 | I think the only parts where Py27 may have a disadvantage is the sentiment analysis chapter due to the quirky Unicode handling. However, I added notes and comments here and there so that you could get along with Python 2.7 just fine I hope! 8 | 9 | Anyways, I think the real focus of this book is to learn about the important concepts in Machine Learning, and how to write code to put it to action. Thus, after reading the book, you will hopefully find that you are interested in the bigger questions and be fascinated by the possibilities Python offers to get your analysis done! 10 | -------------------------------------------------------------------------------- /faq/regularized-logistic-regression-performance/l2-term.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/regularized-logistic-regression-performance/l2-term.png -------------------------------------------------------------------------------- /faq/regularized-logistic-regression-performance/regularized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/regularized-logistic-regression-performance/regularized.png -------------------------------------------------------------------------------- /faq/regularized-logistic-regression-performance/unregularized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/regularized-logistic-regression-performance/unregularized.png -------------------------------------------------------------------------------- /faq/return_self_idiom.md: -------------------------------------------------------------------------------- 1 | # What is the purpose of the `return self` idioms in your code examples? 2 | 3 | Many (if not all) of the object-oriented implementations in my code examples return `self` in their respective calls -- and scikit-learn does this, too! So, what is the rational behind a method that returns the the object itself? The answer is a rather simple one: "Chaining," which enables us to concatenate operations more conveniently (and efficiently) by feeding the answer of an operations into the next. 4 | 5 | For example, an implementation such as 6 | 7 | class Perceptron(object): 8 | def __init__(self, …): 9 | … 10 | 11 | def fit(self, …): 12 | return self 13 | 14 | def predict(self, …): 15 | return self 16 | 17 | would allow us to write a compact notation such as 18 | 19 | prediction = Perceptron().fit(X, y).predict(X) 20 | 21 | in one line of code instead of 22 | 23 | p = Perceptron() 24 | p.fit(X, y) 25 | prediction = p.predict(X) 26 | -------------------------------------------------------------------------------- /faq/select_svm_kernels/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/select_svm_kernels/1.png -------------------------------------------------------------------------------- /faq/select_svm_kernels/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/select_svm_kernels/2.png -------------------------------------------------------------------------------- /faq/select_svm_kernels/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/select_svm_kernels/3.png -------------------------------------------------------------------------------- /faq/select_svm_kernels/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/select_svm_kernels/4.png -------------------------------------------------------------------------------- /faq/select_svm_kernels/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/select_svm_kernels/5.png -------------------------------------------------------------------------------- /faq/softmax.md: -------------------------------------------------------------------------------- 1 | # What exactly is the "softmax and the multinomial logistic loss" in the context of machine learning? 2 | 3 | The softmax function is simply a generalization of the logistic function that allows us to compute meaningful class-probabilities in multi-class settings (multinomial logistic regression). In softmax, we compute the probability that a particular sample (with net input z) belongs to the *i*th class using a normalization term in the denominator that is the sum of all *M* linear functions: 4 | 5 | ![](./softmax/softmax_1.png) 6 | 7 | In contrast, the logistic function: 8 | 9 | ![](./softmax/logistic.png) 10 | 11 | And for completeness, we define the net input as 12 | 13 | ![](./softmax/net_input.png) 14 | 15 | where the weight coefficients of your model are stored as vector "w" and "x" is the feature vector of your sample. 16 | -------------------------------------------------------------------------------- /faq/softmax/logistic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax/logistic.png -------------------------------------------------------------------------------- /faq/softmax/net_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax/net_input.png -------------------------------------------------------------------------------- /faq/softmax/softmax_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax/softmax_1.png -------------------------------------------------------------------------------- /faq/softmax_regression/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/1.png -------------------------------------------------------------------------------- /faq/softmax_regression/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/10.png -------------------------------------------------------------------------------- /faq/softmax_regression/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/11.png -------------------------------------------------------------------------------- /faq/softmax_regression/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/12.png -------------------------------------------------------------------------------- /faq/softmax_regression/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/13.png -------------------------------------------------------------------------------- /faq/softmax_regression/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/14.png -------------------------------------------------------------------------------- /faq/softmax_regression/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/15.png -------------------------------------------------------------------------------- /faq/softmax_regression/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/2.png -------------------------------------------------------------------------------- /faq/softmax_regression/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/3.png -------------------------------------------------------------------------------- /faq/softmax_regression/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/4.png -------------------------------------------------------------------------------- /faq/softmax_regression/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/5.png -------------------------------------------------------------------------------- /faq/softmax_regression/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/6.png -------------------------------------------------------------------------------- /faq/softmax_regression/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/7.png -------------------------------------------------------------------------------- /faq/softmax_regression/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/8.png -------------------------------------------------------------------------------- /faq/softmax_regression/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/9.png -------------------------------------------------------------------------------- /faq/softmax_regression/logistic_regression_schematic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/softmax_regression/logistic_regression_schematic.png -------------------------------------------------------------------------------- /faq/svm_for_categorical_data/onehot-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/svm_for_categorical_data/onehot-color.png -------------------------------------------------------------------------------- /faq/tensorflow-vs-scikitlearn/scikit-softmax.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/tensorflow-vs-scikitlearn/scikit-softmax.png -------------------------------------------------------------------------------- /faq/tensorflow-vs-scikitlearn/tf_cost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/tensorflow-vs-scikitlearn/tf_cost.png -------------------------------------------------------------------------------- /faq/tensorflow-vs-scikitlearn/tf_softmax.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/tensorflow-vs-scikitlearn/tf_softmax.png -------------------------------------------------------------------------------- /faq/version.md: -------------------------------------------------------------------------------- 1 | # Which book version/format would you recommend? 2 | 3 | Personally, I prefer Amazon when it comes to print versions of books (probably because they ship pretty quickly). For ebooks, I really have no preference: Google books, Amazon, or iBooks -- they come all with pretty good reading apps for your tablet or computer. 4 | 5 | I really do not want to advertise any platform here, but I think it would not be a bad idea to consider getting it from the publisher directly, since you'd get a DRM-free .epub version for your favorite reading app plus the PDF. And adding the print version is only slightly more expensive. Unfortunately, the figures in the print version will be in grayscale, so it's probably nicer to take a look at the digital options. 6 | 7 | But no matter which platform you choose: I will make sure that you get the code examples most conveniently -- I will upload them here on GitHub; you won't need to create an account at PACKT just to download the code examples :). 8 | -------------------------------------------------------------------------------- /faq/visual-backpropagation/backpropagation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/visual-backpropagation/backpropagation.png -------------------------------------------------------------------------------- /faq/visual-backpropagation/chain_rule_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/visual-backpropagation/chain_rule_1.png -------------------------------------------------------------------------------- /faq/visual-backpropagation/chain_rule_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/visual-backpropagation/chain_rule_2.png -------------------------------------------------------------------------------- /faq/visual-backpropagation/forward-propagation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/visual-backpropagation/forward-propagation.png -------------------------------------------------------------------------------- /faq/visual-backpropagation/nonconvex-cost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/visual-backpropagation/nonconvex-cost.png -------------------------------------------------------------------------------- /faq/why-python/automation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/why-python/automation.png -------------------------------------------------------------------------------- /faq/why-python/heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/why-python/heatmap.png -------------------------------------------------------------------------------- /faq/why-python/ipython_notebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/why-python/ipython_notebook.png -------------------------------------------------------------------------------- /faq/why-python/julia_benchmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/why-python/julia_benchmark.png -------------------------------------------------------------------------------- /faq/why-python/python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/why-python/python.png -------------------------------------------------------------------------------- /faq/why-python/revor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/why-python/revor.png -------------------------------------------------------------------------------- /faq/why-python/spectrum.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/why-python/spectrum.jpg -------------------------------------------------------------------------------- /faq/why-python/the_general_problem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/why-python/the_general_problem.png -------------------------------------------------------------------------------- /faq/why-python/tiobe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/faq/why-python/tiobe.png -------------------------------------------------------------------------------- /images/CRBadgeNotableBook.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/CRBadgeNotableBook.jpg -------------------------------------------------------------------------------- /images/check_env.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/check_env.png -------------------------------------------------------------------------------- /images/cover_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/cover_1.png -------------------------------------------------------------------------------- /images/equation-ref-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/equation-ref-logo.png -------------------------------------------------------------------------------- /images/ml-overview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/ml-overview.jpg -------------------------------------------------------------------------------- /images/mlxtend_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/mlxtend_logo.png -------------------------------------------------------------------------------- /images/pymle-cover_cn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/pymle-cover_cn.jpg -------------------------------------------------------------------------------- /images/pymle-cover_cn_mainland.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/pymle-cover_cn_mainland.jpg -------------------------------------------------------------------------------- /images/pymle-cover_de.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/pymle-cover_de.jpg -------------------------------------------------------------------------------- /images/pymle-cover_de_old.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/pymle-cover_de_old.jpg -------------------------------------------------------------------------------- /images/pymle-cover_it.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/pymle-cover_it.jpg -------------------------------------------------------------------------------- /images/pymle-cover_jp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/pymle-cover_jp.jpg -------------------------------------------------------------------------------- /images/pymle-cover_kr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/pymle-cover_kr.jpg -------------------------------------------------------------------------------- /images/pymle-cover_pl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/pymle-cover_pl.jpg -------------------------------------------------------------------------------- /images/pymle-cover_ru.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/pymle-cover_ru.jpg -------------------------------------------------------------------------------- /images/pymle_amzn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/pymle_amzn.png -------------------------------------------------------------------------------- /images/pymle_cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/pymle_cover.jpg -------------------------------------------------------------------------------- /images/pymle_cover_double_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/pymle_cover_double_small.jpg -------------------------------------------------------------------------------- /images/pymle_cover_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/pymle_cover_small.jpg -------------------------------------------------------------------------------- /images/scipy2016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasbt/python-machine-learning-book/903209f79735249613da5e2019be06d1d6a09e2c/images/scipy2016.jpg --------------------------------------------------------------------------------