ObliviousAI / ag_sklearn

A fork of diffprivlib for CODEPEAK 2023 to extend the functionality
https://www.antigranular.com/
MIT License
3 stars 2 forks source link

Ensemble Method: ensemble.RandomForestRegressor #12

Open jkfitzsimons opened 11 months ago

jkfitzsimons commented 11 months ago

In the repo you'll find the RandomForestClassifier. How this works, from a high level, is it creates n trees and in each tree it creates branches that randomly split the input domain (unlike normal Random Forests which use a criterion to guide the splitting). Once these trees are generated it iterates over every leaf and uses a differentially private algorithm call permute and flip which endeavours to find the most popular label for that leaf (differentially privately).

To do the same in ensemble.RandomForestRegressor you will need to match the interfaces but perform a mean instead of a permute and flip. You can find the mean method in tools -> utils.

Warning: if there are no data points in a leaf you should select uniformly at random between the lower and upper bound of the datas domain.