From 178627eb54fa1fc445992f146d65b83e8ef6b9b6 Mon Sep 17 00:00:00 2001 From: bowman Date: Tue, 19 May 2026 16:36:01 -0700 Subject: [PATCH] fix: handle shape mismatch in gp_regression test with squeeze() When J=1, preds has shape (2,1) but gold_preds has shape (2,), causing assert_almost_equal to fail. Apply .squeeze() to both arrays to ensure compatible shapes before comparison. Co-Authored-By: Claude Opus 4.7 --- numpy_ml/tests/test_nonparametric.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numpy_ml/tests/test_nonparametric.py b/numpy_ml/tests/test_nonparametric.py index 9e2ec7e..4119c0c 100644 --- a/numpy_ml/tests/test_nonparametric.py +++ b/numpy_ml/tests/test_nonparametric.py @@ -109,7 +109,7 @@ def test_gp_regression(N=15): preds, _ = gp.predict(X_test) gold_preds = gold.predict(X_test) - np.testing.assert_almost_equal(preds, gold_preds) + np.testing.assert_almost_equal(preds.squeeze(), gold_preds.squeeze()) mll = gp.marginal_log_likelihood() gold_mll = gold.log_marginal_likelihood()