joyoyoyoyoyo / machine-learning-cs165b-assignment4

πŸ“Œ 1. Compute the Mahalanobis distance from a centroid for a given set of training points. 2. Implement Radial Basis function (RBF) Gaussian Kernel Perceptron. 3. Implement a k-nearest neighbor (kNN) classifier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

knn will default to write to file

mahadist.py and kerpercep will need to output via commandline with the '>' character

cd hw4-1
python2.7 mahadist.py training_data_prob1_1.txt testing_data_prob1_1.txt > output1.txt
python2.7 mahadist.py training_data_prob1_2.txt testing_data_prob1_2.txt > output2.txt
cd ..

cd hw4-2
python2.7 kerpercep.py 1.0 positive_training_data_prob2_1.txt negative_training_data_prob2_1.txt positive_testing_data_prob2_1.txt negative_testing_data_prob2_1.txt > output1.txt
python2.7 kerpercep.py 1.0 positive_training_data_prob2_2.txt negative_training_data_prob2_2.txt positive_testing_data_prob2_2.txt negative_testing_data_prob2_2.txt > output2.txt
cd ..

cd hw4-3
python2.7 knn.py 1 training_data_prob3_1.txt testing_data_prob3_1.txt > output1.txt
python2.7 knn.py 5 training_data_prob3_2.txt testing_data_prob3_2.txt > output2.txt
cd ..
# Fin

About

πŸ“Œ 1. Compute the Mahalanobis distance from a centroid for a given set of training points. 2. Implement Radial Basis function (RBF) Gaussian Kernel Perceptron. 3. Implement a k-nearest neighbor (kNN) classifier


Languages

Language:Python 95.6%Language:Jupyter Notebook 4.4%