Skip to contents

Fit forest models

YARF()
Builds a YARF Model. There are many customizations available.
YARFBAG()
A convenience method to build a Bagged Tree model via YARF.
YARFCART()
A convenience method to build a CART model via YARF. There are many customizations available.
YARFMissForest()
MissForest Imputation
YARFROC()
ROC and ROC-like curves

Predict and evaluate

predict(<YARF>)
Computes a response prediction for new data observation(s).
YARF_predict_all_trees()
Computes a response prediction for new data observation(s) for all trees (unaggregated).
YARF_set_aggregation_method()
Sets the Tree Aggregation Method
YARF_update_with_oob_results()
Computes the out-of-bag (OOB) predictions for the training data. This gives a good sense of out-of-sample performance in the future.
YARF_update_with_oob_validation_results()
Computes the out-of-bag (OOB) predictions for the validation subset of the training data. This allows the user to try many different models while still leaving test data for true out-of-sample performance estimation.
YARF_update_with_oob_test_results()
Computes the out-of-bag (OOB) predictions for the test subset of the training data. This function should only be run once. If it run again you risk adapting your model to the test data which will lead to overfitting and hence a biased out-of-sample performance estimate.
YARF_all_oob_results_matrix()
All OOB Results Matrix
calcAUC()
Calculates the area under the curve

Run and persist models

YARF_progress()
Prints out a message reflecting the progress of the YARF model construction
YARF_convergence()
Plot YARF convergence
YARF_stop()
Halts the model building.
set_YARF_num_cores()
Sets the number of cores for YARF to use for all operations which are multithreaded (e.g. model construction, prediction, etc)
YARF_serialize()
Serializes the model so the user can use save and save.image to write it to a file that can be then loaded into another and/or future R session.

Inspect trees and observations

illustrate_trees()
Illustrates trees to PNG files in the local directory.
prune_YARF_model()
Prunes the trees in a YARF mode. This is an irreversible modification to the tree structure.
prediction_nodes()
Returns the leaf nodes that are responsible for predictions for a given dataset.
compute_raw_proximity_info()
Computes information about the "proximity" of observations within the YARF model. Given two datasets, information is computed for all pairs of observations. Information returned is the prediction nodes (for all trees) for both objects and their common node in the tree structure plus much information about the nodes.
tree_average_proximity_info()
Computes information about the "proximity" of observations within the YARF model. Given two datasets, information is computed for all pairs of observations. Information is averaged over the trees in the model.
proximity_info()
Computes information about the "proximity" of observations within the YARF model. Given two datasets, information is computed for all pairs of observation.
get_tree_num_nodes_leaves_max_depths()
Gets information about each tree: the number of nodes, number of leaves and maximum depth.

Importance, interactions, and model checks

query_variable_counts()
Function which queries the YARF model about how many times the variables are used when splitting
query_variable_proportions_across_trees()
Function which queries the YARF model about the proportion of times the variables are used when splitting. This is a convenience method which merely normalizes the result of query_variable_counts.
first_order_interaction_investigator()
Investigate First Order Interactions
cov_importance_test()
Tests the effect of H0: one, or two, ... or all covariates are not predictive (out of sample) via a permutation test. We permute the covariates column(s) and build YARF models num_permutation_samples times. The p-val is determined by a permutation-like test.
model_fit_test()
Convenience method for testing a model's fit. The strategy is simple: one builds a YARF model from the residuals of the model you wish to fit and performs an omnibus test of all covariates against those residuals. This effecticely answers the question: "is there out-of-sample predictive information left over after this model was fit?" The p-val is determined by a permutation-like test.

Utilities

summary(<YARF>)
Prints a summary of the model to the console
print(<YARF>)
Alias for summary.
yarf_duplicate()
Duplicates the settings of YARF model. Wait is TRUE, all verbose logging is turned off and serializing is turned off as well.
shared_initial_substring()
Returns the shared initial portion of a string

Data