Skip to content

fix: handle shape mismatch in gp_regression test with squeeze()#102

Open
bugparty wants to merge 1 commit into
ddbourgin:masterfrom
bugparty:worktree-agent-a16d3a29da81d0ab4
Open

fix: handle shape mismatch in gp_regression test with squeeze()#102
bugparty wants to merge 1 commit into
ddbourgin:masterfrom
bugparty:worktree-agent-a16d3a29da81d0ab4

Conversation

@bugparty
Copy link
Copy Markdown

Summary

  • In test_gp_regression, when J=1, preds has shape (2,1) but gold_preds has shape (2,), causing assert_almost_equal to fail due to shape mismatch
  • Fix by applying .squeeze() to both arrays before comparison, ensuring compatible shapes regardless of J

Test plan

  • Ran test_gp_regression directly — all 3 iterations passed
  • Full test suite (pytest numpy_ml/tests/test_nonparametric.py) — blocked by pre-existing Python 3.13 import error (collections.Hashable removed), unrelated to this change

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant