Description Usage Arguments Value Note
View source: R/stackingFunctions.R
Main Stacking Procedure: Construct k folds and generate predictions from base models
1 2 3 4 | getStackWeights(trainset, binaryDepVar = F, hlmFormula, lasso_vars,
lasso_factors = NULL, forestFormula, mns_best = NULL, knnFormula,
k_best, gbm_vars, gbm_factors = NULL, gbm_params, gbm_tune,
nfolds = 5)
|
trainset |
The training dataset |
binaryDepVar |
A boolean denoting whether the outcome variable is binary or continuous. Used to specify tuning parameters for machine learning methods. |
hlmFormula |
A formula object for the hierarchical linear model |
lasso_vars |
The predictor variables to include in the LASSO model |
lasso_factors |
Which predictor variables need to be converted to factors before estimating the LASSO model |
forestFormula |
A formula object for the random forest model |
mns_best |
Optional min node size parameter for random forest model |
knnFormula |
A formula object for the KNN model |
k_best |
Optimal k parameter for KNN model |
gbm_vars |
The predictor variables to include in GBM model |
gbm_factors |
Which predictor variables need to be converted to factors before estimating the GBM |
gbm_params |
List of parameters for the GBM model |
gbm_tune |
xgb.tune object, containing the $best.iteration |
nfolds |
Number of cross-validation folds |
The optimal stacking weights (HLM, LASSO, KNN, Random Forest, GBM)
trainset must include a variable called 'y', denoting the outcome
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.