Skip to content

Commit 39ee2eb

Browse files
committed
Update README
1 parent bc2cc6f commit 39ee2eb

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
11
# auto-heuristic
22

33
[![codecov](https://codecov.io/gh/BenAAndrew/auto-heuristic/branch/main/graph/badge.svg?token=V4U2GG7X9Y)](https://codecov.io/gh/BenAAndrew/auto-heuristic)
4+
5+
## [Live demo](https://heuristic-generator.herokuapp.com/)
6+
7+
![preview](preview.gif)
8+
9+
## What is a heuristic?
10+
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.

preview.gif

761 KB
Loading

0 commit comments

Comments
 (0)