Changes
Page history
Update decision_tree
authored
Nov 18, 2022
by
Dean Samuel Schmitz
Show whitespace changes
Inline
Side-by-side
PrologMethods/Classification/decision_tree.md
View page @
02f5d3e3
...
...
@@ -2,18 +2,26 @@
An implementation of an ID3-style decision tree for classification.
```
prolog
:-
use_module
(
'path/to/.../src/methods/adaboost/adaboost_test.pl'
).
%% usage example
adaboost_initModelWithTraining
([
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
,
0
,
1
,
0
],
2
,
perceptron
,
50
,
0.0001
),
adaboost_classify
([
3
,
2
,
0
,
5
,
1
,
4
,
0
,
0
,
4
,
3
,
3
,
5
,
0
,
5
,
5
,
2
,
5
,
5
],
3
,
PredictionList
,
ProbabilitiesList
,
_
).
```
# Available Predicates
*
[
initModel/
9
](
https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#initmodel
9
)
*
[
classifyPoint/
5
](
https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#classifypoint
5
)
*
[
classifyMatrix/
7
](
https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#classifymatrix
7
)
*
[
train/
10
](
https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#train
10
)
*
[
decision_tree_
initModel/
7
](
https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#
decision_tree_
initmodel
7
)
*
[
decision_tree_
classifyPoint/
3
](
https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#
decision_tree_
classifypoint
3
)
*
[
decision_tree_
classifyMatrix/
5
](
https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#
decision_tree_
classifymatrix
5
)
*
[
decision_tree_
train/
8
](
https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#
decision_tree_
train
8
)
---
[
links/resources
](
https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#connected-linksresources
)
## **_initModel/
9
_**
## **_
decision_tree_
initModel/
7
_**
Construct the decision tree on the given data and labels, assuming that the data is all of the numeric type.
...
...
@@ -27,6 +35,7 @@ initModel( +pointer(float_array), +integer, +integer,
```
### Parameters
| Name | Type | Description | Default |
|------|------|-------------|---------|
| dataset | +matrix | Training dataset | - |
...
...
@@ -38,7 +47,7 @@ initModel( +pointer(float_array), +integer, +integer,
---
## **_classifyPoint/
5
_**
## **_
decision_tree_
classifyPoint/
3
_**
Classify the given point and also return estimates of the probability for each class in the given vector.
...
...
@@ -50,6 +59,7 @@ classifyPoint( +pointer(float_array), +integer,
```
### Parameters
| Name | Type | Description | Default |
|------|------|-------------|---------|
| point | +vector | Point to classify. | - |
...
...
@@ -58,7 +68,7 @@ classifyPoint( +pointer(float_array), +integer,
---
## **_classifyMatrix/
7
_**
## **_
decision_tree_
classifyMatrix/
5
_**
Classify the given points and also return estimates of the probabilities for each class in the given matrix.
...
...
@@ -70,6 +80,7 @@ classifyMatrix( +pointer(float_array), +integer, +integer,
```
### Parameters
| Name | Type | Description | Default |
|------|------|-------------|---------|
| data | +matrix | Set of points to classify. | - |
...
...
@@ -78,7 +89,7 @@ classifyMatrix( +pointer(float_array), +integer, +integer,
---
## **_train/
10
_**
## **_
decision_tree_
train/
8
_**
Train the decision tree on the given data, assuming that all dimensions are numeric.
...
...
@@ -93,6 +104,7 @@ train( +pointer(float_array), +integer, +integer,
```
### Parameters
| Name | Type | Description | Default |
|------|------|-------------|---------|
| dataset | +matrix | Training dataset | - |
...
...
@@ -109,8 +121,8 @@ train( +pointer(float_array), +integer, +integer,
If you want a more detailed explanation, then go to the python documentation. There is most of the time a good explanation on how the methods work and what the parameters do.
*
[
**MLpack::decision_tree_C++\_documentation**
](
https://www.mlpack.org/doc/
stable
/doxygen/classmlpack_1_1tree_1_1DecisionTree.html
)
*
[
**MLpack::decision_tree_Python_documentation**
](
https://www.mlpack.org/doc/
stable
/python_documentation.html#decision_tree
)
*
[
**MLpack::decision_tree_C++\_documentation**
](
https://www.mlpack.org/doc/
mlpack-3.4.2
/doxygen/classmlpack_1_1tree_1_1DecisionTree.html
)
*
[
**MLpack::decision_tree_Python_documentation**
](
https://www.mlpack.org/doc/
mlpack-3.4.2
/python_documentation.html#decision_tree
)
added some of the links from the python documentation
...
...
...
...