CitrineInformatics / lolo

A random forest
Apache License 2.0
41 stars 12 forks source link
classification jackknife-variance-estimates machine-learning-algorithms random-forest regression uncertainty

Lolo

Lolo

Travis

Lolo is a random forest-centered machine learning library in Scala.

The core of Lolo is bagging simple base learners, like decision trees, to produce models that can generate robust uncertainty estimates.

Lolo supports:

Usage

Lolo is on the central repository, and can be used by simply adding the following dependency block in your pom file:

<dependency>
    <groupId>io.citrine</groupId>
    <artifactId>lolo</artifactId>
    <version>6.0.0</version>
</dependency>

Lolo provides higher level wrappers for common learner combinations. For example, you can use Random Forest with:

import io.citrine.lolo.learners.RandomForestRegressor
val trainingData: Seq[TrainingRow[Double]] = TrainingRow.build(features.zip(labels))
val model = RandomForestRegressor().train(trainingData).model
val predictions: Seq[Double] = model.transform(testInputs).expected

Performance

Lolo prioritizes functionality over performance, but it is still quite fast. In its random forest use case, the complexity scales as:

Time complexity Training rows Features Trees
train O(n log n) O(n) O(n)
loss O(n log n) O(n) O(n)
expected O(log n) O(1) O(n)
uncertainty O(n) O(1) O(n)

On an Ivy Bridge test platform, the (1024 row, 1024 tree, 8 feature) performance test took 1.4 sec to train and 2.3 ms per prediction with uncertainty.

Contributing

We welcome bug reports, feature requests, and pull requests. Pull requests should be made following the feature branch workflow: branching off of and opening PRs into main.

Production releases are triggered by tags. The sbt-ci-release plugin will use the tag as the lolo version. On the other hand, lolopy versions are still read from setup.py, so version bumps are needed for successful releases. Failing to bump the lolopy version number will result in a skipped lolopy release rather than a build failure.

Code Formatting

Authors

See Contributors

Related projects