shivamtawari / decision_tree Goto Github PK
View Code? Open in Web Editor NEWDecision Tree Program
License: MIT License
Decision Tree Program
License: MIT License
README Decision Tree Program File Structure: readme.txt main.py DecisionTree.py Node.py Development Environment: My Decision Tree Learning program was developed in the Eclipse IDE in Python. Usage: My program is compatible with Python2.6 and 2.7, I have not checked compatibility with any other versions. To run my program, issue the command “python main.py” from within this folder. This will output program.py which can then be run with “python program.py” and that will output to the console the target value for each entry of test data. To change the training data, change string in the function “open()” in line 8 of main.py to the path of the new training data. To change the target attribute, change the string in line 12 of main.py to the new target attribute. And to change the test data, change the string in the function “open()” at line 31 or main.py to the path of the new test data. If you forget, you can also change it at line 4 of program.py after running main.py. (note, my program is case sensitive) Output of Test Cases: Weather.csv: entry1 = yes entry2 = yes entry3 = yes entry4 = no can't process input 5 entry5 = ? Vote.csv: entry1 = democrat entry2 = democrat entry3 = democrat entry4 = democrat entry5 = democrat Soybean.csv: can't process input 1 entry1 = ? entry2 = brown-spot can't process input 3 entry3 = ? can't process input 4 entry4 = ? can't process input 5 entry5 = ? Code Review: main.py imports and creates the tree using DecisionTree.py. It uses the DecisionTree.py implements the ID3 algorithm and returns the resulting tree as a multi-dimensional dictionary. This dictionary is the fed to program.py which processes the dictionary as a tree. It does so by importing and using Node.py and generates appropriate output based on that tree.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.