Description Usage Arguments Details Value Author(s) See Also Examples
The Modeler-class
represents (parametrized but not yet
fit) statistical models that can predict binary outcomes. The
Modeler
function is used to construct objects of this class.
1 |
learn |
Object of class |
predict |
Object of class |
... |
Additional parameters required for the specific kind of classificaiton model that will be constructed. See Details. |
Objects of the Modeler-class
provide a general
abstraction for classification models that can be learned from one
data set and then applied to a new data set. Each type of classifier
is likely to have its own specific parameters. For instance, a
K-nearest neighbors classifier requires you to specify k
. The
more complex classifier, PCA-LR has many more parameters, including
the false discovery rate (alpha
) used to select features and
the percentage of variance (perVar
) that should be explained by
the number of principal components created from those features. All
additional parameters should be suplied as named arguments to the
Modeler
constructor; these additional parameters will be
bundled into a list and inserted into the params
slot of the
resulting object of the Modeler-class
.
Returns an object of the Modeler-class
.
Kevin R. Coombes <krc@silicovore.com>
See the descriptions of the learn
function and
the predict
method for details on how to fit models on
training data and make predictions on new test data.
See the description of the FittedModel-class
for details
about the kinds of objects produced by learn
.
1 2 3 4 | learnNNET
predictNNET
modelerNNET <- Modeler(learnNNET, predictNNET, size=5)
modelerNNET
|
Loading required package: ClassDiscovery
Loading required package: cluster
Loading required package: oompaBase
Loading required package: ClassComparison
function (data, status, params, pfun)
{
tdata <- data.frame(Stat = status, t(data))
arglist <- c(list(formula = Stat ~ ., data = tdata), params)
model <- do.call(nnet, arglist)
FittedModel(pfun, data, status, details = list(model = model))
}
<environment: namespace:Modeler>
function (newdata, details, status, ...)
{
predict(details$model, t(newdata), ...)
}
<environment: namespace:Modeler>
An object of class "Modeler"
Slot "learnFunction":
function (data, status, params, pfun)
{
tdata <- data.frame(Stat = status, t(data))
arglist <- c(list(formula = Stat ~ ., data = tdata), params)
model <- do.call(nnet, arglist)
FittedModel(pfun, data, status, details = list(model = model))
}
<environment: namespace:Modeler>
Slot "predictFunction":
function (newdata, details, status, ...)
{
predict(details$model, t(newdata), ...)
}
<environment: namespace:Modeler>
Slot "paramList":
$size
[1] 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.