/Machine-Learning-in-Action-Python3

Source code in /Machine Learning in Action/ in Python3 version

Primary LanguagePython

Machine Learning in Action

This is the source code of the book Machine Learning in Action authored by Peter Harrington, which is modified to python3 version code.

System Information

Operating System: Mac OS High Sierra

Programming Language: Python 3.6.4

Instructions

Chapter 2: Classifying with k-Nearest Neighbors

knn.py: include some basic functions about the knn algorithm.

classify_person.py: the main program to test whether a person is suitable to Helen.

classify_digits.py: the main program to train and test the model to classify the handwriting 0-9.

Chapter 3: Splitting Datasets One Feature at a Time: Decision Trees

trees.py: include some basic functions about the decision tree algorithm.

tree_plotter.py: visualize the decision tree.

tree_test.py: test the example of lenses based on decision tree algorithm.

Chapter 4: Classifying with Probability Theory: Naive Bayes

bayes.py: include some basic functions about the naive bayes algorithm.

bayes_test.py: test the example in the book.

classify_email.py: classify the email based on naive bayes algorithm.

Chapter 5: Logistic Regression

logistic_regression.py: include some basic functions about the logistic regression algorithm.

logistic_test.py: test the example in the book based on logistic regression.

Chapter 6: Support Vector Machines

svm.py: include some basic functions about the Support Vector Machine algorithm.

svm_test.py: test the example in the book based on SVM algorithm.

test_digits.py: classify digits based on SVM.

Chapter 7: Improving Classification with the AdaBoost Meta-Algorithm

adaboost.py: include some basic functions about the AdaBoost algorithm.

test_adaboost.py: test the example in the book based on AdaBoost algorithm.

Chapter 8: Predicting Numeric Values: Regression

regression.py: include some basic functions about the linear regression algorithm.

regression_test.py: test the example in chapter 8

abalone.py: estimate the age of abalone.

Chapter 9: Tree-Based Regression

regression_tree.py: include some basic functions about the regression tree.

regression_tree_test.py: test for the example in the book.

example.py: comparing tree methods to standard regression.

Chapter10: Grouping Unlabeled Items Using K-Means Clustering

kmeans.py: include some basic functions about k-means clustering.

test_kmeans.py: test for the example in the book.

Chapter11: Association Analysis with the Apriori Algorithm

apriori.py: include some basic functions about Apriori algorithm.

test_apriori.py: test for the example in the book.

Chapter12: Efficiently Finding Frequent Itemsets with FP-Growth

fpgrowth.py: include some basic functions abou FP_Growth.

test_fpgrowth.py: test for the example in the book.

kosarak.py: kosarak example.

Chapter13: Using Principal Component Analysis to Simplify Data

pca.py: include some basic functions about PCA.

test_pca.py: test the example in the book.

example.py: using PCA to reduce the dimensionality of semiconductor manufacturing data.

Chapter14: Simplifying Data with the Singular Value Decomposition

svd.py: include some basic functions about the SVD.

test_svd.py: test the example in the book.

recommand.py: example: a restaurant dish recommendation engine.

compression.py: example: image compression with the SVD.