diff --git a/src/glum/_glm.py b/src/glum/_glm.py index 8c9e73e9..66398940 100644 --- a/src/glum/_glm.py +++ b/src/glum/_glm.py @@ -1972,7 +1972,9 @@ def _set_up_and_check_fit_args( # Backwards compatibility if isinstance(X, pd.DataFrame): - self.feature_dtypes_ = X.dtypes.to_dict() + with warnings.catch_warnings(): + warnings.filterwarnings("ignore") + self.feature_dtypes_ = X.dtypes.to_dict() X = cast(nw.DataFrame, nw.from_native(X)) # avoid inferring `Never` diff --git a/tests/glm/test_glm_regressor.py b/tests/glm/test_glm_regressor.py index 351d1077..30f7bcfd 100644 --- a/tests/glm/test_glm_regressor.py +++ b/tests/glm/test_glm_regressor.py @@ -1212,10 +1212,11 @@ def test_predict_list_categorical(): df["x"] = df["x"].astype("category") df["y"] = df["x"].map({v: k + 1 for k, v in enumerate(letters)}) - regressor = GeneralizedLinearRegressor(alpha=[0, 2], alpha_search=True) - regressor = regressor.fit(df[["x"]], df["y"]) - - candidate = regressor.predict(df[["x"]], alpha=0) + candidate = ( + GeneralizedLinearRegressor(alpha=[0, 2], alpha_search=True, fit_intercept=False) + .fit(df[["x"]], df["y"]) + .predict(df[["x"]], alpha=0) + ) np.testing.assert_allclose(candidate, df["y"])