predict.ENNreg {evreg}R Documentation

Prediction method for the ENNreg model

Description

Predicted values based on a trained ENNreg model (object of class "ENNreg").

Usage

## S3 method for class 'ENNreg'
predict(object, newdata, yt = NULL, ...)

Arguments

object

An object of type "ENNreg"

newdata

Input matrix of attributes for test data

yt

Optional test response vector

...

Further arguments passed to or from other methods

Value

Predictions for the new data, coded as a list with the following components:

mux

Predicted means

sigx

Predicted standard deviations.

hx

Prediction precisions.

Einf

Lower expectation.

Esup

Upper expectations

NLL

Negative log likelihood (computed only if yt is provided).

RMS

Root mean squared error (computed only if yt is provided).

See Also

ENNreg, ENNreg_init

Examples

# Boston dataset

library(MASS)
X<-as.matrix(scale(Boston[,1:13]))
y<-Boston[,14]
set.seed(220322)
n<-nrow(Boston)
ntrain<-round(0.7*n)
train <-sample(n,ntrain)
fit <- ENNreg(X[train,],y[train],K=30)
pred<-predict(fit,newdata=X[-train,],yt=y[-train])
plot(y[-train],pred$mux,xlab="observed response",ylab="predicted response")



[Package evreg version 1.1.1 Index]