Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

[HOTFIX] fix compatibility with new scikit-learn version #142

Merged
merged 1 commit into from
Jun 9, 2020
Merged
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 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ install:
# Useful for debugging any issues with conda
- conda info -a

- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy scipy nose cython scikit-learn
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy scipy nose cython scikit-learn six joblib
- source activate test-environment
- make all

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ install:
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
- "pip --version"

- "%CMD_IN_ENV% pip install --timeout=60 numpy scipy cython nose scikit-learn wheel"
- "%CMD_IN_ENV% pip install --timeout=60 numpy scipy cython nose scikit-learn wheel six joblib"
- "%CMD_IN_ENV% python setup.py bdist_wheel bdist_wininst"

- ps: "ls dist"
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench_amazon7.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys

from sklearn.externals import joblib
import joblib

from lightning.classification import SDCAClassifier

Expand Down
4 changes: 2 additions & 2 deletions doc/sphinxext/gen_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import posixpath
import subprocess
import warnings
from sklearn.externals import six
import six


# Try Python 2 first, otherwise load from Python 3
Expand Down Expand Up @@ -67,7 +67,7 @@ def execfile(filename, global_vars=None, local_vars=None):
pass


from sklearn.externals import joblib
import joblib

###############################################################################
# A tee object to redict streams to multiple outputs
Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/adagrad.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from sklearn.utils import check_random_state
from sklearn.preprocessing import LabelBinarizer
from sklearn.externals.six.moves import xrange
from six.moves import xrange

from .base import BaseClassifier, BaseRegressor
from .dataset_fast import get_dataset
Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/datasets/samples_generator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import scipy.sparse as sp
from sklearn.externals.six.moves import xrange
from six.moves import xrange

from sklearn.utils.extmath import safe_sparse_dot
from sklearn.utils import check_random_state
Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/dual_cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from sklearn.preprocessing import LabelBinarizer
from sklearn.preprocessing import add_dummy_feature
from sklearn.externals.six.moves import xrange
from six.moves import xrange

from .base import BaseClassifier, BaseRegressor
from .dataset_fast import get_dataset
Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/fista.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy as np

from sklearn.utils.extmath import safe_sparse_dot
from sklearn.externals.six.moves import xrange
from six.moves import xrange

from .base import BaseClassifier, BaseRegressor

Expand Down
4 changes: 2 additions & 2 deletions lightning/impl/primal_cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

import numpy as np

from sklearn.externals.joblib import Parallel, delayed
from sklearn.externals.six.moves import xrange
from joblib import Parallel, delayed
from six.moves import xrange

from .base import BaseClassifier
from .base import BaseRegressor
Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/primal_newton.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import check_random_state
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.externals.six.moves import xrange
from six.moves import xrange

from .base import BaseClassifier

Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/randomkit/tests/test_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from numpy.testing import (assert_almost_equal, assert_array_equal,
assert_equal)
from lightning.impl.randomkit import RandomState
from sklearn.externals.six.moves import xrange
from six.moves import xrange


def test_randint():
Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/sag.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import numpy as np

from sklearn.externals.six.moves import xrange
from six.moves import xrange

from .base import BaseClassifier, BaseRegressor
from .dataset_fast import get_dataset
Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/sdca.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from sklearn.utils import check_random_state
from sklearn.preprocessing import LabelBinarizer
from sklearn.externals.six.moves import xrange
from six.moves import xrange

from .base import BaseClassifier, BaseRegressor
from .dataset_fast import get_dataset
Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/sgd.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from sklearn.utils import check_random_state
from sklearn.utils.extmath import safe_sparse_dot
from sklearn.utils.validation import assert_all_finite
from sklearn.externals.six.moves import xrange
from six.moves import xrange

from .base import BaseClassifier
from .base import BaseRegressor
Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/svrg.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy as np

from sklearn.preprocessing import LabelBinarizer
from sklearn.externals.six.moves import xrange
from six.moves import xrange

from .base import BaseClassifier, BaseRegressor
from .dataset_fast import get_dataset
Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.externals.six.moves import xrange
from six.moves import xrange

from sklearn.datasets.samples_generator import make_classification
from sklearn.utils import check_random_state
Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/tests/test_dual_cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from sklearn.metrics.pairwise import linear_kernel
from sklearn.datasets.samples_generator import make_regression
from sklearn.externals.six.moves import xrange
from six.moves import xrange

from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/tests/test_penalty.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from sklearn.utils.testing import (assert_almost_equal,
assert_array_almost_equal)
from sklearn.externals.six.moves import xrange
from six.moves import xrange

from lightning.impl.penalty import project_l1_ball, project_simplex

Expand Down
2 changes: 1 addition & 1 deletion lightning/impl/tests/test_primal_cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from sklearn.datasets import load_digits
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.preprocessing import LabelBinarizer
from sklearn.externals.six.moves import xrange
from six.moves import xrange

from lightning.impl.datasets.samples_generator import make_classification
from lightning.impl.primal_cd import CDClassifier, CDRegressor
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def configuration(parent_package='', top_path=None):
setup(configuration=configuration,
name=DISTNAME,
maintainer=MAINTAINER,
install_requires=[
'six',
'scikit-learn'
],
include_package_data=True,
scripts=["bin/lightning_train",
"bin/lightning_predict"],
Expand Down