AdaBoostRegressor
¶
Ada Boost regression.
Parent type: Regressor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
learner |
Regressor |
The learner from which the boosted ensemble is built. | DecisionTreeRegressor() |
maxLearnerCount |
Int |
The maximum number of learners at which boosting is terminated. In case of perfect fit, the learning procedure is stopped early. Has to be greater than 0. | 50 |
learningRate |
Float |
Weight applied to each regressor at each boosting iteration. A higher learning rate increases the contribution of each regressor. Has to be greater than 0. | 1.0 |
Examples:
pipeline example {
val training = Table.fromCsvFile("training.csv").toTabularDataset("target");
val test = Table.fromCsvFile("test.csv").toTabularDataset("target");
val regressor = AdaBoostRegressor(maxLearnerCount = 100).fit(training);
val meanSquaredError = regressor.meanSquaredError(test);
}
Stub code in AdaBoostRegressor.sdsstub
isFitted
¶
Whether the model is fitted.
Type: Boolean
learner
¶
The base learner used for training the ensemble.
Type: Regressor
learningRate
¶
The learning rate.
Type: Float
maxLearnerCount
¶
The maximum number of learners in the ensemble.
Type: Int
coefficientOfDetermination
¶
Compute the coefficient of determination (R²) of the regressor on the given data.
The coefficient of determination compares the regressor's predictions to another model that always predicts the mean of the target values. It is a measure of how well the regressor explains the variance in the target values.
The higher the coefficient of determination, the better the regressor. Results range from negative infinity to 1.0. You can interpret the coefficient of determination as follows:
R² | Interpretation |
---|---|
1.0 | The model perfectly predicts the target values. Did you overfit? |
(0.0, 1.0) | The model is better than predicting the mean of the target values. You should be here. |
0.0 | The model is as good as predicting the mean of the target values. Try something else. |
(-∞, 0.0) | The model is worse than predicting the mean of the target values. Something is very wrong. |
Notes:
- The model must be fitted.
- Some other libraries call this metric
r2_score
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
validationOrTestSet |
union<Table, TabularDataset> |
The validation or test set. | - |
Results:
Name | Type | Description |
---|---|---|
coefficientOfDetermination |
Float |
The coefficient of determination of the regressor. |
Stub code in Regressor.sdsstub
fit
¶
Create a copy of this regressor and fit it with the given training data.
This regressor is not modified.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
trainingSet |
TabularDataset |
The training data containing the feature and target vectors. | - |
Results:
Name | Type | Description |
---|---|---|
fittedRegressor |
AdaBoostRegressor |
The fitted regressor. |
Stub code in AdaBoostRegressor.sdsstub
getFeatureNames
¶
Return the names of the feature columns.
Note: The model must be fitted.
Results:
Name | Type | Description |
---|---|---|
featureNames |
List<String> |
The names of the feature columns. |
Stub code in SupervisedModel.sdsstub
getFeaturesSchema
¶
Return the schema of the feature columns.
Note: The model must be fitted.
Results:
Name | Type | Description |
---|---|---|
featureSchema |
Schema |
The schema of the feature columns. |
Stub code in SupervisedModel.sdsstub
getTargetName
¶
Return the name of the target column.
Note: The model must be fitted.
Results:
Name | Type | Description |
---|---|---|
targetName |
String |
The name of the target column. |
Stub code in SupervisedModel.sdsstub
getTargetType
¶
Return the type of the target column.
Note: The model must be fitted.
Results:
Name | Type | Description |
---|---|---|
targetType |
ColumnType |
The type of the target column. |
Stub code in SupervisedModel.sdsstub
meanAbsoluteError
¶
Compute the mean absolute error (MAE) of the regressor on the given data.
The mean absolute error is the average of the absolute differences between the predicted and expected target values. The lower the mean absolute error, the better the regressor. Results range from 0.0 to positive infinity.
Note: The model must be fitted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
validationOrTestSet |
union<Table, TabularDataset> |
The validation or test set. | - |
Results:
Name | Type | Description |
---|---|---|
meanAbsoluteError |
Float |
The mean absolute error of the regressor. |
Stub code in Regressor.sdsstub
meanDirectionalAccuracy
¶
Compute the mean directional accuracy (MDA) of the regressor on the given data.
This metric compares two consecutive target values and checks if the predicted direction (down/unchanged/up) matches the expected direction. The mean directional accuracy is the proportion of correctly predicted directions. The higher the mean directional accuracy, the better the regressor. Results range from 0.0 to 1.0.
This metric is useful for time series data, where the order of the target values has a meaning. It is not useful
for other types of data. Because of this, it is not included in the summarize_metrics
method.
Note: The model must be fitted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
validationOrTestSet |
union<Table, TabularDataset> |
The validation or test set. | - |
Results:
Name | Type | Description |
---|---|---|
meanDirectionalAccuracy |
Float |
The mean directional accuracy of the regressor. |
Stub code in Regressor.sdsstub
meanSquaredError
¶
Compute the mean squared error (MSE) of the regressor on the given data.
The mean squared error is the average of the squared differences between the predicted and expected target values. The lower the mean squared error, the better the regressor. Results range from 0.0 to positive infinity.
Notes:
- The model must be fitted.
- To get the root mean squared error (RMSE), take the square root of the result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
validationOrTestSet |
union<Table, TabularDataset> |
The validation or test set. | - |
Results:
Name | Type | Description |
---|---|---|
meanSquaredError |
Float |
The mean squared error of the regressor. |
Stub code in Regressor.sdsstub
medianAbsoluteDeviation
¶
Compute the median absolute deviation (MAD) of the regressor on the given data.
The median absolute deviation is the median of the absolute differences between the predicted and expected target values. The lower the median absolute deviation, the better the regressor. Results range from 0.0 to positive infinity.
Note: The model must be fitted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
validationOrTestSet |
union<Table, TabularDataset> |
The validation or test set. | - |
Results:
Name | Type | Description |
---|---|---|
medianAbsoluteDeviation |
Float |
The median absolute deviation of the regressor. |
Stub code in Regressor.sdsstub
predict
¶
Predict the target values on the given dataset.
Note: The model must be fitted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset |
union<Table, TabularDataset> |
The dataset containing at least the features. | - |
Results:
Name | Type | Description |
---|---|---|
prediction |
TabularDataset |
The given dataset with an additional column for the predicted target values. |
Stub code in SupervisedModel.sdsstub
summarizeMetrics
¶
Summarize the regressor's metrics on the given data.
Note: The model must be fitted.
API Stability
Do not rely on the exact output of this method. In future versions, we may change the displayed metrics without prior notice.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
validationOrTestSet |
union<Table, TabularDataset> |
The validation or test set. | - |
Results:
Name | Type | Description |
---|---|---|
metrics |
Table |
A table containing the regressor's metrics. |