Skip to content

Commit c1fffa1

Browse files
committed
fixes after rebase
1 parent c3b8844 commit c1fffa1

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

autoPyTorch/api/tabular_classification.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,23 +486,23 @@ def predict(
486486
raise ValueError("predict() is only supported after calling search. Kindly call first "
487487
"the estimator search() method.")
488488

489-
X_test = self.InputValidator.feature_validator.transform(X_test)
489+
X_test = self.input_validator.feature_validator.transform(X_test)
490490
predicted_probabilities = super().predict(X_test, batch_size=batch_size,
491491
n_jobs=n_jobs)
492492

493-
if self.InputValidator.target_validator.is_single_column_target():
493+
if self.input_validator.target_validator.is_single_column_target():
494494
predicted_indexes = np.argmax(predicted_probabilities, axis=1)
495495
else:
496496
predicted_indexes = (predicted_probabilities > 0.5).astype(int)
497497

498498
# Allow to predict in the original domain -- that is, the user is not interested
499499
# in our encoded values
500-
return self.InputValidator.target_validator.inverse_transform(predicted_indexes)
500+
return self.input_validator.target_validator.inverse_transform(predicted_indexes)
501501

502502
def predict_proba(self,
503503
X_test: Union[np.ndarray, pd.DataFrame, List],
504504
batch_size: Optional[int] = None, n_jobs: int = 1) -> np.ndarray:
505-
if self.InputValidator is None or not self.InputValidator._is_fitted:
505+
if self.input_validator is None or not self.input_validator._is_fitted:
506506
raise ValueError("predict() is only supported after calling search. Kindly call first "
507507
"the estimator search() method.")
508508
X_test = self.input_validator.feature_validator.transform(X_test)

autoPyTorch/api/tabular_regression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,14 +472,14 @@ def predict(
472472
batch_size: Optional[int] = None,
473473
n_jobs: int = 1
474474
) -> np.ndarray:
475-
if self.InputValidator is None or not self.InputValidator._is_fitted:
475+
if self.input_validator is None or not self.input_validator._is_fitted:
476476
raise ValueError("predict() is only supported after calling search. Kindly call first "
477477
"the estimator search() method.")
478478

479-
X_test = self.InputValidator.feature_validator.transform(X_test)
479+
X_test = self.input_validator.feature_validator.transform(X_test)
480480
predicted_values = super().predict(X_test, batch_size=batch_size,
481481
n_jobs=n_jobs)
482482

483483
# Allow to predict in the original domain -- that is, the user is not interested
484484
# in our encoded values
485-
return self.InputValidator.target_validator.inverse_transform(predicted_values)
485+
return self.input_validator.target_validator.inverse_transform(predicted_values)

autoPyTorch/data/base_feature_validator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ def _fit(
113113

114114
def _check_data(
115115
self,
116-
X: SUPPORTED_FEAT_TYPES,
116+
X: SupportedFeatTypes,
117117
) -> None:
118118
"""
119119
Feature dimensionality and data type checks
120120
121121
Args:
122-
X (SUPPORTED_FEAT_TYPES):
122+
X (SupportedFeatTypes):
123123
A set of features that are going to be validated (type and dimensionality
124124
checks) and a encoder fitted in the case the data needs encoding
125125
"""
@@ -145,19 +145,19 @@ def transform(
145145

146146
def list_to_pandas(
147147
self,
148-
X_train: SUPPORTED_FEAT_TYPES,
149-
X_test: Optional[SUPPORTED_FEAT_TYPES] = None,
148+
X_train: SupportedFeatTypes,
149+
X_test: Optional[SupportedFeatTypes] = None,
150150
) -> Tuple[pd.DataFrame, Optional[pd.DataFrame]]:
151151
"""
152152
Converts a list to a pandas DataFrame. In this process, column types are inferred.
153153
154154
If test data is provided, we proactively match it to train data
155155
156156
Args:
157-
X_train (SUPPORTED_FEAT_TYPES):
157+
X_train (SupportedFeatTypes):
158158
A set of features that are going to be validated (type and dimensionality
159159
checks) and a encoder fitted in the case the data needs encoding
160-
X_test (Optional[SUPPORTED_FEAT_TYPES]):
160+
X_test (Optional[SupportedFeatTypes]):
161161
A hold out set of data used for checking
162162
Returns:
163163
pd.DataFrame:

autoPyTorch/data/tabular_target_validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List, Optional, cast
1+
from typing import List, Optional, Union, cast
22

33
import numpy as np
44
import numpy.ma as ma

0 commit comments

Comments
 (0)