Create setting for RandomForestQuantileRegressor with python scikit-garden (skgarden.quantile.RandomForestQuantileRegressor) #' @description This creates a setting for fitting a RandomForestQuantileRegressor model. You need skgarden python install. To install this open your command line and type: conda install -c conda-forge scikit-garden
setRandomForestQuantileRegressor(
nEstimators = c(100),
criterion = "mse",
maxFeatures = -1,
maxDepth = 4,
minSamplesSplit = 2,
minSamplesLeaf = 1,
minWeightFractionLeaf = 0,
maxLeafNodes = NULL,
bootstrap = TRUE,
oobScore = FALSE,
warmStart = FALSE,
seed = NULL,
quiet = F
)
(int default:100) The number of trees in the forest.
(string default="mse")) The function to measure the quality of a split. Supported criteria are "mse" for the mean squared error, which is equal to variance reduction as feature selection criterion, and "mae" for the mean absolute error.
(int default: -1) The number of features to consider when looking for the best split. If -1 then use sqrt of total number of features.
(int default:4) The maximum depth of the tree. If None, then nodes are expanded until all leaves are pure or until all leaves contain less than minSamplesSplit samples.
An integer specifying min samples per tree split (complexity)
An integer specifying min samples per leaf (complexity)
Lookup
(int) Grow trees with maxLeafNodes in best-first fashion. Best nodes are defined as relative reduction in impurity. If None then unlimited number of leaf nodes.
(boolean default:TRUE) Whether bootstrap samples are used when building trees.
(boolean default:FALSE) Whether to use out-of-bag samples to estimate the R^2 on unseen data.
(boolean default:FALSE) When set to True, reuse the solution of the previous call to fit and add more estimators to the ensemble, otherwise, just fit a whole new forest.
will add
will add
Pick the hyper-parameters you want to do a grid search for
# NOT RUN {
rfQR <- setRandomForestQuantileRegressor(nEstimators =c(10,50,100),
maxDepth=c(4,10,17), seed = 2)
# }
Run the code above in your browser using DataLab