Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

ud3: micro decision trees

The file ud3.c contains a minimalistic yet surprisingly versatile implementation of a regression tree, a special case of decision tree that maps a vector of observations into a real value (instead to some discrete label, such as class memebership). In the case of ud3.c, the obesrvations are represented as an array of real values.

The implemented algorithm should be used to approximate/estimate the functional mappings of the kind $R^m\rightarrow R^n$ from training data.

High-level api


Test on a toy dataset

An image can be as a function that maps 2D spatial coordinates to color (i.e., a 3D vector representing red, green and blue intensities).

In this experiment, we approximate a sample image with an ensemble of trees.

The following command will download a suitable image:

wget -O img.jpg

Now run the script to see how an ensemble of 16 trees od depth 10 approximates this image:


For a better approximation, add more trees or increase their depth.

You can’t perform that action at this time.