Align splitter payloads with schemas and fix split validation - #833
Open
Irozuku wants to merge 17 commits into
Open
Align splitter payloads with schemas and fix split validation#833Irozuku wants to merge 17 commits into
Irozuku wants to merge 17 commits into
Conversation
Resolve the schema form conflicts by adopting develop's excludeFields prop, which is the same escape hatch this branch had added as omitFields, and repoint the splits step at it.
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.
Summary
Splitter configuration forms in the model session wizard are now generated from the backend component
SCHEMA, like models, converters and explainers already are. Previously the holdout section was hand coded JSX and the cross-validation section used the schema only to decide which fields to show.Aligning the stored
splitspayload with the schema keys also fixes four bugs caused by the payload and the splitters disagreeing:seed, splitters readrandom_state.unsupported operand type(s) for /: 'list' and 'list'), because index lists were sent under the keys the splitter reads as proportions.StratifiedKFoldandStratifiedGroupKFoldcrashed with shuffling off, since they passedrandom_stateunconditionally and scikit-learn rejects that pair.Legacy payloads are translated at read time, so existing sessions keep working without a data migration.
Type of Change
Changes (by file)
Backend
splitters/splits_payload.py: new. Normalizes legacy payloads (missingsplitter_name,seedinstead ofrandom_state, index lists under partition names) and collects schema placeholders.splitters/fold_splitter.py: newsklearn_random_state()helper, forwarding a seed only when shuffling is on.splitters/stratified_k_fold.py,stratified_group_k_fold.py: use it, the crash fix.k_fold.py,group_k_fold.py: use it instead of their inline equivalent.splitters/holdout.py: proportions are plain floats instead of nullable, so they render as number inputs; validator requires them to sum to 1.splitters/*_k_fold.py:n_splitscapped at 20,n_repeatsat 10, and theshuffle/random_statedescriptions now note that the seed is ignored without shuffling (all five languages).job/model_job.py: normalize the payload before building the splitter.dataloaders/classes/dashai_dataset.py:prepare_for_model_sessionreads manual indexes fromsplitted_indexesand acceptsrandom_state.api/api_v1/endpoints/model_sessions.py: POST validates the payload against the splitter'sSCHEMA, returning 422. No new route.Frontend
utils/splitsPayload.js: new. Owns the payload contract (buildSplitsPayload,resolveSplitterName,hasPartition).modelSession/SplitDatasetRows.jsx: hand coded parameter controls replaced by oneFormSchema; the shell keeps only what a schema cannot express (strategy toggle, splitter picker, split type toggle, manual indexes,group_column, cross field checks).modelSession/PrepareDatasetStep.jsx: buildssplitsvia the new helper and no longer gates column validation on the splits being ready.shared/FormSchemaRenderFields.jsx: addsexcludeFieldsto the memo dependencies (the prop itself came from develop, see Notes).models/CreateSessionSteps.jsx: picks metric sets viahasPartition.models/SessionInfoContent.jsx: readsrandom_statewith aseedfallback, plus a cross-validation summary.models/LiveMetricsChart.jsx: one line fix for the inverted validation tab.Tests
tests/back/splitters/: new package for the normalizer, holdout schema and index modes, fold caps, session prep, and the shuffle/seed guard.tests/back/api/test_jobs.py,test_model_session_splits_validation.py: end to end training on new and legacy payloads, and 422 on invalid ones.Testing