-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
41 lines (29 loc) · 1.86 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Small, general (map-based) decision tree concept learning library for
Clojure.
Example:
user> (use 'decision-tree.core)
nil
user> (def sample-data
[[{:outlook "Sunny", :temperature "Hot", :humidity "High", :wind "Weak"}, "No"],
[{:outlook "Sunny", :temperature "Hot", :humidity "High", :wind "Strong"}, "No"],
[{:outlook "Overcast", :temperature "Hot", :humidity "High", :wind "Weak"}, "Yes"],
[{:outlook "Rain", :temperature "Mild", :humidity "High", :wind "Weak"}, "Yes"],
[{:outlook "Rain", :temperature "Cool", :humidity "Normal", :wind "Weak"}, "Yes"],
[{:outlook "Rain", :temperature "Cool", :humidity "Normal", :wind "Strong"}, "No"],
[{:outlook "Overcast", :temperature "Cool", :humidity "Normal", :wind "Strong"}, "Yes"],
[{:outlook "Sunny", :temperature "Mild", :humidity "High", :wind "Weak"}, "No"],
[{:outlook "Sunny", :temperature "Cool", :humidity "Normal", :wind "Weak"}, "Yes"],
[{:outlook "Rain", :temperature "Mild", :humidity "Normal", :wind "Weak"}, "Yes"],
[{:outlook "Sunny", :temperature "Mild", :humidity "Normal", :wind "Strong"}, "Yes"],
[{:outlook "Overcast", :temperature "Mild", :humidity "High", :wind "Strong"}, "Yes"],
[{:outlook "Overcast", :temperature "Hot", :humidity "Normal", :wind "Weak"}, "Yes"],
[{:outlook "Rain", :temperature "Mild", :humidity "High", :wind "Strong"}, "No"]]
)
#'user/sample-data
user> (build-decision-tree sample-data)
[:outlook {"Sunny" [:humidity {"High" "No", "Normal" "Yes"}], "Overcast" "Yes", "Rain" [:wind {"Weak" "Yes", "Strong" "No"}]}]
user> (tree-decide (build-decision-tree sample-data) {:outlook "Sunny", :temperature "Hot", :humidity "High", :wind "Weak"})
"No"
## License
Copyright (C) 2011 FIXME
Distributed under the Eclipse Public License, the same as Clojure.