Giter VIP home page Giter VIP logo

eecs349_decisiontree's Introduction

Decision Tree Starter Code

#Credits: Philip Lan, Christopher Li, Alex Wang, Jacob Samson, Nishant Subramani

Building

To build the project, you must pass it a dictionary of inputs.Below are listed the options available to be passed.

Documentation

train Required. Should be passed a path from the decision_tree_driver.py file to the file to be trained on. validate Should be passed a path from the decision_tree_driver.py file to the file to be validated on or left blank. predict Should be passed a path from the decision_tree_driver.py file to the file to predict outputs. The generated output will be created and named after this file in the format of file_predictions.csv or left blank. limit_splits_on_numerical Should be passed an integer that limits the number of splits that can be made on each numerical attribute. limit_depth Should be passed an integer that limits depth of the decision tree. print_tree Should be passed a boolean which will print a tree in readable format if True. print_dnf Should be passed a boolean which will print a disjunctive normalized form of the decision tree if True. prune Should be passed a boolean which prune the tree with the reduced error pruning method if True. Requires validate. learning_curve Should be passed a dictionary of upper bound and increment or left blank. This will take a portion of the training data and validates it on the validation set and will be done over a range of partials. The plot will be saved in the output directory.

Example

Below are the commands necessary to run the program. The options dictionary is customizable based on the documentation above.

execfile("decision_tree_driver.py")
options = {
    'train' : 'data/btrain.csv',
    'validate': 'data/bvalidate.csv',
    'predict': 'data/btest.csv',
    'limit_splits_on_numerical': 5,
    'limit_depth': 20,
    'print_tree': True,
    'print_dnf' : True,
    'prune' : True,
    'learning_curve' : {
    	'upper_bound' : 0.01,
    	'increment' : 0.001
	}
}
decision_tree_driver(options)

The only variable required is train, so the program will not output anything, it can also execute with only the train key:

execfile("decision_tree_driver.py")
options = {
	'train': 'data/btrain.csv'
}
decision_tree_driver(options)

eecs349_decisiontree's People

Contributors

rromo12 avatar

Watchers

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