joshthoward / MachineLearning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The PCA, LDA, and Naive Bayes algorithms are implemented in the PCA.py, LDA.py, and NB.py files. To run the algorithms required simply type "python .py" with the appropriate arguments mentioned below. It is assumed that the neccesary data sets are in the same directory and named the same way as they were given. The util.py file is a common library for all algorithms and is not supposed to be ran indepenently.

The first argument required after any algorithm is the data set name. When using MNIST data for any algorithm the two digits must be specified in any order. For example, the command "python LDA.py MNIST 1 0" runs the LDA algorithm on the MNIST digits 1 and 0. When using the wine data, no additional arguments are needed for PCA, however a training/testing scheme must be specified when using LDA or Naive Bayes. The possible arguments are '10-fold' which does a 10-fold cross validation test, or an integer number that specifies the number of elements to train on.

Potential operator errors are selecting digits that aren't present in the data set and selecting more elements for training than exist in the wine data set. It is also possible that divide by zero errors will occur during runtime for the LDA algorithm. These are handled and do not affect the results do to the sorting and selection of eigenvectors, so disregard this.

About


Languages

Language:Python 100.0%