Changes
Page history
Update hoeffding_tree
authored
Nov 18, 2022
by
Dean Samuel Schmitz
Show whitespace changes
Inline
Side-by-side
PrologMethods/Classification/hoeffding_tree.md
View page @
85ff764d
...
...
@@ -6,8 +6,10 @@ An implementation of Hoeffding trees, a form of streaming decision tree for clas
:-
use_module
(
'path/to/.../src/methods/hoeffding_tree/hoeffding_tree.pl'
).
%% usage example
hoeffding_tree_initAndBuildModel
(
gini_hoeffding
,
[
5.1
,
3.5
,
1.4
,
4.9
,
3.0
,
1.4
,
4.7
,
3.2
,
1.3
,
4.6
,
3.1
,
1.5
],
3
,
[
0
,
1
,
0
,
1
],
2
,
0
,
0.95
,
5000
,
100
,
100
,
10
,
100
),
hoeffding_tree_classify
([
3
,
2
,
0
,
5
,
1
,
4
,
0
,
0
,
4
,
3
,
3
,
5
,
0
,
5
,
5
,
2
,
5
,
5
],
3
,
PredicList
,
ProbsList
).
TrainData
=
[
5.1
,
3.5
,
1.4
,
4.9
,
3.0
,
1.4
,
4.7
,
3.2
,
1.3
,
4.6
,
3.1
,
1.5
],
TestData
=
[
3
,
2
,
0
,
5
,
1
,
4
,
0
,
0
,
4
,
3
,
3
,
5
,
0
,
5
,
5
,
2
,
5
,
5
],
hoeffding_tree_initAndBuildModel
(
gini_hoeffding
,
TrainData
,
3
,
[
0
,
1
,
0
,
1
],
2
,
0
,
0.95
,
5000
,
100
,
100
,
10
,
100
),
hoeffding_tree_classify
(
TestData
,
3
,
PredicList
,
ProbsList
).
```
# Available Predicates
...
...
@@ -48,6 +50,7 @@ foreign(initAndBuildModel, c, initAndBuildModelI( +string,
```
### Parameters
| Name | Type | Description | Default |
|------|------|-------------|---------|
| treeType | +string | "gini-hoeffding", "gini-binary", "info-hoeffding", "info-binary" | gini-binary |
...
...
@@ -85,6 +88,7 @@ foreign(classify, c, classifyI( +pointer(float_array), +integer, +integer,
```
### Parameters
| Name | Type | Description | Default |
|------|------|-------------|---------|
| data | +matrix | Points to classify. | - |
...
...
@@ -113,6 +117,7 @@ foreign(train, c, trainI( +pointer(float_array), +integer, +integer,
```
### Parameters
| Name | Type | Description | Default |
|------|------|-------------|---------|
| data | +matrix | Dataset to train on. | - |
...
...
...
...