@@ -568,10 +568,7 @@ def score(self, X, y=None):
568568 score : numpy.ndarray of (n_to_select_from_)
569569 :math:`\pi` importance for the given samples or features
570570 """
571- if y is not None :
572- validate_data (self , X , y .ravel (), reset = False )
573- else :
574- validate_data (self , X , reset = False ) # present for API consistency
571+ validate_data (self , X , reset = False ) # present for API consistency
575572 return self .pi_
576573
577574 def _init_greedy_search (self , X , y , n_to_select ):
@@ -746,10 +743,7 @@ def score(self, X, y=None):
746743 score : numpy.ndarray of (n_to_select_from_)
747744 :math:`\pi` importance for the given samples or features
748745 """
749- if y is not None :
750- validate_data (self , X , y .ravel (), reset = False )
751- else :
752- validate_data (self , X , reset = False ) # present for API consistency
746+ validate_data (self , X , reset = False ) # present for API consistency
753747 return self .pi_
754748
755749 def _init_greedy_search (self , X , y , n_to_select ):
@@ -943,10 +937,7 @@ def score(self, X, y=None):
943937 -------
944938 hausdorff : Hausdorff distances
945939 """
946- if y is not None :
947- validate_data (self , X , y .ravel (), reset = False )
948- else :
949- validate_data (self , X , reset = False )
940+ validate_data (self , X , reset = False )
950941 return self .hausdorff_
951942
952943 def get_distance (self ):
@@ -1109,10 +1100,7 @@ def score(self, X, y=None):
11091100 -------
11101101 hausdorff : Hausdorff distances
11111102 """
1112- if y is not None :
1113- validate_data (self , X , y .ravel (), reset = False )
1114- else :
1115- validate_data (self , X , reset = False )
1103+ validate_data (self , X , reset = False )
11161104
11171105 return self .hausdorff_
11181106
0 commit comments