RandomForest Model for Searching Similar Cases
RandomForest Model for Searching Similar Cases
Details
This class uses the proximity or depth matrix of the RandomForest algorithm as a similarity matrix of training and query observations. By default all cases with at least one missing values are dropped from learning, calculating the distance matrix and searching for similar cases.
For survival endpoints, ranger stores the cumulative hazard at every
distinct event time in every leaf. On large data sets this makes the forest
slow to fit and large in memory (with 3000 cases and 500 trees, about 15
minutes and 6 GB). The distances and the survival predictions of this
package do not use these curves, so pass a time grid, e.g.
RFModel$new(Surv(time, status) ~ ., data, time.interest = 100).
References
Englund, C. and Verikas, A. (2012). A novel approach to estimate proximity in a random forest: An exploratory study. Expert Systems with Applications, 39(17), 13046–13050. doi:10.1016/j.eswa.2012.05.094
Super class
CaseBasedReasoning::CBRBase -> RFModel
Public fields
modelthe statistical model
model_paramsmodel arguments
dist_methodDistance method
proximity_typeProximity type for
dist_method = "Proximity":"original","oob"or"rfgap"(seeproximity_distance).
Methods
Inherited methods
CaseBasedReasoning::CBRBase$add_cases()CaseBasedReasoning::CBRBase$assess_cases()CaseBasedReasoning::CBRBase$calc_distance_matrix()CaseBasedReasoning::CBRBase$evaluate()CaseBasedReasoning::CBRBase$evaluate_survival()CaseBasedReasoning::CBRBase$explain_match()CaseBasedReasoning::CBRBase$get_case_base()CaseBasedReasoning::CBRBase$get_counterfactual_cases()CaseBasedReasoning::CBRBase$get_similar_cases()CaseBasedReasoning::CBRBase$predict_outcome()CaseBasedReasoning::CBRBase$predict_survival()CaseBasedReasoning::CBRBase$remove_cases()
Method new()
Initialize a RandomForest object for searching similar cases.
Usage
RFModel$new(formula, data, ...)Method set_distance_method()
Set the distance method. Available are Proximity and Depth
Arguments
methodDistance calculation method (default: Depth)
proximity_typeProximity type for
method = "Proximity":"original"(default),"oob"or"rfgap". The latter two use the forest's in-bag counts; for a query given toget_similar_cases()orcalc_distance_matrix()the query is treated as new data, without a query (calc_distance_matrix()) the in-sample, out-of-bag version is computed.