model.interface-class | R Documentation |
This class provides unified interface for calls/objects of
statistical/machine learning models.
model.adapter-class{model.adapter}
internally using object
of this class to get information from model calls/objects.
get.family(x, type = c("character", "family"), envir)
Get family from the model.
x
call or model object.
type = c("character", "family")
a character literal specifying the type of data returned.
If "character", this returns character vector of family name.
If "family", this returns family
object.
For some family specific for certain model (e.g., categorical
family of MCMCglmm), their family object is not implimented.
For such family, this method raise stop error.
envir
environment where x is evaluated.
get.call(x)
This method returns call by which the object is made. If call is not available, this returns NULL. To distinguish the returned value of NULL is intended action or not, inherited classes are encouraged to inherit this method to explicitly return NULL if x does not have call.
x
call or model object.
get.data(x, envir, package = "", ...)
Get a data.frame containing the data used for modeling. If data is not available this method returns NULL.
x
a model object/call from which data is extracted.
envir
an environment in which call is evaluated.
get.formula(x, envir, package = "")
Extract formula from model object/call.
If couldn't retrieve formula from x
, this method returns NULL.
x
a model object/call from which formula is extracted.
envir
an environment in which call in x is evaluated.
package
name of the package having the modeling function.
expand.formula(f, d, specials = NULL, package = NULL)
Expand . in formula.
f
a formula to expand.
d
a data.frame used to expand . in formula.
specials = NULL
special characterss passed to
terms.formula
.
package = NULL
a character literal of package name having the model function.
predict(object, newdata, type, random, ...)
Calculate predictions.
object
a model object used for prediction.
newdata
a data.frame containing data used for prediction.
type
the type of prediciton. This should be a type specific for each modeling functions.
random = ~0
the random effect to use. Tentatively, ~0 means don't use random effects.
...
other variables passed to predict methods.
get.link(x, envir)
Get link function. If the model does not have link function, this
function returns identity
function.
x
an object of statistical model or a call of model function.
envir
an environment where call in x
is evaluated.
get.linkinv(x, envir)
Get inverse function of link function. If the model does not have
link function, this function returns identity
function.
x
an object of statistical model or a call of model function.
envir
an environment where call in x
is evaluated.
get.model.type(x, envir, package = "", ...)
Return a character vector specifying model type (regression or classification). If the model is regression model, it returns 'regression'. If the model is classification model, it returns 'classification'.
x
an object of statistical model or a call of model function.
envir
an environment where call in x
is evaluated.
has.offset.argument(x, envir, package = "")
Check whether the model has offset argument.
x
an object of statistical model or a call of model function.
envir
an environment where call in x
is evaluated.
package = NULL
a character literal of package name having the model function.
has.offset.in.formula(x, envir, package = "")
Check whether the model has offset term(s) in formula.
x
an object of statistical model or a call of model function.
envir
an environment where formula and data in x
is evaluated.
package = NULL
a character literal of package name having the model function.
predict.types
a named character vector representing the conversion table of shared type of prediction used for predict() method. Currently, this vector has four elements named "response", "link", "prob" and "class" and each element represents compatible type of character for the model.
new()
model.interface.default.class$new(...)
get.family()
model.interface.default.class$get.family( x, type = c("character", "family"), envir )
get.call()
model.interface.default.class$get.call(x)
get.data()
model.interface.default.class$get.data(x, envir, package = "", ...)
get.formula()
model.interface.default.class$get.formula(x, envir, package = "")
expand.formula()
model.interface.default.class$expand.formula( f, d, specials = NULL, package = NULL )
predict()
model.interface.default.class$predict(object, newdata, type, random, ...)
get.link()
model.interface.default.class$get.link(x, envir)
get.linkinv()
model.interface.default.class$get.linkinv(x, envir)
get.model.type()
model.interface.default.class$get.model.type(x, envir, package = "", ...)
get.offset.names()
model.interface.default.class$get.offset.names(x, envir, package = "")
adjust.offset()
model.interface.default.class$adjust.offset( x, envir, package, pred, newdata, type, divide.by.mean = TRUE )
clone()
The objects of this class are cloneable with this method.
model.interface.default.class$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.