AdaBoost
An implementation of the AdaBoost MH (Adaptive Boosting) algorithm for classification.
%% kleines Nutzung Beispiel
Available Predicates
- initModelWithTraining/9
- initModelNoTraining/2
- classify/8
- numClasses/1
- getTolerance/1
- modifyTolerance/1
- train10
initModelWithTraining/9
Needs to be called first before all other predicates exept initModelNoTraining!
Initiates the Adaboostmodel and trains it, so classify can be used immediately.
initModelWithTraining( +pointer(float_array), +integer, +integer,
+pointer(float_array), +integer,
+integer,
+string,
+integer , +float32).
Parameters
Name | Type | Description | Default |
---|---|---|---|
data | +matrix | Dataset for training AdaBoost | - |
labels | +vector | Labels for the training set | - |
numClasses | +integer | The number of classes to classify data into | - |
learner | +string | The type of weak learner to use: “decision_stump”, or “perceptron” | “decision_stump” |
iterations | +integer | The maximum number of boosting iterations to be run (0 will run until convergence.) | 100 |
tolerance | +float | The tolerance for change in values of the weighted error during training | 1e-6 |
initModelNoTraining/2
Needs to be called first before all other predicates exept initModelWithTraining!
%% part of the predicate definition
initModelNoTraining(+string, +float32).
Parameters
Name | Type | Description | Default |
---|---|---|---|
tolerance | +float | The tolerance for change in values of the weighted error during training | 1e-6 |
learner | +string | The type of weak learner to use: “decision_stump”, or “perceptron” | “decision_stump” |
classify/8
Classifies the given data into the number of classes the model was trained for.
%% part of the predicate definition
classify( +pointer(float_array), +integer, +integer,
-pointer(float_array), -integer,
-pointer(float_array), -integer, -integer).
Parameters
Name | Type | Description | Default |
---|---|---|---|
test | +matrix | Test dataset | - |
predictions | -vector | Predicted labels for the test set | - |
probabilities | -matrix | Predicted class probabilities for each point in the test set | - |
numClasses/1
Returns the amount of classes defined in the model for classification.
%% part of the predicate definition
numClasses([-integer]).
Parameters
Name | Type | Description | Default |
---|---|---|---|
classesNum | -integer | Number of classes | - |
getTolerance/1
%% part of the predicate definition
getTolerance([-float32]).
Parameters
Name | Type | Description | Default |
---|---|---|---|
tolerance | -float32 | returns the current tolerance | - |
modifyTolerance/1
Modifies the tolerance of the model.
%% part of the predicate definition
modifyTolerance(+float32).
Parameters
Name | Type | Description | Default |
---|---|---|---|
tolerance | +float32 | changes the tolerance | 1e-6 |
train/10
Kurze beschreibung mit evt. hinweisen
%% part of the predicate definition
train( +pointer(float_array), +integer, +integer,
+pointer(float_array), +integer,
+integer,
+string,
+integer , +float32,
[-float32]).
Parameters
Name | Type | Description | Default |
---|---|---|---|
data | +matrix | Dataset for training AdaBoost | - |
labels | +vector | Labels for the training set | - |
numClasses | +integer | The number of classes to classify data into | - |
learner | +string | The type of weak learner to use: “decision_stump”, or “perceptron” | “decision_stump” |
iterations | +integer | The maximum number of boosting iterations to be run (0 will run until convergence.) | 100 |
tolerance | +float | The tolerance for change in values of the weighted error during training | 1e-6 |
error | -float | double upper bound training error | - |
Connected Links/Resources
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 about what the parameters do.
added some of the links from the python documentation