@@ -561,17 +561,15 @@ def score(self, X, y=None):
561
561
562
562
Parameters
563
563
----------
564
- X : numpy.ndarray of shape [n_samples, n_features]
565
- The input samples.
564
+ X : ignored
566
565
y : ignored
567
566
568
567
Returns
569
568
-------
570
569
score : numpy.ndarray of (n_to_select_from_)
571
570
:math:`\pi` importance for the given samples or features
572
571
"""
573
- X , y = validate_data (self , X , y , reset = False )
574
-
572
+ validate_data (self , X , y , reset = False ) # present for API consistency
575
573
return self .pi_
576
574
577
575
def _init_greedy_search (self , X , y , n_to_select ):
@@ -746,8 +744,7 @@ def score(self, X, y=None):
746
744
score : numpy.ndarray of (n_to_select_from_)
747
745
:math:`\pi` importance for the given samples or features
748
746
"""
749
- X , y = validate_data (self , X , y , reset = False )
750
-
747
+ validate_data (self , X , y , reset = False ) # present for API consistency
751
748
return self .pi_
752
749
753
750
def _init_greedy_search (self , X , y , n_to_select ):
@@ -941,8 +938,7 @@ def score(self, X, y=None):
941
938
-------
942
939
hausdorff : Hausdorff distances
943
940
"""
944
- X , y = validate_data (self , X , y , reset = False )
945
-
941
+ validate_data (self , X , y , reset = False )
946
942
return self .hausdorff_
947
943
948
944
def get_distance (self ):
@@ -1079,15 +1075,16 @@ def __init__(
1079
1075
)
1080
1076
1081
1077
def fit (self , X , y = None , warm_start = False ):
1082
-
1083
1078
if self .mixing == 1.0 :
1084
1079
raise ValueError (
1085
- "Mixing = 1.0 corresponds to traditional FPS."
1086
- "Please use the FPS class."
1080
+ "Mixing = 1.0 corresponds to traditional FPS. Please use the FPS class."
1087
1081
)
1088
1082
1089
1083
return super ().fit (X , y )
1090
1084
1085
+ # docstring is inherited and set from the base class
1086
+ fit .__doc__ = GreedySelector .fit .__doc__
1087
+
1091
1088
def score (self , X , y = None ):
1092
1089
"""Returns the Hausdorff distances of all samples to previous selections.
1093
1090
@@ -1104,8 +1101,7 @@ def score(self, X, y=None):
1104
1101
-------
1105
1102
hausdorff : Hausdorff distances
1106
1103
"""
1107
- X , y = validate_data (self , X , y , reset = False )
1108
-
1104
+ validate_data (self , X , y , reset = False )
1109
1105
return self .hausdorff_
1110
1106
1111
1107
def get_distance (self ):
0 commit comments