- Apache Maven - (3.6.0)
- JDK - (1.8)
- The code has been tested on
crackle1
server
- Change the working directory to the root folder of this project.
- Execute command:
mvn clean
- Execute command:
mvn package
- Now you have an executable jar in "./target/learn-1.jar"
- Run this jar file by this command:
java -jar target/learn-1.jar [k=%d] [c=%d] [d=%s] [test=%s] [train=%s] [v] [centroid_values]
- k : Indicates the number of points to use for knn.
Eg:k=3
. Make sure not to add spaces in between - c : Indicates the Laplacian correction for Naive-Bayes.
Eg:c=1
. Make sure not to add spaces in between - train : pass the training data file as this parameter.
Eg:train=/home/utkarshtyg/Documents/knn/knn1.train.txt
. Make sure not to add spaces in between - test : pass the testing data file as this parameter.
Eg:test=/home/utkarshtyg/Documents/knn/knn1.test.txt
. Make sure not to add spaces in between - d : Indicates the distance function only for KMeans: manh(Manhattan Distance)/e2(Euc squared).
Eg:d=manh
. Make sure not to add spaces in between - centroid_value: pass the centroid values only for KMeans.
Eg:200,200,200
. Make sure not to add spaces in between and to separate the dimensions with a ','.
- KNN learner:
Eg:java -jar target/learn-1.jar train=/home/utkarshtyg/Documents/knn/knn1.train.txt test=/home/utkarshtyg/Documents/knn/knn1.test.txt k=3
- Bayes learner:
Eg:java -jar target/learn-1.jar train=/home/utkarshtyg/Documents/bayes/ex1_train.csv test=/home/utkarshtyg/Documents/bayes/ex1_test.csv c=1 v
- KMeans learner:
Eg:java -jar target/learn-1.jar train=/home/utkarshtyg/Documents/kmeans/km1.txt 0,0 200,200 500,500