You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Heuristics are "rules of thumb" designed to find an approximate solution to a complex problem.
11
+
12
+
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.
13
+
14
+
## What is the purpose of this app?
15
+
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.
16
+
17
+
For example, the app produces the following Python code to correctly classify the [iris dataset](https://github.com/BenAAndrew/auto-heuristic/blob/main/tests/test_files/iris.csv) 100% of the time:
18
+
19
+
```
20
+
def predict(petal_width, petal_length):
21
+
if petal_length <= 2.45:
22
+
return "setosa"
23
+
else:
24
+
if petal_length <= 4.75:
25
+
if petal_width <= 1.65:
26
+
return "versicolor"
27
+
else:
28
+
return "virginica"
29
+
else:
30
+
if petal_width <= 1.75:
31
+
return "versicolor"
32
+
else:
33
+
return "virginica"
34
+
```
35
+
36
+
## How it works
37
+
Using a [DecisionTreeClassifier](https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeClassifier.html) the app automatically explores a variety of tree depths to identify the best trade off between accuracy and complexity.
38
+
39
+
It then converts this decision tree into code so that you can quickly implement it into your codebase.
0 commit comments