Repository navigation
Fix train/test leakage, stale model on edit, and ignored batch size - #1
Merged
Merged
Conversation
- ML-1: fit feature and target scalers on the training split only - ML-2: rebuild the model when any cell changes, not only the row count - ML-3: honour the batch-size setting with averaged mini-batch updates - Remove unused Gemini, express, dotenv and motion dependencies - Rename the package, rewrite the README, add a lockfile, vitest and CI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011GFY8v4QeVYzawpSLcJCzz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes audit findings ML-1 to ML-3, and removes the AI Studio template leftovers.
Correctness
rows.length, so editing a cell kept training the old model on the old data. It now depends onrows.batchSizewas read and then never used; every sample got its own update.NeuralNetwork.trainBatch()now averages gradients over each batch and applies one momentum update.backprop()is kept as a batch-of-one wrapper.Cleanup
@google/genai,express,dotenv,motion,tsxand@types/express, plus.env.example(no API key is needed).react-exampletoforge-spreadsheet-ml.package-lock.jsonand a CI workflow (type check, tests, build).Verification
tests/math.test.ts: 3 of its 4 tests fail on the old code and all 4 pass now.dev/check-cell-edit-resets.cjsis a Playwright check: train 3 epochs, then edit a cell. On the old code the epoch stays at 3; now it resets to 0. No page errors.tsc --noEmitandvite buildboth pass.No licence is added; that choice is the owner's.
Generated by Claude Code