package orandforest

  1. Overview
  2. Docs
type randomForest

Stores a random forest generated by genRandomForest

val genRandomForest : ?ncores:int -> int -> c45_trainSet -> randomForest

genRandomForest nbTrees trainSet generates a random forest of nbTrees trees, based on trainSet. If ncores > 1 is given, the random forest will be built in parallel

val classify : randomForest -> c45_data -> c45_category

Classifies a new data vector, relying on the informations from the given random forest (generated by genRandomForest), yielding a category.

val classify_raw : randomForest -> c45_data -> (c45_category * float) list

Like classify but gives access to the percentage of votes for each category. After calibration of your classifier (e.g. using Platt/sigmoid scaling or isotonic regression), those percentages can be converted to probabilities. No calibration method is included in the library currently.

val save_to_file : string -> randomForest -> unit

save_to_file output model saves the random forest model into the file output.

val restore_from_file : string -> randomForest

restore_from_file input restores the random forest that was previously saved in file input.

OCaml

Innovation. Community. Security.