Official implementation of Class-invariante Feature Range Uniform Sampling (CiFRUS)
Project description
Class-invariant Feature Range Uniform Sampling (CiFRUS)
Introduction
This is the official implementation of the tabular data augmentation method described in the following KDD 2024 paper: A Novel Feature Space Augmentation Method to Improve Classification Performance and Evaluation Reliability. The core augmentation method is class-invariant and supports majority-based prediction of unlabeled instances. Each unlabeled instance can be expanded into a set of augmented instances, followed by classifier prediction and aggregation of the predicted labels or class probabilities.
Installation
Installing with Pip
CiFRUS can be installed from PyPI with pip:
python -m pip install cifrus
The PyPI package only contains the core augmentation module. To acquire the datasets and code for conducting experiments, please fork this repository.
From source
cifrus.py can be directly copied to the project repository.
Usage
CiFRUS is compatible with scikit-learn and imbalanced-learn. Given feature matrix X where each row is a sample and corresponding class labels y, augmentation can be performed as follows:
from cifrus.cifrus import CiFRUS
cfrs = CiFRUS()
X_resampled, y_resampled = cfrs.fit_resample(X, y)
By default, CiFRUS augmentation increases the number of samples in the majority class five-fold, and balances the minority classes.
The majority-based prediction of CiFRUS can be used by passing the classifier's predict_proba() function as a parameter to the resample_predict_proba function of the CiFRUS object, as demonstrated below:
# any sklearn compatible classifier
from sklearn.ensemble import RandomForestClassifier
clf = RandomForestClassifier()
clf.fit(X_resampled, y_resampled)
# X_test is resampled, and the probabilities are aggregated internally
y_pred = cfrs.resample_predict_proba(clf.predict_proba, X_test)
License
This work is licensed under the Creative Commons Attribution 4.0 International License.
Citation
If you use CiFRUS in your scientific research, please consider citing us:
@inproceedings{saimon2024novel,
author = {Saimon, Sakhawat Hossain and Najnin, Tanzira and Ruan, Jianhua},
title = {A Novel Feature Space Augmentation Method to Improve Classification Performance and Evaluation Reliability},
doi = {10.1145/3637528.3671736},
booktitle = {Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
pages = {2512–2523},
year = {2024},
}
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cifrus-1.0.4.tar.gz.
File metadata
- Download URL: cifrus-1.0.4.tar.gz
- Upload date:
- Size: 10.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a542266c8a500af097d9f3d9ab8daddf92d54d1ac280473058632bda654fbff1
|
|
| MD5 |
002c2645adbaf59f72210f8030f79fec
|
|
| BLAKE2b-256 |
5c590c72695a469d9d0a0a47f040c1b8c90a6088721299789c82338d1061f617
|
Provenance
The following attestation bundles were made for cifrus-1.0.4.tar.gz:
Publisher:
release.yml on sakhawatsaimon/CiFRUS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cifrus-1.0.4.tar.gz -
Subject digest:
a542266c8a500af097d9f3d9ab8daddf92d54d1ac280473058632bda654fbff1 - Sigstore transparency entry: 147150806
- Sigstore integration time:
-
Permalink:
sakhawatsaimon/CiFRUS@2d70546ddcb5c3dda37b892e42a95366f8e460c9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sakhawatsaimon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2d70546ddcb5c3dda37b892e42a95366f8e460c9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file cifrus-1.0.4-py3-none-any.whl.
File metadata
- Download URL: cifrus-1.0.4-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af63275c0564bdff8583412630a1c3eef751e6499ded66c81a5e51360ed1b524
|
|
| MD5 |
8312472b09181cb1d87f270ee0a40b0b
|
|
| BLAKE2b-256 |
547ead341806cb1b2ccb87b55e05c5dd1b7a475bd859068c882aae03a5719adf
|
Provenance
The following attestation bundles were made for cifrus-1.0.4-py3-none-any.whl:
Publisher:
release.yml on sakhawatsaimon/CiFRUS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cifrus-1.0.4-py3-none-any.whl -
Subject digest:
af63275c0564bdff8583412630a1c3eef751e6499ded66c81a5e51360ed1b524 - Sigstore transparency entry: 147150808
- Sigstore integration time:
-
Permalink:
sakhawatsaimon/CiFRUS@2d70546ddcb5c3dda37b892e42a95366f8e460c9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sakhawatsaimon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2d70546ddcb5c3dda37b892e42a95366f8e460c9 -
Trigger Event:
workflow_dispatch
-
Statement type: