Code Monkey home page Code Monkey logo

lab4-ml's Introduction

System requirements to build and run the project:

  1. Apache Maven - (3.6.0)
  2. JDK - (1.8)
  3. The code has been tested on crackle1 server

Steps:

  1. Change the working directory to the root folder of this project.
  2. Execute command: mvn clean
  3. Execute command: mvn package
  4. Now you have an executable jar in "./target/learn-1.jar"
  5. 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]

Arguments to the executable:

  1. k : Indicates the number of points to use for knn.
    Eg: k=3. Make sure not to add spaces in between
  2. c : Indicates the Laplacian correction for Naive-Bayes.
    Eg: c=1. Make sure not to add spaces in between
  3. 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
  4. 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
  5. 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
  6. 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 ','.

Examples to execute the code

  1. 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
  2. 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
  3. KMeans learner:
    Eg: java -jar target/learn-1.jar train=/home/utkarshtyg/Documents/kmeans/km1.txt 0,0 200,200 500,500

lab4-ml's People

Contributors

utki96 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.