wweic / OptTrees

Source code for: Nima Asadi, Jimmy Lin, and Arjen P. de Vries. Runtime Optimizations for Tree-Based Machine Learning Models. IEEE Transactions on Knowledge and Data Engineering, 26(9):2281-2292, 2014.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Instance File

Every line in the feature file contains a feature vector of the following form:

<first_line> .=. <Number of instances:integer> <Number of features:integer>
<line> .=. <relevance: integer> qid:<query id: integer> 1:<value for feature 1: float> 2:<value for feature 2: float> ...

Tree Ensemble File

To convert a tree ensemble created by jforests into a tree compatible with the OptTrees framework, please use the following java driver under util/:

cd util
gradle run  --args="-input ../sample/jforests.ensemble.xml -mode tree"

By setting -mode to codegen, the driver will output a hard-coded ensemble with if-else blocks (i.e., the CodeGen implementation). Otherwise, the jforest ensemble will be formatted such that it can be read by OptTrees. Note that, this driver prints the output to stdout.

Evaluating Test Instances

Given a tree ensemble file and a test instances file, you can use any of the drivers provided in src/ to compute scores. By default, these drivers only measure the elapsed time to evaluate a single instance and report it in nanoseconds.

mkdir out
make
out/<implementation> -ensemble <tree-ensemble-file> -instances <test-instances-file> \
                     -maxLeaves <max-number-of-leaves-from-jforests> [-print]

Using -print, you can print the computed scores.

About

Source code for: Nima Asadi, Jimmy Lin, and Arjen P. de Vries. Runtime Optimizations for Tree-Based Machine Learning Models. IEEE Transactions on Knowledge and Data Engineering, 26(9):2281-2292, 2014.


Languages

Language:C 99.9%Language:Java 0.1%Language:C++ 0.0%Language:Python 0.0%Language:Makefile 0.0%