module IntMap = BatMap.Int
module IntSet = BatSet.Int
type features = int IntMap.t
val train : int -> Random.State.t -> metric -> int -> int_or_float -> int -> int_or_float -> int -> sample array -> forest
train ncores rng metric ntrees max_features card_features
max_samples min_node_size training_set
(pred_label, pred_proba) =
predict_one ncores rng trained_forest sample
(pred_label, pred_proba, pred_margin) =
predict_one_margin ncores rng trained_forest sample
predict_one but for an array of samples
val predict_many_margin : int -> Random.State.t -> forest -> sample array -> (class_label * float * float) array
predict_one_margin but for an array of samples
use a trained forest to predict on the Out Of Bag (OOB) training set of each tree. The training_set must be provided in the same order than when the model was trained. Can be used to get a reliable model performance estimate, even if you don't have a left out test set.
truth_preds = predict_OOB rng forest training_set
Matthews Correlation Coefficient (MCC).
mcc target_class_label truth_preds
Percentage of correct prediction
roc_auc target_class_label preds true_labels
Save model to file (Marshal) OOB samples are dropped prior to saving the model.
The following are needed to implement RFR
val choose_min_cost : Random.State.t -> (float * 'b * 'c * ('d * 'e)) list -> float * 'b * 'c * ('d * 'e)
val ratio_to_int : int -> int -> string -> int_or_float -> int