... | @@ -2,18 +2,26 @@ |
... | @@ -2,18 +2,26 @@ |
|
|
|
|
|
An implementation of an ID3-style decision tree for classification.
|
|
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
|
|
# Available Predicates
|
|
|
|
|
|
* [initModel/9](https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#initmodel9)
|
|
* [decision_tree_initModel/7](https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#decision_tree_initmodel7)
|
|
* [classifyPoint/5](https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#classifypoint5)
|
|
* [decision_tree_classifyPoint/3](https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#decision_tree_classifypoint3)
|
|
* [classifyMatrix/7](https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#classifymatrix7)
|
|
* [decision_tree_classifyMatrix/5](https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#decision_tree_classifymatrix5)
|
|
* [train/10](https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#train10)
|
|
* [decision_tree_train/8](https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#decision_tree_train8)
|
|
|
|
|
|
---
|
|
---
|
|
|
|
|
|
[links/resources](https://gitlab.cs.uni-duesseldorf.de/stups/abschlussarbeiten/prolog-mlpack-libary/-/wikis/PrologMethods/Classification/decision_tree#connected-linksresources)
|
|
[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.
|
|
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, |
... | @@ -27,6 +35,7 @@ initModel( +pointer(float_array), +integer, +integer, |
|
```
|
|
```
|
|
|
|
|
|
### Parameters
|
|
### Parameters
|
|
|
|
|
|
| Name | Type | Description | Default |
|
|
| Name | Type | Description | Default |
|
|
|------|------|-------------|---------|
|
|
|------|------|-------------|---------|
|
|
| dataset | +matrix | Training dataset | - |
|
|
| dataset | +matrix | Training dataset | - |
|
... | @@ -38,7 +47,7 @@ initModel( +pointer(float_array), +integer, +integer, |
... | @@ -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.
|
|
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, |
... | @@ -50,6 +59,7 @@ classifyPoint( +pointer(float_array), +integer, |
|
```
|
|
```
|
|
|
|
|
|
### Parameters
|
|
### Parameters
|
|
|
|
|
|
| Name | Type | Description | Default |
|
|
| Name | Type | Description | Default |
|
|
|------|------|-------------|---------|
|
|
|------|------|-------------|---------|
|
|
| point | +vector | Point to classify. | - |
|
|
| point | +vector | Point to classify. | - |
|
... | @@ -58,7 +68,7 @@ classifyPoint( +pointer(float_array), +integer, |
... | @@ -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.
|
|
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, |
... | @@ -70,6 +80,7 @@ classifyMatrix( +pointer(float_array), +integer, +integer, |
|
```
|
|
```
|
|
|
|
|
|
### Parameters
|
|
### Parameters
|
|
|
|
|
|
| Name | Type | Description | Default |
|
|
| Name | Type | Description | Default |
|
|
|------|------|-------------|---------|
|
|
|------|------|-------------|---------|
|
|
| data | +matrix | Set of points to classify. | - |
|
|
| data | +matrix | Set of points to classify. | - |
|
... | @@ -78,7 +89,7 @@ classifyMatrix( +pointer(float_array), +integer, +integer, |
... | @@ -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.
|
|
Train the decision tree on the given data, assuming that all dimensions are numeric.
|
|
|
|
|
... | @@ -93,6 +104,7 @@ train( +pointer(float_array), +integer, +integer, |
... | @@ -93,6 +104,7 @@ train( +pointer(float_array), +integer, +integer, |
|
```
|
|
```
|
|
|
|
|
|
### Parameters
|
|
### Parameters
|
|
|
|
|
|
| Name | Type | Description | Default |
|
|
| Name | Type | Description | Default |
|
|
|------|------|-------------|---------|
|
|
|------|------|-------------|---------|
|
|
| dataset | +matrix | Training dataset | - |
|
|
| dataset | +matrix | Training dataset | - |
|
... | @@ -109,8 +121,8 @@ train( +pointer(float_array), +integer, +integer, |
... | @@ -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.
|
|
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_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/stable/python_documentation.html#decision_tree)
|
|
* [**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
|
|
added some of the links from the python documentation
|
|
|
|
|
... | | ... | |