Skip to content

Commit

Permalink
fix tests p2
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinier Koops committed Jul 8, 2024
1 parent df2851f commit 1888f25
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_Skorecard_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_passing_kwargs(df):
skorecard_model = Skorecard(
bucketing=bucketer,
variables=features,
lr_kwargs={"penalty": "none", "C": 1, "multi_class": "ovr", "n_jobs": 1, "max_iter": int(1e3)},
lr_kwargs={"penalty": None, "C": 1, "multi_class": "ovr", "n_jobs": 1, "max_iter": int(1e3)},
)
skorecard_model.fit(X, y)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_bucketer_WoEBucketer.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def test_woe_in_pipeline(df):
)

out = pipeline.fit_transform(X, y)
assert all(out.dtypes is float)
assert out.select_dtypes(include=[float]).shape[1] == out.shape[1]
npt.assert_almost_equal(out["LIMIT_BAL"][0], 0.566607, decimal=4)
npt.assert_almost_equal(out["LIMIT_BAL"][1], -0.165262, decimal=4)
npt.assert_almost_equal(out["LIMIT_BAL"][3], -0.031407, decimal=4)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_linear_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_results(X_y):
"""Test the actual p-values."""
expected_approx_p_val_coef_ = np.array([[1.0, 1.0, 0.0, 0.8425]])

lr = LogisticRegression(fit_intercept=True, penalty="none").fit(*X_y, calculate_stats=True)
lr = LogisticRegression(fit_intercept=True, penalty=None).fit(*X_y, calculate_stats=True)

np.testing.assert_array_almost_equal(lr.p_val_coef_, expected_approx_p_val_coef_, decimal=3)

Expand Down
4 changes: 4 additions & 0 deletions tests/test_sklearn_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
estimator_checks.check_pipeline_consistency,
estimator_checks.check_estimators_nan_inf,
estimator_checks.check_estimators_overwrite_params,
estimator_checks.check_estimator_sparse_matrix,
estimator_checks.check_estimator_sparse_array,
)


Expand Down Expand Up @@ -104,6 +106,8 @@ def flatten(nested_iterable):
"check_fit2d_1sample",
"check_methods_subset_invariance",
"check_estimators_nan_inf",
"check_estimator_sparse_matrix",
"check_estimator_sparse_array",
"check_estimators_empty_data_messages",
"check_transformer_data_not_an_array",
"check_dtype_object",
Expand Down

0 comments on commit 1888f25

Please sign in to comment.