Data Removal-Enabled Random Forests
Project description
DaRE RF: Data Removal-Enabled Random Forests
dare-rf is a python library that implements machine unlearning for random forests, enabling the efficient removal of training data without having to retrain from scratch. It is built using Cython and is designed to be scalable to large datasets.
Installation
pip install dare-rf
Usage
Simple example of removing a single training instance:
import dare
import numpy as np
# training data
X_train = np.array([[0, 1], [0, 1], [0, 1], [1, 0], [1, 0]])
y_train = np.array([1, 1, 1, 0, 1])
X_test = np.array([[1, 0]]) # test instance
# train a DaRE RF model
rf = dare.Forest(n_estimators=100,
max_depth=3,
k=5, # no. thresholds to consider per attribute
topd=0, # no. random node layers
random_state=1)
rf.fit(X_train, y_train)
rf.predict_proba(X_test) # prediction before deletion => [0.5, 0.5]
rf.delete(3) # delete training example at index 3 ([1, 0], 0)
rf.predict_proba(X_test) # prediction after deletion => [0.0, 1.0]
License
Reference
Brophy and Lowd. Machine Unlearning for Random Forests. ICML 2021.
@inproceedings{brophy2021machine,
title={Machine Unlearning for Random Forests},
author={Brophy, Jonathan and Lowd, Daniel},
booktitle={International Conference on Machine Learning},
pages={1092--1104},
year={2021},
organization={PMLR}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dare-rf-0.10.1.tar.gz
(1.0 MB
view hashes)
Built Distributions
Close
Hashes for dare_rf-0.10.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1e8b426fec93f271b32f91b27d632405221f87642609a57a36e7e6bb730f17c |
|
MD5 | 0b6505acdf0d1ad79899473fbe4943e3 |
|
BLAKE2b-256 | ae07fe5c20b694db3d69cc64f2989d6862db2347a3f7811fae6b1abbda9848ba |
Close
Hashes for dare_rf-0.10.1-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f17b62b200d79e89b798068849ea752e61191c404bb836dde8c527dccb55e46f |
|
MD5 | d64804ee94c1a57d161c6a7e4ebfe1b1 |
|
BLAKE2b-256 | 6e8366cb73ce22f4da0adf0034350be5050ed9af95cc497a3be0257815e9f691 |
Close
Hashes for dare_rf-0.10.1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c691ffc4a201327e1f7e4010c791c2051268d84caff664ff9b8f313cbfa25fc |
|
MD5 | 03707f4ab2591b60b71ff70d74353860 |
|
BLAKE2b-256 | ef39022d51563e0f8b6a7f49ec073fc29df635dbef6a2592437d203d4c2502db |
Close
Hashes for dare_rf-0.10.1-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39242eceb641f935cb6af6edc320f81ae4fc8326c006320bd72634a3171c32a7 |
|
MD5 | aae44f0b6d0092cd24a065faeec20356 |
|
BLAKE2b-256 | 13bb60e57d3604c0eec2bd6171263d3cacb2ca4228606b53a5436750a4d2f3dc |
Close
Hashes for dare_rf-0.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf366ed949e6e0c75109533c89acdf67f023b4b6f08d102f9aad4750de5321ac |
|
MD5 | 18a66194453d41c7090a8590d7e28758 |
|
BLAKE2b-256 | f708d1c9ae4560d1d846e7c8137a224f9293fb614ec07d35dbd3d216b1a865e5 |
Close
Hashes for dare_rf-0.10.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd2c1d9b737203a2d1fb1697be0770d81dceba8250529c2bebdbfd65ce793367 |
|
MD5 | 87f287766d65177f0959c3d6b4679501 |
|
BLAKE2b-256 | 1236f3b25013a99620059251eda8eea1859ba0a7440530461fe954e14ddc70cf |
Close
Hashes for dare_rf-0.10.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee91801dce6489c61f0318636a0ed0a57700fabdc1b2a992974473a261a0b14e |
|
MD5 | 51da2fb86e8f1b9ddca204ec722d7dc2 |
|
BLAKE2b-256 | 77d06b3e752f8cee6b797ad91368781a1d29843d873f3f35c60c6857c6ac3118 |
Close
Hashes for dare_rf-0.10.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9f282eb13f6880a7f38b33fec0f9e46a29aeea29d8f51467b1c75c538c43cb3 |
|
MD5 | 942df14e47f4efcfebf3dbbb9c5df6fd |
|
BLAKE2b-256 | 98a1256a885d233ed7d1d028632ac3bc2253772b79730a5b0b945aafc442c289 |