Skip to content

Commit 504d601

Browse files
authored
Merge branch 'master' into spider
2 parents 4ec89cf + 9b31677 commit 504d601

File tree

118 files changed

+6693
-5548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+6693
-5548
lines changed

.circleci/config.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ jobs:
55
docker:
66
- image: circleci/python:3.6.1
77
environment:
8-
- USERNAME: "scikit-learn-contrib"
9-
- DOC_REPO: "imbalanced-learn"
8+
- USERNAME: "glemaitre"
9+
- ORGANIZATION: "imbalanced-learn"
10+
- DOC_REPO: "imbalanced-learn.github.io"
1011
- DOC_URL: ""
1112
- EMAIL: "g.lemaitre58@gmail.com"
1213
- MINICONDA_PATH: ~/miniconda
1314
- CONDA_ENV_NAME: testenv
1415
- PYTHON_VERSION: 3
1516
steps:
17+
- add_ssh_keys:
18+
fingerprints:
19+
- "34:ea:b1:d9:b1:e2:5d:79:81:c4:d0:39:ca:85:e1:ef"
1620
- checkout
1721
- run: ./build_tools/circle/checkout_merge_commit.sh
1822
- run: ./build_tools/circle/build_doc.sh
@@ -27,11 +31,11 @@ jobs:
2731
- attach_workspace:
2832
at: doc/_build/html
2933
- run: ls -ltrh doc/_build/html
30-
# - deploy:
31-
# command: |
32-
# if [[ "${CIRCLE_BRANCH}" =~ ^master$|^[0-9]+\.[0-9]+\.X$ ]]; then
33-
# bash ./build_tools/circle/push_doc.sh doc/_build/html
34-
# fi
34+
- deploy:
35+
command: |
36+
if [[ "${CIRCLE_BRANCH}" =~ ^master$|^[0-9]+\.[0-9]+\.X$ ]]; then
37+
bash ./build_tools/circle/push_doc.sh doc/_build/html
38+
fi
3539
filters:
3640
branches:
3741
ignore: gh-pages

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,5 @@ cythonize.dat
118118
# build documentation
119119
doc/_build/
120120
doc/auto_examples/
121-
doc/generated/
121+
doc/generated/
122+
doc/bibtex/auto

.readthedocs.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.travis.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# make it explicit that we favor the new container-based travis workers
2-
dist: xenial
2+
dist: bionic
33
sudo: false
44

55
language: python
@@ -30,21 +30,17 @@ matrix:
3030
include:
3131
# This environment tests the using anaconda
3232
# Ubuntu 14.04 environment
33-
- env: DISTRIB="ubuntu"
33+
- env: DISTRIB="ubuntu" TEST_DOC="true" TEST_NUMPYDOC="false"
3434
# Latest release
35-
- env: DISTRIB="conda" PYTHON_VERSION="3.6"
36-
NUMPY_VERSION="*" SCIPY_VERSION="*" SKLEARN_VERSION="0.21.2"
37-
OPTIONAL_DEPS="true"
3835
- env: DISTRIB="conda" PYTHON_VERSION="3.7"
39-
NUMPY_VERSION="*" SCIPY_VERSION="*" SKLEARN_VERSION="0.21.2"
40-
OPTIONAL_DEPS="false"
36+
NUMPY_VERSION="*" SCIPY_VERSION="*" SKLEARN_VERSION="master"
37+
OPTIONAL_DEPS="keras" TEST_DOC="true" TEST_NUMPYDOC="false"
4138
- env: DISTRIB="conda" PYTHON_VERSION="3.7"
4239
NUMPY_VERSION="*" SCIPY_VERSION="*" SKLEARN_VERSION="master"
43-
OPTIONAL_DEPS="false"
44-
allow_failures:
40+
OPTIONAL_DEPS="tensorflow" TEST_DOC="true" TEST_NUMPYDOC="false"
4541
- env: DISTRIB="conda" PYTHON_VERSION="3.7"
4642
NUMPY_VERSION="*" SCIPY_VERSION="*" SKLEARN_VERSION="master"
47-
OPTIONAL_DEPS="false"
43+
OPTIONAL_DEPS="false" TEST_DOC="false" TEST_NUMPYDOC="true"
4844

4945
install: source build_tools/travis/install.sh
5046
script: bash build_tools/travis/test_script.sh

README.rst

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
.. _scikit-learn-contrib: https://github.com/scikit-learn-contrib
66

7-
|Travis|_ |AppVeyor|_ |Codecov|_ |CircleCI|_ |ReadTheDocs|_ |PythonVersion|_ |Pypi|_ |Gitter|_
7+
|Travis|_ |AppVeyor|_ |Codecov|_ |CircleCI|_ |PythonVersion|_ |Pypi|_ |Gitter|_
88

99
.. |Travis| image:: https://travis-ci.org/scikit-learn-contrib/imbalanced-learn.svg?branch=master
1010
.. _Travis: https://travis-ci.org/scikit-learn-contrib/imbalanced-learn
@@ -18,9 +18,6 @@
1818
.. |CircleCI| image:: https://circleci.com/gh/scikit-learn-contrib/imbalanced-learn.svg?style=shield&circle-token=:circle-token
1919
.. _CircleCI: https://circleci.com/gh/scikit-learn-contrib/imbalanced-learn/tree/master
2020

21-
.. |ReadTheDocs| image:: https://readthedocs.org/projects/imbalanced-learn/badge/?version=latest
22-
.. _ReadTheDocs: https://imbalanced-learn.readthedocs.io/en/latest/?badge=latest
23-
2421
.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/imbalanced-learn.svg
2522
.. _PythonVersion: https://img.shields.io/pypi/pyversions/imbalanced-learn.svg
2623

@@ -44,7 +41,7 @@ Documentation
4441
Installation documentation, API documentation, and examples can be found on the
4542
documentation_.
4643

47-
.. _documentation: https://imbalanced-learn.readthedocs.io/en/stable/
44+
.. _documentation: https://imbalanced-learn.org/stable/
4845

4946
Installation
5047
------------
@@ -153,19 +150,23 @@ Below is a list of the methods currently implemented in this module.
153150
* Over-sampling
154151
1. Random minority over-sampling with replacement
155152
2. SMOTE - Synthetic Minority Over-sampling Technique [8]_
156-
3. bSMOTE(1 & 2) - Borderline SMOTE of types 1 and 2 [9]_
157-
4. SVM SMOTE - Support Vectors SMOTE [10]_
158-
5. ADASYN - Adaptive synthetic sampling approach for imbalanced learning [15]_
153+
3. SMOTENC - SMOTE for Nominal Continuous [8]_
154+
4. bSMOTE(1 & 2) - Borderline SMOTE of types 1 and 2 [9]_
155+
5. SVM SMOTE - Support Vectors SMOTE [10]_
156+
6. ADASYN - Adaptive synthetic sampling approach for imbalanced learning [15]_
157+
7. KMeans-SMOTE [17]_
159158

160159
* Over-sampling followed by under-sampling
161160
1. SMOTE + Tomek links [12]_
162161
2. SMOTE + ENN [11]_
163162

164163
* Ensemble classifier using samplers internally
165-
1. EasyEnsemble [13]_
166-
2. BalanceCascade [13]_
167-
3. Balanced Random Forest [16]_
168-
4. Balanced Bagging
164+
1. Easy Ensemble classifier [13]_
165+
2. Balanced Random Forest [16]_
166+
3. Balanced Bagging
167+
4. RUSBoost [18]_
168+
169+
* Mini-batch resampling for Keras and Tensorflow
169170

170171
The different algorithms are presented in the sphinx-gallery_.
171172

@@ -206,3 +207,7 @@ References:
206207
.. [15] : H. He, Y. Bai, E. A. Garcia, S. Li, “ADASYN: Adaptive synthetic sampling approach for imbalanced learning,” In Proceedings of the 5th IEEE International Joint Conference on Neural Networks, pp. 1322-1328, 2008.
207208
208209
.. [16] : C. Chao, A. Liaw, and L. Breiman. "Using random forest to learn imbalanced data." University of California, Berkeley 110 (2004): 1-12.
210+
211+
.. [17] : Felix Last, Georgios Douzas, Fernando Bacao, "Oversampling for Imbalanced Learning Based on K-Means and SMOTE"
212+
213+
.. [18] : Seiffert, C., Khoshgoftaar, T. M., Van Hulse, J., & Napolitano, A. "RUSBoost: A hybrid approach to alleviating class imbalance." IEEE Transactions on Systems, Man, and Cybernetics-Part A: Systems and Humans 40.1 (2010): 185-197.

appveyor.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ environment:
1010
- PYTHON: "C:\\Miniconda36-x64"
1111
PYTHON_VERSION: "3.6"
1212
PYTHON_ARCH: "64"
13-
OPTIONAL_DEP: "pandas keras tensorflow"
13+
OPTIONAL_DEP: "pandas keras tensorflow=1"
14+
15+
- PYTHON: "C:\\Miniconda36-x64"
16+
PYTHON_VERSION: "3.6"
17+
PYTHON_ARCH: "64"
18+
OPTIONAL_DEP: "pandas tensorflow"
1419

1520
- PYTHON: "C:\\Miniconda36-x64"
1621
PYTHON_VERSION: "3.7"
@@ -30,8 +35,8 @@ install:
3035
- conda update conda -y -q
3136
- conda create -n testenv --yes python=%PYTHON_VERSION% pip
3237
- activate testenv
33-
- conda install scipy numpy -y -q
34-
- conda install scikit-learn -y -q
38+
- conda install scipy numpy joblib -y -q
39+
- pip install --pre -f https://sklearn-nightly.scdn8.secure.raxcdn.com scikit-learn
3540
- conda install %OPTIONAL_DEP% -y -q
3641
- conda install pytest pytest-cov -y -q
3742
- pip install codecov

build_tools/circle/build_doc.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ fi
7474

7575
MAKE_TARGET=html
7676

77+
# Installing required system packages to support the rendering of math
78+
# notation in the HTML documentation
79+
sudo -E apt-get -yq update
80+
sudo -E apt-get -yq remove texlive-binaries --purge
81+
sudo -E apt-get -yq --no-install-suggests --no-install-recommends \
82+
install dvipng texlive-latex-base texlive-latex-extra \
83+
texlive-latex-recommended texlive-fonts-recommended \
84+
latexmk gsfonts ccache
85+
7786
# deactivate circleci virtualenv and setup a miniconda env instead
7887
if [[ `type -t deactivate` ]]; then
7988
deactivate
@@ -88,13 +97,15 @@ conda update --yes --quiet conda
8897

8998
# Configure the conda environment and put it in the path using the
9099
# provided versions
91-
conda create -n $CONDA_ENV_NAME --yes --quiet python=3.6
100+
conda create -n $CONDA_ENV_NAME --yes --quiet python=3.7
92101
source activate $CONDA_ENV_NAME
93102

94-
conda install --yes pip numpy scipy pillow matplotlib sphinx \
95-
sphinx_rtd_theme numpydoc pandas keras
96-
pip install --pre scikit-learn
103+
conda install --yes pip numpy scipy joblib pillow matplotlib memory_profiler \
104+
sphinx sphinx_rtd_theme \pandas keras tensorflow=1
105+
pip install --pre -f https://sklearn-nightly.scdn8.secure.raxcdn.com scikit-learn
97106
pip install -U git+https://github.com/sphinx-gallery/sphinx-gallery.git
107+
pip install -U git+https://github.com/numpy/numpydoc.git
108+
pip install -U git+https://github.com/mcmtroffaes/sphinxcontrib-bibtex.git
98109

99110
# Build and install imbalanced-learn in dev mode
100111
ls -l

build_tools/circle/push_doc.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ MSG="Pushing the docs to $dir/ for branch: $CIRCLE_BRANCH, commit $CIRCLE_SHA1"
2727

2828
cd $HOME
2929
if [ ! -d $DOC_REPO ];
30-
then git clone --depth 1 --no-checkout -b gh-pages "git@github.com:"$USERNAME"/"$DOC_REPO".git";
30+
then git clone --depth 1 --no-checkout -b master "git@github.com:"$ORGANIZATION"/"$DOC_REPO".git";
3131
fi
3232
cd $DOC_REPO
3333
git config core.sparseCheckout true
3434
echo $dir > .git/info/sparse-checkout
35-
git checkout gh-pages
36-
git reset --hard origin/gh-pages
35+
git checkout master
36+
git reset --hard origin/master
3737
git rm -rf $dir/ && rm -rf $dir/
3838
cp -R $GENERATED_DOC_DIR $dir
3939
touch $dir/.nojekyll
@@ -42,6 +42,6 @@ git config --global user.name $USERNAME
4242
git config --global push.default matching
4343
git add -f $dir/
4444
git commit -m "$MSG" $dir
45-
git push origin gh-pages
45+
git push origin master
4646

4747
echo $MSG

build_tools/travis/install.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,31 @@ if [[ "$DISTRIB" == "conda" ]]; then
2828
MINICONDA_PATH=/home/travis/miniconda
2929
chmod +x miniconda.sh && ./miniconda.sh -b -p $MINICONDA_PATH
3030
export PATH=$MINICONDA_PATH/bin:$PATH
31-
conda config --set always_yes yes --set changeps1 no
32-
conda install conda=4.6
33-
conda update -q conda
34-
conda info -a
3531

3632
# Configure the conda environment and put it in the path using the
3733
# provided versions
3834
conda create -n testenv --yes python=$PYTHON_VERSION pip
3935
source activate testenv
4036
conda install --yes numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION
4137

42-
if [[ "$OPTIONAL_DEPS" == "true" ]]; then
43-
conda install --yes pandas keras tensorflow
38+
if [[ "$OPTIONAL_DEPS" == "keras" ]]; then
39+
conda install --yes pandas keras tensorflow=1
4440
KERAS_BACKEND=tensorflow
4541
python -c "import keras.backend"
4642
sed -i -e 's/"backend":[[:space:]]*"[^"]*/"backend":\ "'$KERAS_BACKEND'/g' ~/.keras/keras.json;
43+
elif [[ "$OPTIONAL_DEPS" == "tensorflow" ]]; then
44+
conda install --yes pandas tensorflow
4745
fi
4846

4947
if [[ "$SKLEARN_VERSION" == "master" ]]; then
50-
conda install --yes cython
51-
pip install -U git+https://github.com/scikit-learn/scikit-learn.git
48+
pip install --pre -f https://sklearn-nightly.scdn8.secure.raxcdn.com scikit-learn
5249
else
5350
conda install --yes scikit-learn=$SKLEARN_VERSION
5451
fi
5552

5653
conda install --yes pytest pytest-cov
5754
pip install codecov
55+
pip install -U git+https://github.com/numpy/numpydoc.git
5856

5957
elif [[ "$DISTRIB" == "ubuntu" ]]; then
6058
# At the time of writing numpy 1.9.1 is included in the travis
@@ -65,8 +63,8 @@ elif [[ "$DISTRIB" == "ubuntu" ]]; then
6563
virtualenv --system-site-packages --python=python3 testvenv
6664
source testvenv/bin/activate
6765

68-
pip3 install scikit-learn
69-
pip3 install pandas keras tensorflow
66+
pip install --pre -f https://sklearn-nightly.scdn8.secure.raxcdn.com scikit-learn
67+
pip3 install pandas
7068
pip3 install pytest pytest-cov codecov sphinx numpydoc
7169

7270
fi

build_tools/travis/test_script.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ run_tests(){
2525

2626
# Test doc
2727
cd $OLDPWD
28-
make test-doc
28+
if [[ "$TEST_DOC" == "true" ]]; then
29+
make test-doc
30+
fi
31+
32+
# Validate numpydoc style
33+
if [[ "$TEST_NUMPYDOC" == "true" ]]; then
34+
pytest -vsl maint_tools/test_docstring.py
35+
fi
2936
}
3037

3138
if [[ "$SKIP_TESTS" != "true" ]]; then

doc/api.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,8 @@ Prototype selection
111111
:toctree: generated/
112112
:template: class.rst
113113

114-
ensemble.BalanceCascade
115114
ensemble.BalancedBaggingClassifier
116115
ensemble.BalancedRandomForestClassifier
117-
ensemble.EasyEnsemble
118116
ensemble.EasyEnsembleClassifier
119117
ensemble.RUSBoostClassifier
120118

@@ -251,5 +249,4 @@ Imbalance-learn provides some fast-prototyping tools.
251249

252250
utils.estimator_checks.check_estimator
253251
utils.check_neighbors_object
254-
utils.check_ratio
255252
utils.check_sampling_strategy

0 commit comments

Comments
 (0)