Coder Social home page Coder Social logo

rahulrajpl / dt-classifier-best-explored Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 5.53 MB

Program trains a decision tree classifier available from sklearn library. Training is undertaken using 3 folded RandomizedSearch cross validation untill specified accuracy is achieved.

Home Page: http://randomwalk.in/Train-Until-Best-Estimater-for-DT-Classifier/

License: MIT License

Python 4.72% Jupyter Notebook 65.94% HTML 29.34%

dt-classifier-best-explored's Introduction

Instructions

Following are the two methods to reproduce the results claimed in the report. Preferred method is Method 1.

Method 1 (Easy way)

Pre-requisites on host machine


Linux OS (preferably an Ubuntu 18.04) installed with docker container. Same can be installed using instruction at step 1 here. Once the installation is finished, run following command to download the docker image.

docker pull rahulrajpl/clf

This docker image already has the source files. Once the image is downloaded, run the test commands shown in the examples section directly to test the model and evaluate.

Method 2

Pre-requisites on host machine


Ensure that Python3.6, python3-tk, virtualenv and pip. If not available, install it using following commands

>> sudo apt-get install python3.6
>> sudo apt-get install python3-tk
>> sudo apt-get install virtualenv
>> sudo apt-get install -y python3-pip

Setting up the source directory


  1. Extract the zip file submitted

  2. Go to the source folder and open a terminal window

  3. Activate a virtual environment. This step is optional, however recommended.

    >> virtualenv venv
    >> source venv/bin/activate
    
  4. Install all the dependencies using command

    >> pip install -r requirements.txt
    
  5. Once the installation is completed, run following command to initialize the training phase. This is an optional step, as a trained model, named 'best.model', is already in the source folder.

    >> python3 train.py
    
  6. For testing run following command

    >> python3 test.py <n_samples> <n_iterations> [OPTIONAL model_file]
    

Example usage


If training is carried out freshly, then testing can be done as shown below

>> python3 test.py 2000 10
>> python3 test.py 2000 10 best.model 

Above command will test the model for 10 different samples of size 2000 rows. Other examples are shown below

>> python3 test.py 1000 20 best.model
>> python3 test.py 100 10 best.model
>> python3 test.py 1500 20 best.model

Note:

Documentation of source code for training program can be viewed using following command from the terminal

>> pydoc train

dt-classifier-best-explored's People

Contributors

rahulrajpl avatar

Watchers

 avatar  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.