Cubist (version 0.0.19)

predict.cubist: Predict method for cubist fits

Description

Predicted values based on a cubist object.

Usage

# S3 method for cubist
predict(object, newdata = NULL, neighbors = 0, ...)

Arguments

object

an object of class cubist

newdata

a data frame of predictors (in the same order as the original training data)

neighbors

an integer from 0 to 9: how many instances to use to correct the rule-based prediction?

other options to pass through the function (not currently used)

Value

a numeric vector is returned

Details

Prediction using the parametric model are calculated using the method of Quinlan (1992). If neighbors is greater than zero, these predictions are adjusted by training set instances nearby using the approach of Qunilan (1993).

References

Quinlan. Learning with continuous classes. Proceedings of the 5th Australian Joint Conference On Artificial Intelligence (1992) pp. 343-348

Quinlan. Combining instance-based and model-based learning. Proceedings of the Tenth International Conference on Machine Learning (1993) pp. 236-243

Quinlan. C4.5: Programs For Machine Learning (1993) Morgan Kaufmann Publishers Inc. San Francisco, CA

http://rulequest.com/cubist-info.html

See Also

cubist, cubistControl, summary.cubist, predict.cubist, dotplot.cubist

Examples

Run this code
# NOT RUN {
library(mlbench)
data(BostonHousing)

## 1 committee and no instance-based correction, so just an M5 fit:
mod1 <- cubist(x = BostonHousing[, -14], y = BostonHousing$medv)
predict(mod1, BostonHousing[1:4, -14])

## now add instances
predict(mod1, BostonHousing[1:4, -14], neighbors = 5)

# }

Run the code above in your browser using DataCamp Workspace