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

[MRG] Resolves CI issues #431

Merged
merged 8 commits into from
Dec 2, 2018
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 dask_ml/linear_model/glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

C : float
Regularization strength. Note that ``dask-glm`` solvers use
the parameterization :math:`\lambda = 1 / C`
the parameterization :math:`\\lambda = 1 / C`

fit_intercept : bool, default True
Specifies if a constant (a.k.a. bias or intercept) should be
Expand Down
3 changes: 1 addition & 2 deletions dask_ml/model_selection/_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -1144,9 +1144,8 @@ def fit(self, X, y=None, groups=None, **fit_params):
if self.multimetric_:
if self.refit is not False and (
not isinstance(self.refit, str)
or
# This will work for both dict / list (tuple)
self.refit not in scorer
or self.refit not in scorer
):
raise ValueError(
"For multi-metric scoring, the parameter "
Expand Down
11 changes: 5 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
import shutil
import subprocess

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
import packaging.version

import dask_sphinx_theme
from dask_ml import __version__ as version

# import sys
# sys.path.insert(0, os.path.abspath('.'))
Expand Down Expand Up @@ -99,10 +100,8 @@
# built documents.
#
# The short X.Y version.
version = ""
# The full version, including alpha/beta/rc tags.
from dask_ml import __version__ as version
import packaging.version
# version = ""

release = packaging.version.parse(version).base_version

# The language for content autogenerated by Sphinx. Refer to documentation
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ include_trailing_comma=True
force_grid_wrap=0
combine_as_imports=True
line_length=88
skip=
docs/source/conf.py

[coverage:run]
source=dask_ml
Expand Down
8 changes: 4 additions & 4 deletions tests/compose/test_column_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

def test_column_transformer():
a = sklearn.compose.make_column_transformer(
(["A"], sklearn.preprocessing.OneHotEncoder(sparse=False)),
(["B"], sklearn.preprocessing.StandardScaler()),
(sklearn.preprocessing.OneHotEncoder(sparse=False), ["A"]),
(sklearn.preprocessing.StandardScaler(), ["B"]),
)

b = dask_ml.compose.make_column_transformer(
(["A"], dask_ml.preprocessing.OneHotEncoder(sparse=False)),
(["B"], dask_ml.preprocessing.StandardScaler()),
(dask_ml.preprocessing.OneHotEncoder(sparse=False), ["A"]),
(dask_ml.preprocessing.StandardScaler(), ["B"]),
)

a.fit(df)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_incremental.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ def test_score(xy_classification):
client = distributed.Client(n_workers=2)

X, y = xy_classification
inc = Incremental(SGDClassifier(max_iter=1000, random_state=0), scoring="accuracy")
inc = Incremental(
SGDClassifier(max_iter=1000, random_state=0, tol=1e-3), scoring="accuracy"
)

with client:
inc.fit(X, y, classes=[0, 1])
Expand Down
15 changes: 10 additions & 5 deletions tests/test_pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ def test_pca_validation():

assert_raises_regex(
ValueError,
"n_components={}L? must be between "
"{}L? and min\(n_samples, n_features\)="
r"n_components={}L? must be between "
"{}L? and min\\(n_samples, n_features\\)="
"{}L? with svd_solver='{}'".format(
n_components, lower_limit[solver], smallest_d, solver_reported
),
Expand All @@ -389,9 +389,9 @@ def test_pca_validation():

assert_raises_regex(
ValueError,
"n_components={}L? must be "
r"n_components={}L? must be "
"strictly less than "
"min\(n_samples, n_features\)={}L?"
"min\\(n_samples, n_features\\)={}L?"
" with svd_solver='arpack'".format(n_components, smallest_d),
dd.PCA(n_components, svd_solver=solver).fit,
data,
Expand Down Expand Up @@ -689,7 +689,12 @@ def test_pca_bad_solver():

@pytest.mark.parametrize(
"svd_solver",
["full", pytest.mark.xfail(reason="svd_compressed promotes")("randomized")],
[
"full",
pytest.param(
"randomized", marks=pytest.mark.xfail(reason="svd_compressed promotes")
),
],
)
def test_pca_float_dtype_preservation(svd_solver):
# Ensure that PCA does not upscale the dtype when input is float32
Expand Down