Description Usage Format Usage Methods Arguments Examples
Trains a Random Forest model. A random forest is a meta estimator that fits a number of decision tree classifiers on various sub-samples of the dataset and use averaging to improve the predictive accuracy and control over-fitting. This implementation uses ranger R package which provides faster model training.
1 |
R6Class
object.
For usage details see Methods, Arguments and Examples sections.
1 2 3 4 5 |
$new()
Initialises an instance of random forest model
$fit()
fit model to an input train data and trains the model.
$predict()
returns predictions by fitting the trained model on test data.
$get_importance()
Get feature importance from the model
the number of trees in the forest, default= 100
the number of features to consider when looking for the best split.
Possible values are auto(default)
takes sqrt(num_of_features),
sqrt
same as auto,
log
takes log(num_of_features),
none
takes all features
the maximum depth of each tree
the minumum number of samples required to split an internal node
the function to measure the quality of split. For classification, gini
is used which
is a measure of gini index. For regression, the variance
of responses is used.
whether to train for classification (1) or regression (0)
weights associated with the classes for sampling of training observation
show computation status and estimated runtime
vector of feature names to be always used for splitting
seed value
Variable importance mode, one of 'none', 'impurity', 'impurity_corrected', 'permutation'. The 'impurity' measure is the Gini index for classification, the variance of the responses for regression. Defaults to "impurity"
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.