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-1.0.0.tar.gz
(958.2 kB
view hashes)
Built Distributions
Close
Hashes for dare_rf-1.0.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 779e391a2a05ccc3ddf7e66b10dd0830f02cd37de493750168b86df6876b7920 |
|
MD5 | 6c1d97cf3a3ff5bfecb5350f1070f367 |
|
BLAKE2b-256 | 49aa647b72ac6de147f6d1be2bb63faf8a2ab9baa7829517e6b290c99ada4f36 |
Close
Hashes for dare_rf-1.0.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d7614a6d6e79b0ff716d430f9bbc59ac8461dea564c12916d02f97abd9610f8 |
|
MD5 | 4be847c48fd32a31e540fa0662958402 |
|
BLAKE2b-256 | 6741e07600cdec4ef0b7acf4ccbee05407a038d93f14fec4408af7457d402043 |
Close
Hashes for dare_rf-1.0.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0d8f9c48b8ec59e4d93f3ded78a072642d2466d4fc9d21060fed21aa8383014 |
|
MD5 | 9bfe7c0118a5e6ce92b6fac4b43764a8 |
|
BLAKE2b-256 | b255c5c8635a49e88ca1d48e9d7bbb6eb619da5bc0ec550635b42cf3a856907c |
Close
Hashes for dare_rf-1.0.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5edf906e4581b8e7abc96aad73ae683715f0646bca51aca8d96af2cbdd048c0 |
|
MD5 | b151c0ed8220d234dbb455574556bd8a |
|
BLAKE2b-256 | 2afd6a32d127476a3cd89653a5efef61395bd2e3b018a551143896a22420e270 |
Close
Hashes for dare_rf-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 475307b76d9e4aea7f1c7e2b5d506cf72e51c5cde3eb32ac8e62171402e05025 |
|
MD5 | 784bc203ed623c355ecf5e7611b32ca5 |
|
BLAKE2b-256 | 649dcbdcbe3012fd3983c3ea2ac3e65184413e845c6bb7ae02456c1cd900548d |
Close
Hashes for dare_rf-1.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fb4d6086698609618f6fe09d84caa5a7a7d6559df9c1b8b6bbd64138f3047bf |
|
MD5 | b1f860356f3573946052b81dbda48000 |
|
BLAKE2b-256 | bebf163f7e40b241f09865d96e07a7333b007a2861d83d87e79fc60627508653 |
Close
Hashes for dare_rf-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2acd2fca4348eec2bcc2e382a20f07db32d879238758f278217d3b0053d715b |
|
MD5 | fbf84ae03ffc82470467538e9fe9edc0 |
|
BLAKE2b-256 | 665b91a46f83774426a78ef3cb669fcf3270ee67e879792bc31953374dbc1374 |
Close
Hashes for dare_rf-1.0.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 443831f13cc03757196d80d01673b4aa6e555c1dbe0b692119e22cbdcd5f122f |
|
MD5 | 3d46ba6073c0b85052ce5d123ffa20cd |
|
BLAKE2b-256 | a58e05068845f7b8c8f70506f36249d5f8d54c0921c328c339a88af39372986d |
Close
Hashes for dare_rf-1.0.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1916488052e6583f1551af83ec271653c2007034a2412d18261a70e653f19bc |
|
MD5 | 86c366cd21bf32cb96d3109a66047c46 |
|
BLAKE2b-256 | 4a21bfd64fc31479ce5a341c2e6e4c2922fab405d3a7a9d94794a62cb9b4aae8 |
Close
Hashes for dare_rf-1.0.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 951c1240d99f74062d0d73173ea8300146f87147f5909fdc2a7357b3226561ec |
|
MD5 | 5f85139d428852731f6ffcbd0a1da5eb |
|
BLAKE2b-256 | b14209d8b62df286e3eddc6795a9864d06239acd04d52c40f07d877b842277f8 |
Close
Hashes for dare_rf-1.0.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea5a052484ce674f9ff5b6e740a148cce0080528828e500a8addbc315487f9a6 |
|
MD5 | b7b327e2250e854ebb67b3cf5bc6d3a6 |
|
BLAKE2b-256 | 886aefd04b34e8380f05872eceba9e6703fd4604d15d427d363aeecb30b55fa8 |
Close
Hashes for dare_rf-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85b01f2d99f21f47fd9187f5a092620fda3538e1b810cd3aabdd7b39062d6925 |
|
MD5 | 382378188630321748c972b3ba732ffc |
|
BLAKE2b-256 | c9789b23895906e734629dde128ff80e174b942f767d03c982b03bdeb0964ed8 |
Close
Hashes for dare_rf-1.0.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a84c6616b4d72187c8f0e889a1421f5d686418db91f71f8fa424c2c319b44b2e |
|
MD5 | c4c550398317950c3d58a54d4f4f217e |
|
BLAKE2b-256 | 0e3a162b64983cbeb0d5d2059f102a83e904167301c51cb546f36a47e927e32c |
Close
Hashes for dare_rf-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be781a9c5586a264bb12be6d510b0c0bbdd3f10bf797b99a40d2076690668bef |
|
MD5 | fb5b8121ea3cf652a6b969fa011fa46a |
|
BLAKE2b-256 | bdceefead9c4634994ed3f56668fcaabd1b3d9527b76aec9b3e4c17ececdea6d |
Close
Hashes for dare_rf-1.0.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5ac8123422ca920591f3b50020057cbb6845587078cdcc825677a4a291e495a |
|
MD5 | 1dae97abef886b57b0d07d972e8a6b0c |
|
BLAKE2b-256 | 6d4b0832c2929c0bf2be8ab07a0b2a8bd2592f48f858ed64c52852d726c39d80 |
Close
Hashes for dare_rf-1.0.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 349cca3b72a0ea17dbe347ce78920b2e2a4beff7ca50a090a7455da929a76faa |
|
MD5 | 95548268f58e3f39a21c98f9d1fbff62 |
|
BLAKE2b-256 | 1d1e664ec8d36553edc78049d80c3fd232df87e04fe91a93b3c607e88fe36af9 |
Close
Hashes for dare_rf-1.0.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f83fc77f8e63d49d51a76f8e464c9e0454c31e1286cd0c599c4fdbe86752bbe0 |
|
MD5 | aff6e56a40f60bfa74b774edd01799c8 |
|
BLAKE2b-256 | 00b7542ba3c6a15483a055098f6419df1777c030248d6631e97d24ecfba6493a |
Close
Hashes for dare_rf-1.0.0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbbad1473e05dd323bb475d65a86ef5dfe5018b075c20792bfe9d64d82ce0b1d |
|
MD5 | 643fa6e88505e881d0406ee8903ef359 |
|
BLAKE2b-256 | 70f89fa3f9607526694b95a8726c3ad8f26c251859f3d7efd11780e42d323064 |
Close
Hashes for dare_rf-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 362027cbd9b2b3270c73b152791817f2726cdefd776fe5e3b7ca344d97d891f4 |
|
MD5 | 7ff97bb1babb880707f603d2cac0ff89 |
|
BLAKE2b-256 | 874191989bedb3313fcb0d3975d75858342e6f73dfb2c372ed79f350cd2f9984 |
Close
Hashes for dare_rf-1.0.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e914eb4e3190f6fd4a8a0f598c60a0a632241eb135e6cb5b33b3d7c18460c4b0 |
|
MD5 | 47b4d3a9c043681cecf660bda31adf09 |
|
BLAKE2b-256 | cbca0be148b4c9c3ac310cbb1626f075355903e82aa8b14edaefe8b847352a5e |
Close
Hashes for dare_rf-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee177631aaca7b88c24460cb63acdff864d9fc6aa08c213699791d01b1147ef6 |
|
MD5 | 55a3ad339f4d16f1ec2d2f5a29c43d00 |
|
BLAKE2b-256 | 01cf0e8a45ff16b2d3f780f4cb3cdb1a74069c39cf31c5cc06ef83e78d8d3c8c |
Close
Hashes for dare_rf-1.0.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc5a9f90bbd0b30c66cd0d616f8b9f8816b5c12899f46151cdb34af157ef870b |
|
MD5 | b2d96d3e73c575dc7d229cfe4a5b7caa |
|
BLAKE2b-256 | 85bb338805d4731eb3413e60c7f8536f29fa97d90fd999bce024540c356ef4ea |
Close
Hashes for dare_rf-1.0.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14051b40a066059ba664aa39dc5d95f6757bc52b95f4a6c506deac4d79647d64 |
|
MD5 | 63b6cc4a80c797d8be28ae73d2751875 |
|
BLAKE2b-256 | 77ee9fd139a09f39a4ced35e5ad417de5d380b68b23ac88daf56a3e3513cde42 |
Close
Hashes for dare_rf-1.0.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18f3c3ec8562a06629fa68a034f1f3909afc6f50223bc9e10fb1b923714867fa |
|
MD5 | 1860d4aceb23d61e053cc5bcd18d32e7 |
|
BLAKE2b-256 | 0ec48a86bb8c1b7732cc9f07718a6ab4a290a5aa3c517424c2969b0f0048a767 |
Close
Hashes for dare_rf-1.0.0-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e0f67ce8d62568be53fac4d21c9962bbe9a2693f186fa48431d64ba5c4315cf |
|
MD5 | 4aa103e9a7a30cc0a6a8406b6ac3756d |
|
BLAKE2b-256 | b61fdfa10b0a3311e1d9c7e3e40ed60f354cb62be8f230b4a3a1b18ae5bb065c |
Close
Hashes for dare_rf-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5016917dfdc72446ccbf422fa23d33717535d24221adb46a6fe4203c8496b69 |
|
MD5 | 17b70f4ed5609d5adbdd944a54fc3358 |
|
BLAKE2b-256 | 597d3bf5816c54eed9fbc6edbac3adfa6d3dae85e6563e60e5ebf7f12487c8d7 |
Close
Hashes for dare_rf-1.0.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 724e7a839dbcb22435b7a5f63ee0c4b710f01d93df6ab159a732a304cc952d54 |
|
MD5 | 758cd46e32e826b938229e4b222f7d7e |
|
BLAKE2b-256 | 0e6f4519b37f0f86f5286363a06768c789de153ee69e1fe78df43536bc0bc8f6 |
Close
Hashes for dare_rf-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c9b61ce2dd939eb690ef55e9dca8517102be8388b7eaccfa420dc3a034dbe0e |
|
MD5 | 8ffc263ecaf3fd06ce1054780e4570d6 |
|
BLAKE2b-256 | 0d329618dcdb0fe3052486fec1fcf81f486914435c9d3a5bd36c05acd93b67c5 |