io_models
Input and output specification models for analyses.
Inputs
pydantic-model
¶
Bases: BaseModel
Represents the inputs of the analysis.
Fields:
-
recording(RecordingInput | None) -
events(list[EventType] | None) -
metadata(list[MetadataType] | None)
Validators:
events = None
pydantic-field
¶
The list of typed event that the analysis requires in the input.
metadata = None
pydantic-field
¶
Optional list of metadata type input for the analysis, e.g., 'age'.Can be None if the analysis does not require metadata.
recording
pydantic-field
¶
The recording input for the analysis. Can be None if the analysis does not require a recording input.
validate_at_least_one_input(data)
pydantic-validator
¶
Validate that at least one of 'recording', 'events' and 'metadata' is set.
Outputs
pydantic-model
¶
Bases: BaseModel
Defines the output of the analysis.
Fields:
-
score(ScorePresentation | None) -
supports_full_probabilistic_output(bool) -
events(list[EventType])
Validators:
events
pydantic-field
¶
The list of typed event that the analysis outputs.
score = None
pydantic-field
¶
How the score of a probabilistic event is shown. None: the analysis declares no term for it, and a host shows no score.
supports_full_probabilistic_output = False
pydantic-field
¶
Whether the analysis supports outputting full probabilistic distributions (all class probabilities per prediction, not just argmax). When true, users can request overlapping events with probability scores for all classes.
validate_probabilistic_consistency()
pydantic-validator
¶
Validate probabilistic output consistency.
If supports_full_probabilistic_output is True, all event types must be probabilistic.
validate_score_has_a_probabilistic_event()
pydantic-validator
¶
Refuse a score presentation on an analysis whose events carry no score.
ScorePresentation
pydantic-model
¶
Bases: BaseModel
How a host shows the score each probabilistic event carries (its probability).
The score is what the analysis puts out, under the term its labelling gives it and at the precision it declares: never a confidence, a probability that the label is correct, or a band of levels. The note says so where the score is shown.
Fields:
decimals = 2
pydantic-field
¶
The decimal places the score is shown to.
note = None
pydantic-field
¶
One sentence shown with the score: what it is not, as the labelling states it.
term
pydantic-field
¶
What the score is called where it is shown, as the analysis's labelling names it, e.g. 'Stage score'.