Skip to content

Train Classifier

POST
/api/divinity/project-classifier/train

Train (or skip) the project’s classifier.

Returns the resulting status + skip flags so the UI can show “trained successfully” vs “skipped because nothing changed” vs “skipped because corpus too small” without re-querying.

TrainProjectClassifierRequest

Body for POST /api/divinity/project-classifier/train.

object
projectId
required
Projectid
string
>= 1 characters <= 128 characters
force
Force
boolean

Successful Response

TrainProjectClassifierResponse

Response body for the non-streaming train route.

object
status
required
ProjectClassifierStatus

Snapshot of one project’s classifier state.

Persisted to data/ml/project-{id}/classifiers/meta.json; served by GET /api/divinity/project-classifier/status.

is_low_quality flips on when the trained classifier’s cross-validated F1 macro falls below low_quality_cv_f1_threshold (default 0.40). Predictions are still served — the UI surfaces the flag so the author knows the model trained on insufficient or noisy signal and that confident predictions may be wrong.

object
projectId
required
Projectid
string
trained
required
Trained
boolean
legendryHash
Any of:
string
trainedAt
Any of:
string format: date-time
nExamples
Nexamples
integer
0
labels
Labels
Array<string>
metrics
Metrics
object
key
additional properties
number
insufficientCorpus
Insufficientcorpus
boolean
insufficientCorpusReason
Any of:
string
isLowQuality
Islowquality
boolean
lowQualityReason
Any of:
string
engineVersion
Engineversion
string
default: 1.0.0
skipped
Skipped
boolean
skipReason
Any of:
string

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object