predict.IBHM: predict.IBHM

Description Usage Arguments Value See Also Examples

View source: R/ibhm.R

Description

Predicted values based on IBHM model object.

Usage

1
2
## S3 method for class 'IBHM'
predict(object, x, ...)

Arguments

object

Object of class inheriting from "ibhm"

x

An object for which the predictions will be calculated - should be convertible to a matrix. If not given the values from the training data are used.

...

Further arguments.

Value

predict.IBHM returns a vector of predicted values with length corresponding to the number of rows of the x parameter.

See Also

TrainIBHM

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  x.train <-seq(-2,2,length.out=100)
  y.train <-tanh(x.train)
  
  m <- IBHM::TrainIBHM(x.train,y.train)  
  cat('Train MSE:',mean((y.train-predict(m))^2),'\n')
  
  x.test <- runif(100, min=-4, max=4)
  yh.test <- predict(m, x.test)
    
  plot(x.test, yh.test)

IBHM documentation built on May 30, 2017, 4:32 a.m.