Learn R Programming

randomUniformForest (version 1.1.0)

init_values: Training and validation samples from data

Description

Draw training and test samples from data. Samples can be accessed by subsctioting original data or by their own references.

Usage

init_values(X, Y = NULL, sample.size = 0.5, 
data.splitting = "ALL", 
unit.scaling = FALSE, 
scaling = FALSE, 
regression = FALSE)

Arguments

Value

  • a list with the following components :
  • xtraina matrix or data frame representing the training sample.
  • ytraina response vector representing the training responses according to the training sample.
  • xtesta matrix or data frame representing the validation sample.
  • ytesta response vector representing the validation responses according to the validation sample.
  • train_idxsubscripts of the training sample.
  • test_idxsubscripts of the validation sample.

Examples

Run this code
data(iris)
Y <- iris$Species
X <- iris[,-which(colnames(iris) == "Species")]
trainingAndValidationsamples <- init_values(X, Y, sample.size = 0.5)

Xtrain = trainingAndValidationsamples$xtrain
Ytrain = trainingAndValidationsamples$ytrain
Xvalid = trainingAndValidationsamples$xtest
Yvalid = trainingAndValidationsamples$ytest

Run the code above in your browser using DataLab