predict.bagging.model {PivotalR} | R Documentation |
generic.bagging
Make predictions using boostrap aggregating models
## S3 method for class 'bagging.model' predict(object, newdata, combine = "mean", ...)
object |
A |
newdata |
A |
combine |
A string, default is |
... |
Extra parameters. Not implemented yet. |
A db.Rquery
object, which contains the SQL query
to compute the prediction. One can use the function lk
to look at the values.
Author: Predictive Analytics Team at Pivotal Inc.
Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io
generic.bagging
generates the models of boostrap
aggregating.
predict.lm.madlib
and
predict.logregr.madlib
produce predictions for linear
and logistic models.
## Not run: ## set up the database connection ## Assume that .port is port number and .dbname is the database name cid <- db.connect(port = .port, dbname = .dbname, verbose = FALSE) y <- as.db.data.frame(abalone, conn.id = cid, verbose = FALSE) fit <- generic.bagging(function(data) { madlib.lm(rings ~ . - id - sex, data = data) }, data = y, nbags = 25, fraction = 0.7) pred <- predict(fit, newdata = y) # make prediction lookat(mean((y$rings - pred)^2)) # mean squared error db.disconnect(cid, verbose = FALSE) ## End(Not run)