Skip to content

Commit d7b6735

Browse files
committed
Improve flake8 issues
1 parent 80b5e69 commit d7b6735

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

hpsklearn/components/feature_extraction/text.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _text_norm(name: str):
8686
Declaration search space 'norm' parameter
8787
"""
8888
return hp.choice(name, ["l1", "l2"])
89-
89+
9090

9191
@validate(params=["analyzer"],
9292
validation_test=lambda param: not isinstance(param, str) or param in ["word", "char", "char_wb"],
@@ -147,7 +147,7 @@ def _name(msg):
147147
hp_space["min_df"] = _text_min_df(_name("min_df")) if min_df is None else min_df
148148
hp_space["norm"] = _text_norm(_name("norm")) if norm is None else norm
149149
hp_space["max_features"] = _text_max_features(_name("max_features")) \
150-
if max_features is not None else max_features
150+
if max_features is not None else max_features
151151

152152
return scope.sklearn_TfidfVectorizer(**hp_space)
153153

@@ -166,7 +166,7 @@ def hashing_vectorizer(name: str, norm: typing.Union[str, Apply] = None, **kwarg
166166
"""
167167
def _name(msg):
168168
return f"{name}.hashing_vectorizer_{msg}"
169-
169+
170170
hp_space = _text_hp_space(_name, **kwargs)
171171
hp_space["norm"] = _text_norm(_name("norm")) if norm is None else norm
172172

@@ -191,11 +191,11 @@ def count_vectorizer(
191191
"""
192192
def _name(msg):
193193
return f"{name}.count_vectorizer_{msg}"
194-
194+
195195
hp_space = _text_hp_space(_name, **kwargs)
196196
hp_space["max_df"] = _text_max_df(_name("max_df")) if max_df is None else max_df
197197
hp_space["min_df"] = _text_min_df(_name("min_df")) if min_df is None else min_df
198198
hp_space["max_features"] = _text_max_features(_name("max_features")) \
199-
if max_features is not None else max_features
200-
199+
if max_features is not None else max_features
200+
201201
return scope.sklearn_CountVectorizer(**hp_space)

hpsklearn/components/linear_model/_ridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def _name(msg):
219219
validation_test=lambda param: not isinstance(param, str) or param == "balanced",
220220
msg="Invalid parameter '%s' with value '%s'. Value must be 'balanced'")
221221
def ridge_classifier_cv(name: str,
222-
class_weight: typing.Union[dict, str] = None,
222+
class_weight: typing.Union[dict, str] = None,
223223
store_cv_results: bool = False,
224224
**kwargs):
225225
"""

tests/test_components/test_feature_extraction/test_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_hashing_vectorizer(self):
6262
max_evals=5,
6363
)
6464
model.fit(self.X_test, self.Y_test)
65-
65+
6666
@TrialsExceptionHandler
6767
def test_count_vectorizer(self):
6868
"""

0 commit comments

Comments
 (0)