@@ -1741,15 +1741,15 @@ def score(self, X: SUPPORTED_FEAT_TYPES, y: SUPPORTED_TARGET_TYPES) -> float:
1741
1741
check_is_fitted (self )
1742
1742
1743
1743
prediction = self .predict (X )
1744
- y = self .InputValidator .target_validator .transform (y )
1744
+ y = self .input_validator .target_validator .transform (y )
1745
1745
1746
1746
# Encode the prediction using the input validator
1747
1747
# We train autosklearn with a encoded version of y,
1748
1748
# which is decoded by predict().
1749
1749
# Above call to validate() encodes the y given for score()
1750
1750
# Below call encodes the prediction, so we compare in the
1751
1751
# same representation domain
1752
- prediction = self .InputValidator .target_validator .transform (prediction )
1752
+ prediction = self .input_validator .target_validator .transform (prediction )
1753
1753
1754
1754
return compute_single_metric (
1755
1755
solution = y ,
@@ -2267,16 +2267,15 @@ def predict(
2267
2267
n_jobs : int = 1 ,
2268
2268
) -> np .ndarray :
2269
2269
check_is_fitted (self )
2270
- assert self .InputValidator is not None
2271
-
2272
2270
probabilities = self .predict_proba (X , batch_size = batch_size , n_jobs = n_jobs )
2271
+ validator = self .input_validator
2273
2272
2274
- if self . InputValidator .target_validator .is_single_column_target ():
2273
+ if validator .target_validator .is_single_column_target ():
2275
2274
predicted_indexes = np .argmax (probabilities , axis = 1 )
2276
2275
else :
2277
2276
predicted_indexes = (probabilities > 0.5 ).astype (int )
2278
2277
2279
- return self . InputValidator .target_validator .inverse_transform (predicted_indexes )
2278
+ return validator .target_validator .inverse_transform (predicted_indexes )
2280
2279
2281
2280
def predict_proba (
2282
2281
self ,
0 commit comments