Description Usage Arguments Value Author(s) See Also Examples
View source: R/tdmRegressLoop.r
tdmRegressLoop contains a double loop (opts$NRUN and CV-folds)
and calls tdmRegress
. It is called by all R-functions main_*.
It returns an object of class TDMregressor
.
1 | tdmRegressLoop(dset, response.variables, input.variables, opts, tset = NULL)
|
dset |
the data frame for which cvi is needed |
response.variables |
name of column which carries the target variable - or - vector of names specifying multiple target columns (these columns are not used during prediction, only for training and for evaluating the predicted result) |
input.variables |
vector with names of input columns |
opts |
a list from which we need here the following entries
|
tset |
[NULL] If not NULL, this is the test data set. If NULL, we are in tuning and the validation data
set is build from |
result
, an object of class TDMregressor
, this is a list with results, containing
opts |
the res$opts from |
lastRes |
last run, last fold: result from |
R_train |
RMAE / RMSE on training set (vector of length NRUN), depending on opts$rgain.type=="rmae" or "rmse" |
S_train |
RMSE on training set (vector of length NRUN) |
T_train |
Theil's U for RMAE on training set (vector of length NRUN) |
*_test |
— similar, with test set instead of training set — |
Err |
a data frame with as many rows as opts$NRUN and columns = (rmae.trn, rmse.trn made.trn, rmae.theil.trn, ntrn, rmae.tst, rmse.tst, made.tst, rmae.theil.tst, ntst) |
predictions |
last run: data frame with dimensions [nrow(dset),length(response.variable)]. In case of CV, all validation set predictions (for each record in dset), in other cases mixed validation / train set predictions. |
predictTest |
predictions on the test set |
Wolfgang Konen (wolfgang.konen@th-koeln.de), THK
tdmRegress
, tdmClassifyLoop
, tdmClassify
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #*# --------- demo/demo00-1regress.r ---------
#*# This demo shows a simple data mining process (phase 1 of TDMR) for regression on
#*# dataset iris.
#*# The data mining process in tdmRegressLoop calls randomForest as the prediction model.
#*# It is called opts$NRUN=2 times with different random train-validation set splits.
#*# Therefore data frame result$Err has 2 rows.
#*#
opts=tdmOptsDefaultsSet() # set all defaults for data mining process
gdObj <- tdmGraAndLogInitialize(opts); # init graphics and log file
data(iris)
response.variables="Petal.Length" # names, not data (!)
input.variables=setdiff(names(iris),"Petal.Length")
opts$rgain.type="rmae"
result = tdmRegressLoop(iris,response.variables,input.variables,opts)
print(result$Err)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.