Python_for_Data_Science/simple_ml.py at master · gumption/Python_for_Data_Science
pythonmachine-learningdecision-treesdata-science
Abstraction: Python utility library implementing decision tree ML from scratch
Key points:
- Author Joe McCarthy (v1.0.3, 2014); ~383 lines implementing simple ML tasks in pure Python
- Implements
create_decision_treevia simplified ID3 algorithm — recursive splitting by highest information gain - Provides
entropy,information_gain,majority_value,classify, andclassification_accuracyfunctions - Supports loading/saving CSV instances and attribute name/value metadata files
- Includes
compute_learning_curvefor evaluating model accuracy across incrementally larger training sets
Connections: Github · Decision Trees · Information Gain · Machine Learning
Source: https://github.com/gumption/Python_for_Data_Science/blob/master/simple_ml.py