Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions tests/test_distns.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ def classification_data():
return X_train, X_test, y_train, y_test


def is_t_distribution(
dist, learner, regression_data
): # pylint: disable=unused-argument
return dist == T


@pytest.mark.slow
@pytest.mark.parametrize(
"dist",
Expand All @@ -74,7 +68,21 @@ def is_t_distribution(
LogNormal,
Exponential,
Gamma,
T,
# This case fails for both learners, so the marker is strict: if T starts
# to pass, the run fails and the marker has to go. Only a ValueError
# counts as the expected failure.
pytest.param(
T,
marks=pytest.mark.xfail(
reason=(
"NGBRegressor(Dist=T) raises a ValueError: the natural "
"gradient for log df runs away as df grows, and the "
"gradient goes to NaN (#275)"
),
raises=ValueError,
strict=True,
),
),
TFixedDf,
TFixedDfFixedVar,
Cauchy,
Expand All @@ -88,9 +96,6 @@ def is_t_distribution(
DecisionTreeRegressor(criterion="squared_error", max_depth=5),
],
)
@pytest.mark.xfail(
condition=is_t_distribution, reason="Known to fail with T distribution"
)
def test_dists_runs_on_examples_logscore(dist: Distn, learner, regression_data):
X_train, X_test, y_train, y_test = regression_data
# TODO: test early stopping features
Expand Down
Loading