Heuristics are "rules of thumb" designed to find an approximate solution to a complex problem.
Often we may want to create a set of rules which fit most cases for a dataset. However, it can be time consuming to explore the dataset and decide the best rules by hand.
This app automatically generates a set of rules to classify a dataset. It then generates Python or JS code which you can quickly implement to add this behaviour.
For example, the app produces the following Python code to correctly classify the iris dataset 100% of the time:
def predict(petal_width, petal_length):
if petal_length <= 2.45:
return "setosa"
else:
if petal_length <= 4.75:
if petal_width <= 1.65:
return "versicolor"
else:
return "virginica"
else:
if petal_width <= 1.75:
return "versicolor"
else:
return "virginica"
Using a DecisionTreeClassifier the app automatically explores a variety of tree depths to identify the best trade off between accuracy and complexity.
It then converts this decision tree into code so that you can quickly implement it into your codebase.
- Install Python 3.8
pip install -r requirements.txt
python app.py
python cli.py