predict.osnnet: Predict New Examples Based on Observation Specific Neural...

Description Usage Arguments Details Value See Also

View source: R/osnnet.R

Description

Predict new examples in conjunction with osnnet.

Usage

1
2
3
  ## S3 method for class 'osnnet'
 predict(object, newdata,
    type = c("raw", "class"), ...)

Arguments

object

Object of class "osnnet".

newdata

A data.frame of cases to be classified or, if object has a formula, a data.frame with columns of the same names as the variables used. A vector will be interpreted as a row vector. If newdata is missing, an attempt will be made to retrieve the data used in osnnet.

type

Type of output.

...

Arguments passed to or from other methods.

Details

This function is a method for the generic function predict() for class "osnnet". It can be invoked by calling predict(x) for an object x of the appropriate class, or directly by calling predict.osnnet(x) regardless of the class of the object.

If the response in formula is a factor, appropriate classification networks are constructed; these have one output and entropy fit if the number of levels is two, and a number of outputs equal to the number of classes and a softmax output stage for more levels. If the response is not a factor, it is passed on unchanged to predict.osnnet.

Optimization is done via the BFGS method of optim.

Value

If type = "raw", the matrix of values returned by the trained network; if type = "class", the corresponding class (which is probably only useful if the net was generated by osnnet.formula).

See Also

osnnet, predict.nnet, nnet.


locClass documentation built on May 2, 2019, 5:21 p.m.