predict.TDMenvir: Make a prediction using the last model.

Description Usage Arguments Value Examples

View source: R/tdmGeneralUtils.r

Description

Make a prediction with objects of class TDMenvir, TDMclassifier, TDMregressor. The prediction is based on the (last) model trained during unbiasedRun.

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'TDMenvir'
predict(object, ...)

## S3 method for class 'TDMclassifier'
predict(object, ...)

## S3 method for class 'TDMregressor'
predict(object, ...)

Arguments

object

an object of class TDMenvir, TDMclassifier, TDMregressor containing in element lastModel the relevant model.

...

arguments passed on to the model's predict function. Usually the first argument of ... should be newdata, a data frame for which new predictions are desired.

Value

a vector with length nrow(newdata) containing the new predictions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
   ## Not run: 
   ## This example requires that demo04cpu.r is executed first (it will write demo04cpu.RData)
   path <- paste(find.package("TDMR"), "demo01cpu/",sep="/");
   tdm <- list(  filenameEnvT="demo04cpu.RData" );   # file with environment envT 
   load(paste(path,tdm$filenameEnvT,sep="/"));
              
   # take only the first 15 records:
   newdata=read.csv2(file=paste(path,"data/cpu.csv", sep=""), dec=".")[1:15,];     
   z=predict(envT,newdata);
   print(z);
   
## End(Not run)

TDMR documentation built on March 3, 2020, 1:06 a.m.