signature(object = "model"): describe this method here
Arguments
object: a model object created by fit
newdata: a data frame or matrix containing new data
Details
Returns predictions for a fit model. Note: the ... optional argument is currently only used by cubist model (see example).
Returns
If task is prob returns a matrix, where each column is the class probability.
If task is class returns a factor.
If task is reg returns a numeric vector.
See Also
fit, mining, mgraph, mmetric, savemining, CasesSeries, lforecast and Importance.
References
To check for more details about rminer and for citation purposes:
P. Cortez.
Data Mining with Neural Networks and Support Vector Machines Using the R/rminer Tool.
In P. Perner (Ed.), Advances in Data Mining - Applications and Theoretical Aspects 10th Industrial Conference on Data Mining (ICDM 2010), Lecture Notes in Artificial Intelligence 6171, pp. 572-583, Berlin, Germany, July, 2010. Springer. ISBN: 978-3-642-14399-1.
A tutorial on using the rminer R package for data mining tasks.
Teaching Report, Department of Information Systems, ALGORITMI Research Centre, Engineering School, University of Minho, Guimaraes, Portugal, July 2015.
### simple classification example with logistic regressiondata(iris)M=fit(Species~.,iris,model="lr")P=predict(M,iris)print(mmetric(iris$Species,P,"CONF"))# confusion matrix### simple regression exampledata(sa_ssin)H=holdout(sa_ssin$y,ratio=0.5,seed=12345)Y=sa_ssin[H$ts,]$y # desired test set# fit multiple regression on training data (half of samples)M=fit(y~.,sa_ssin[H$tr,],model="mr")# multiple regressionP1=predict(M,sa_ssin[H$ts,])# predictions on test setprint(mmetric(Y,P1,"MAE"))# mean absolute error### fit cubist modelM=fit(y~.,sa_ssin[H$tr,],model="cubist")#P2=predict(M,sa_ssin[H$ts,],neighbors=3)#print(mmetric(Y,P2,"MAE"))# mean absolute errorP3=predict(M,sa_ssin[H$ts,],neighbors=7)#print(mmetric(Y,P3,"MAE"))# mean absolute error### check fit for more examples