Skip to content

Commit f4bcef3

Browse files
fix unit tests to reduce computation time
1 parent e283e85 commit f4bcef3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

doubleml/tests/test_did_cs_binary_tune_ml_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
def test_doubleml_did_cs_binary_optuna_tune(sampler_name, optuna_sampler):
2121
np.random.seed(3153)
2222
df_panel = make_did_cs_CS2021(
23-
n_obs=500,
23+
n_obs=1000,
2424
dgp_type=2,
2525
include_never_treated=True,
2626
lambda_t=0.6,

doubleml/tests/test_dml_tune_optuna.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
def _basic_optuna_settings(additional=None):
15-
base_settings = {"n_trials": 20, "sampler": optuna.samplers.RandomSampler(seed=3141)}
15+
base_settings = {"n_trials": 10, "sampler": optuna.samplers.RandomSampler(seed=3141)}
1616
if additional is not None:
1717
base_settings.update(additional)
1818
return base_settings
@@ -72,8 +72,8 @@ def test_resolve_optuna_scoring_classifier_default():
7272
def test_resolve_optuna_scoring_with_criterion_keeps_default():
7373
learner = DecisionTreeRegressor(random_state=0)
7474
scoring, message = _resolve_optuna_scoring(None, learner, "ml_l")
75-
assert scoring is None
76-
assert "criterion" in message
75+
assert scoring == "neg_root_mean_squared_error"
76+
assert "neg_root_mean_squared_error" in message
7777

7878

7979
def test_resolve_optuna_scoring_lightgbm_regressor_default():
@@ -153,8 +153,8 @@ def test_doubleml_optuna_partial_tuning_single_learner():
153153
assert isinstance(tune_res[0], dict)
154154
assert set(tune_res[0].keys()) == {"ml_l"}
155155
l_tune = tune_res[0]["ml_l"]
156-
assert hasattr(l_tune, "tuned_")
157-
assert l_tune.tuned_ is True
156+
assert hasattr(l_tune, "tuned")
157+
assert l_tune.tuned is True
158158
assert "ml_m" not in tune_res[0]
159159

160160

0 commit comments

Comments
 (0)