Page
Library
Module
Module type
Parameter
Class
Class type
Source
A pure OCaml implementation of a random forest classifier based on OC4.5. See Wikipedia for more information.
OC4.5 is an implementation of C4.5 that can be found here.
This project uses OBuild as a compilation manager.
To sum up, in order to get the project running,
opam install obuild # If you don't have it yet
obuild configure
obuild build
obuild install
You can generate the documentation by running ocamldoc
. However, you can have a quick glance at the not necessarily up-to-date precompiled documentation here. Same goes for OC4.5 here.
Assuming you're using integers (if not, use Oc45.FloatOc45
and ORandForest.FloatRandForest
or reimplement the needed functions to functorize ORandForest.ORandForest
with your datatype, a basic session would look like the following
let trainSet = Oc45.IntOc45.emptyTrainSet
nbFeatures nbCategories featuresContinuity in
Oc45.IntOc45.addDataList trainDataPoints trainSet
let forest = ORandForest.IntRandForest.genRandomForest nbTrees trainSet in
let categories = List.map
(ORandForest.IntRandForest.classify forest) testDataPoints in