Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies, add python 3.10, 3.11 tests, ensure code compatibility #106

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [['3.8', 'py38'], ['3.9', 'py39']]
python-version: [['3.8', 'py38'], ['3.9', 'py39'], ['3.10', 'py310'], ['3.11', 'py311']]

steps:
- uses: actions/checkout@v3
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
Multi-class imbalance is a common problem occurring in real-world supervised classifications tasks. While there has already been some research on the specialized methods aiming to tackle that challenging problem, most of them still lack coherent Python implementation that is simple, intuitive and easy to use.
multi-imbalance is a python package tackling the problem of multi-class imbalanced datasets in machine learning.
## Requirements
Tha package has been tested under python 3.9. It relies heavily on scikit-learn and typical scientific stack (numpy, scipy, pandas etc.).
Tha package has been tested under python 3.8-3.11. It relies heavily on scikit-learn and typical scientific stack (numpy, scipy, pandas etc.).
Requirements include:
* numpy>=1.23.4,
* scikit-learn>=1.1.3,
* pandas>=1.5.1,
* numpy>=1.23.4,<=1.26
* scikit-learn>=1.1.0,<=1.4
* pandas>1.5.1,<=2.2
* pytest>=7.2.0,
* imbalanced-learn>=0.9.1
* imbalanced-learn~=0.12
* IPython>=8.6.0,
* seaborn>=0.12.1,
* matplotlib>=3.6.2
* seaborn~=0.13.2,
* matplotlib>=3.6.2,<=3.9


## Installation
Expand Down Expand Up @@ -46,15 +46,18 @@ Our package includes implementation of such algorithms, as:
## Example usage
```python
from multi_imbalance.resampling.mdo import MDO
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split

# Mahalanbois Distance Oversampling
mdo = MDO(k=9, k1_frac=0, seed=0)

# read the data
X_train, y_train, X_test, y_test = ...
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)

# preprocess
X_train_resampled, y_train_resampled = mdo.fit_transform(np.copy(X_train), np.copy(y_train))
X_train_resampled, y_train_resampled = mdo.fit_resample(np.copy(X_train), np.copy(y_train))

# train the classifier on preprocessed data
clf_tree = DecisionTreeClassifier(random_state=0)
Expand Down
Loading
Loading