Wrapper for Several Model Functions
FitMod.RdPopular implementations of algorithms are characterized by partly unconventional implementations of the operating standards in R. For example, the function e1071::SVM() returns the predicted values as attributes! FitMod() is designed as a wrapping function to offer a consistent interface for a selection of most often used classification and regression models.
Arguments
- x
a fitted object of class
"FitMod".- formula
a formula expression as for classification and regression models, of the form
response ~ predictors. The response should be a factor or a matrix with K columns, which will be interpreted as counts for each of K classes. See the documentation offormula()for other details.- data
an optional data frame in which to interpret the variables occurring in formula.
- subset
expression saying which subset of the rows of the data should be used in the fit. All observations are included by default.
- na.action
a function to filter missing data.
- fitfn
code for the fitting function to be used for regression or classifying. So far implemented are:
lm,lmrob,poisson,quasipoisson,gamma,negbin,poisson,polr,tobit,zeroinfl,multinom,poisson,rpart,randomForest,logit,nnet,C5.0,lda,qda,svm,naive_bayes,lb.- object
the model object.
- ...
further arguments passed to the underlying functions.
Details
The function will in general return the original object, extended by a further class FitMod, which allows to capture the output and plot routines.
The classifying algorithms will at the minimum offer the predicting options type = c("class", "prob") additionally to those implemented by the underlying function.