decisiontree

Decision tree and Random forest CART implementation in Nim

Readme

Decision tree with nim

Nim package for decision trees and random forest

How to install

nimble install decisiontree

Package features

  • Inspired by Scikit-learn api
  • Random forest can train and predict in parallel
  • Actually you feed the X matrix of size [n x m] as seq[seq[float]] RowMajor and the y array of size [n] as seq[float]

Decision Tree

import DecisionTree

let dt = DecisionTree.new_classification_tree(max_depth=10)
dt.fit(X_train,y_train)
let yhat = dt.predict(X_test)

Random forest

import DecisionTree

let rf = DecisionTree.new_random_forest_classifier(n_trees=100, num_threads=4) #parallel training too!
rf.fit(X_train, y_train)
let yhat = rf.predict(X_test)
Need help? Read Nimble
Author:
Michedev
No tagged versions available
License: GPL-3.0

Project website Hosted docs