This function facilitates the simulation of dependent variables based on the specified independent variables utilizing a previously trained SCE model. It generates predictions for training, out-of-bag validation, and testing datasets. The function includes comprehensive input validation for data types, missing values, and predictor matching.
Model_simulation(Testing_data, model)
A list containing three components:
Training: A data.frame containing predictions for the training dataset
Validation: A data.frame containing out-of-bag (OOB) predictions
Testing: A data.frame containing predictions for the testing dataset
A data.frame or matrix comprising the data that will be used to test the model. Must contain all the predictors used in the model. Must not contain missing values.
The trained SCE model object generated through the SCE
function.
This model contains the necessary information and parameters for conducting simulations.
Kailong Li <lkl98509509@gmail.com>
The simulation process involves the following steps:
Input validation:
Data type and structure checks (data.frame or matrix)
Missing value checks
Predictor matching with training data
Numeric data validation
Data preparation:
Conversion to matrix format
Initialization of prediction matrices
Prediction generation:
Training predictions using all trees
Out-of-bag predictions using trees not trained on each sample
Testing predictions using all trees
SCE