From 533d5362a4cc2aeda5a9ee9e645c3f3a463318a2 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Schmidt Date: Wed, 19 Feb 2025 11:23:04 -0500 Subject: [PATCH] forgot some --- src/glum_benchmarks/bench_liblinear.py | 2 +- src/glum_benchmarks/util.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/glum_benchmarks/bench_liblinear.py b/src/glum_benchmarks/bench_liblinear.py index 2890dbcd..dd30f2d3 100644 --- a/src/glum_benchmarks/bench_liblinear.py +++ b/src/glum_benchmarks/bench_liblinear.py @@ -92,7 +92,7 @@ def liblinear_bench( solver="liblinear", ) - fit_args = dict( + fit_args = dict( # type: ignore X=X, y=dat["y"].astype(np.int64).copy(), sample_weight=dat.get("sample_weight"), diff --git a/src/glum_benchmarks/util.py b/src/glum_benchmarks/util.py index cd1b80ab..a061dbc1 100644 --- a/src/glum_benchmarks/util.py +++ b/src/glum_benchmarks/util.py @@ -108,8 +108,8 @@ def get_obj_val( X_dot_coef += offset zeros = np.zeros(dat["X"].shape[0]) - y = dat["y"].astype(coefs.dtype) - weights = dat.get("weights", np.ones_like(y)).astype(coefs.dtype) + y = dat["y"].astype(coefs.dtype) # type: ignore + weights = dat.get("weights", np.ones_like(y)).astype(coefs.dtype) # type: ignore weights /= weights.sum() P1 = l1_ratio * alpha * np.ones_like(coefs) P2 = (1 - l1_ratio) * alpha * np.ones_like(coefs)