8000 fix linting issues · scikit-learn/scikit-learn@3af9b04 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3af9b04

Browse files
committed
fix linting issues
1 parent d7bdd31 commit 3af9b04

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

sklearn/feature_selection/_mutual_info.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,15 @@ def mutual_info_regression(X, y, *, discrete_features='auto', n_neighbors=3,
350350
For example, pixel intensities of an image are discrete features
351351
(but hardly categorical) and you will get better results if mark them
352352
as such. Also note, that treating a continuous variable as discrete and
353-
vice versa will usually give incorrect results, so be attentive about that.
353+
vice versa will usually give incorrect results, so be attentive about
354+
that.
354355
2. True mutual information can't be negative. If its estimate turns out
355356
to be negative, it is replaced by zero.
356357
357358
References
358359
----------
359-
.. [1] `Mutual Information <https://en.wikipedia.org/wiki/Mutual_information>`_
360+
.. [1] `Mutual Information
361+
<https://en.wikipedia.org/wiki/Mutual_information>`_
360362
on Wikipedia.
361363
.. [2] A. Kraskov, H. Stogbauer and P. Grassberger, "Estimating mutual
362364
information". Phys. Rev. E 69, 2004.
@@ -428,13 +430,15 @@ def mutual_info_classif(X, y, *, discrete_features='auto', n_neighbors=3,
428430
For example, pixel intensities of an image are discrete features
429431
(but hardly categorical) and you will get better results if mark them
430432
as such. A 10000 lso note, that treating a continuous variable as discrete and
431-
vice versa will usually give incorrect results, so be attentive about that.
433+
vice versa will usually give incorrect results, so be attentive about
434+
that.
432435
2. True mutual information can't be negative. If its estimate turns out
433436
to be negative, it is replaced by zero.
434437
435438
References
436439
----------
437-
.. [1] `Mutual Information <https://en.wikipedia.org/wiki/Mutual_information>`_
440+
.. [1] `Mutual Information
441+
<https://en.wikipedia.org/wiki/Mutual_information>`_
438442
on Wikipedia.
439443
.. [2] A. Kraskov, H. Stogbauer and P. Grassberger, "Estimating mutual
440444
information". Phys. Rev. E 69, 2004.

sklearn/feature_selection/_univariate_selection.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,8 @@ class SelectPercentile(_BaseFilter):
425425
SelectFpr: Select features based on a false positive rate test.
426426
SelectFdr: Select features based on an estimated false discovery rate.
427427
SelectFwe: Select features based on family-wise error rate.
428-
GenericUnivariateSelect: Univariate feature selector with configurable mode.
428+
GenericUnivariateSelect: Univariate feature selector with configurable
429+
mode.
429430
"""
430431
@_deprecate_positional_args
431432
def __init__(self, score_func=f_classif, *, percentile=10):
@@ -507,11 +508,13 @@ class SelectKBest(_BaseFilter):
507508
chi2: Chi-squared stats of non-negative features for classification tasks.
508509
f_regression: F-value between label/feature for regression tasks.
509510
mutual_info_regression: Mutual information for a continuous target.
510-
SelectPercentile: Select features based on percentile of the highest scores.
511+
SelectPercentile: Select features based on percentile of the highest
512+
scores.
511513
SelectFpr: Select features based on a false positive rate test.
512514
SelectFdr: Select features based on an estimated false discovery rate.
513515
SelectFwe: Select features based on family-wise error rate.
514-
GenericUnivariateSelect: Univariate feature selector with configurable mode.
516+
GenericUnivariateSelect: Univariate feature selector with configurable
517+
mode.
515518
"""
516519
@_deprecate_positional_args
517520
def __init__(self, score_func=f_classif, *, k=10):
@@ -586,11 +589,13 @@ class SelectFpr(_BaseFilter):
586589
mutual_info_classif:
587590
f_regression: F-value between label/feature for regression tasks.
588591
mutual_info_regression: Mutual information between features and the target.
589-
SelectPercentile: Select features based on percentile of the highest scores.
592+
SelectPercentile: Select features based on percentile of the highest
593+
scores.
590594
SelectKBest: Select features based on the k highest scores.
591595
SelectFdr: Select features based on an estimated false discovery rate.
592596
SelectFwe: Select features based on family-wise error rate.
593-
GenericUnivariateSelect: Univariate feature selector with configurable mode.
597+
GenericUnivariateSelect: Univariate feature selector with configurable
598+
mode.
594599
"""
595600
@_deprecate_positional_args
596601
def __init__(self, score_func=f_classif, *, alpha=5e-2):
@@ -652,11 +657,13 @@ class SelectFdr(_BaseFilter):
652657
chi2: Chi-squared stats of non-negative features for classification tasks.
653658
f_regression: F-value between label/feature for regression tasks.
654659
mutual_info_regression: Mutual information for a contnuous target.
655-
SelectPercentile: Select features based on percentile of the highest scores.
660+
SelectPercentile: Select features based on percentile of the highest
661+
scores.
656662
SelectKBest: Select features based on the k highest scores.
657663
SelectFpr: Select features based on a false positive rate test.
658664
SelectFwe: Select features based on family-wise error rate.
659-
GenericUnivariateSelect: Univariate feature selector with configurable mode.
665+
GenericUnivariateSelect: Univariate feature selector with configurable
666+
mode.
660667
"""
661668
@_deprecate_positional_args
662669
def __init__(self, score_func=f_classif, *, alpha=5e-2):
@@ -715,11 +722,13 @@ class SelectFwe(_BaseFilter):
715722
f_classif: ANOVA F-value between label/feature for classification tasks.
716723
chi2: Chi-squared stats of non-negative features for classification tasks.
717724
f_regression: F-value between label/feature for regression tasks.
718-
SelectPercentile: Select features based on percentile of the highest scores.
725+
SelectPercentile: Select features based on percentile of the highest
726+
scores.
719727
SelectKBest: Select features based on the k highest scores.
720728
SelectFpr: Select features based on a false positive rate test.
721729
SelectFdr: Select features based on an estimated false discovery rate.
722-
GenericUnivariateSelect: Univariate feature selector with configurable mode.
730+
GenericUnivariateSelect: Univariate feature selector with configurable
731+
mode.
723732
"""
724733
@_deprecate_positional_args
725734
def __init__(self, score_func=f_classif, *, alpha=5e-2):
@@ -783,7 +792,8 @@ class GenericUnivariateSelect(_BaseFilter):
783792
chi2: Chi-squared stats of non-negative features for classification tasks.
784793
f_regression: F-value between label/feature for regression tasks.
785794
mutual_info_regression: Mutual information for a continuous target.
786-
SelectPercentile: Select features based on percentile of the highest scores.
795+
SelectPercentile: Select features based on percentile of the highest
796+
scores.
787797
SelectKBest: Select features based on the k highest scores.
788798
SelectFpr: Select features based on a false positive rate test.
789799
SelectFdr: Select features based on an estimated false discovery rate.

0 commit comments

Comments
 (0)
0