Skip to content

Commit 78a1a8c

Browse files
ltiaofacebook-github-bot
authored andcommitted
Provide more informative warning messages in InputDataWarning (facebook#2713)
Summary: Pull Request resolved: facebook#2713 X-link: meta-pytorch/botorch#2489 Provide more informative warning messages when `InputDataWarning`s are raised to specify whether it pertains to input features or output targets. Updated unit tests accordingly to ensure coverage. Differential Revision: D61797434
1 parent dc0fba0 commit 78a1a8c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ax/modelbridge/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ def cross_validate(
904904
# users with this warning, we filter it out.
905905
warnings.filterwarnings(
906906
"ignore",
907-
message="Data is not standardized",
907+
message=r"Data \(outcome observations\) not standardized",
908908
category=InputDataWarning,
909909
)
910910
cv_predictions = self._cross_validate(

ax/modelbridge/cross_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def cross_validate(
184184
# To avoid confusing users with this warning, we filter it out.
185185
warnings.filterwarnings(
186186
"ignore",
187-
message="Data is not standardized",
187+
message=r"Data \(outcome observations\) not standardized",
188188
category=InputDataWarning,
189189
)
190190
cv_test_predictions = model._cross_validate(

ax/modelbridge/tests/test_base_modelbridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def warn_and_return_mock_obs(
225225
nonlocal called
226226
called = True
227227
warnings.warn(
228-
"Data is not standardized",
228+
"Data (outcome observations) not standardized",
229229
InputDataWarning,
230230
stacklevel=2,
231231
)

0 commit comments

Comments
 (0)