RF_model | R Documentation |
this function trains then tests a random forest model with training and testing data folds
RF_model(
RF_optimal_train = RF_optimal_train,
RF_optimal_test = RF_optimal_test
)
training_dataset |
the training data |
formula |
formula describing the model fit |
Optimal_RF_Parameters |
returned from RF_test function |
model_type |
which type of rfsrc to use |
optimal_random_forest |
the resulting object from RF_optimal_train function |
testing_dataset |
the heldout data from holdout function |
proximity_flag |
boolean; whether or not proximity should be calculated |
number_of_training_participants <- 10
number_of_testing_participants <- 10
covariance_matrix <- diag(2)
outcome_column <- 1
means <- c(0,0)
training_dataset <- simulate_data(number_of_training_participants,covariance_matrix,outcome_column,means)
mtry <- 1
nodesize <- 1
formula <- y~x
model_type <- rfsrc()
random_forest <- RF_Train(training_dataset,formula,mtry,nodesize,model_type)
testing_dataset <- simulate_data(number_of_testing_participants,covariance_matrix,outcome_column,means)
proximity <- TRUE
Optimal_RF_Parameters <- RF_Test(object=random_forest,newdata=testing_dataset,proximity=TRUE)
optimal_random_forest <- RF_optimal_train(data=training_dataset,formula=y~x,Optimal_RF_Parameters=NULL,model_type="rfsrc")
RF_prediction <- RF_optimal_test(object=optimal_random_forest,newdata=testing_dataset,proximity_flag=TRUE)
RF_prediction <- RF_model(RF_optimal_train=RF_optimal_train,RF_optimal_test=RF_optimal_test)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.