Skip to content

Start a classifier retrain from the job form - #1504

Open
mohamedelabbas1996 wants to merge 3 commits into
feat/retrain-training-jobfrom
feat/retrain-job-form
Open

mohamedelabbas1996 wants to merge 3 commits into
feat/retrain-training-jobfrom
feat/retrain-job-form

Conversation

@mohamedelabbas1996

Copy link
Copy Markdown
Contributor

Lets someone start a retrain from the job form. Split out of #1494, which this replaces.

The form only made processing jobs, so retraining had to be posted by hand - out of reach of the people the feature is for.

The form

The type is the first question, and the processing fields and the retraining fields are the two branches of that choice:

The job type dropdown, offering Process captures and Retrain classifier

The retraining fields: algorithm, occurrence set, held out for testing, minimum crops per species

Only algorithms a processing service reports as trainable are offered:

The algorithm dropdown, listing one trainable algorithm

It says what the run would learn from

A split ratio is unanswerable without knowing what is behind it. With no set chosen the numbers are every verified occurrence in the project, which is what a run without a set does. Crops with no embedding from the chosen algorithm are named rather than quietly dropped:

Stats for every verified occurrence: 11 crops, 11 occurrences, 2 species, split 10 and 1

Choosing a set narrows them:

The occurrence set dropdown

Stats for the chosen set: 6 crops, 6 occurrences, 1 species, split 5 and 1

The settings are editable per run and the numbers follow. A held-out share of 0.5 moves the split:

The same set with the ratio at 0.5: split 3 and 3

Raising the minimum crops per species drops what cannot be learned, and says so:

Minimum crops per species at 5: two species become one trainable

A setting no run could use is refused on the field, and not asked about:

A held-out share of 1.5, refused

Saved runs appear in the list, typed:

Both runs in the jobs list, typed as Train classifier

Patterns

Modelled on capture-set-details-form.tsx, which is the closest existing form of this shape: watch on the field that switches the rest, FormController + InputContent, pickers at the foot of the file as SamplingTypePicker is, fixed choices as a local options array, and the summary hook using getFetchUrl with a convertServerRecord like useStatus. All copy goes through translate(STRING.*).

Two fixes found while testing it from the browser: an empty setting was sent as "" and would have failed the run when read as a number, and the jobs list showed a blank Type for every retrain because its label map was missing the new type.

Stack

#1462 embeddings  ->  #1501 plumbing  ->  #1502 training set  ->  #1503 training job  ->  this

The job form only made processing jobs. Retraining had to be posted by hand, which
put it out of reach of the people the feature is for.

The form now asks for the job type first, and the processing fields and the
retraining fields are the two branches of that choice. Retraining asks for the
algorithm, an optional occurrence set, and the two settings worth changing per run.

The occurrence set is optional and empty means every verified occurrence in the
project, which is the ordinary case. A split ratio is unanswerable without knowing
what is behind it, so the form reports what the run would learn from - crops,
occurrences, species, and how the split falls - and re-reads it as the set or the
ratio changes. Verified crops with no embedding from the chosen algorithm are
called out, since they are silently left out of the run.
Leaving a setting empty means "use the algorithm's own", but the empty field was
sent as an empty string, which the job then tried to read as a number and failed
on at run time. Empty fields are left out of the params instead.

A ratio outside the valid range is also no longer asked about: the field already
reports it, and the summary request behind it could only come back as an error.
The list reads its type labels from a map that the new type was missing from, so
every retraining run showed a blank Type while the API was already naming it.
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4d05f34f-f9ea-4058-bfd4-815a41e7e147

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for antenna-preview ready!

Name Link
🔨 Latest commit b8e9fe9
🔍 Latest deploy log https://app.netlify.com/projects/antenna-preview/deploys/6ac875b5948f0700093465ff
😎 Deploy Preview https://deploy-preview-1504--antenna-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 56 (🔴 down 9 from production)
Accessibility: 81 (🔴 down 8 from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 92 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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