ScoreAnswer
class ScoreAnswer extends Answer
Methods
array
toArray()
Get the instance as an array.
__construct(float $score, array $probabilities, array $legend, float|null $confidence = null)
Create a new score answer instance.
int
level()
Get the most probable level.
string|array|null
label()
Get the description of the most probable level.
float
normalized()
Get the score as a fraction of the highest level.
Details
at line 56
array
toArray()
Get the instance as an array.
in
Answer at line 20
array
jsonSerialize()
Get the JSON serializable representation of the instance.
at line 17
__construct(float $score, array $probabilities, array $legend, float|null $confidence = null)
Create a new score answer instance.
at line 28
int
level()
Get the most probable level.
at line 40
string|array|null
label()
Get the description of the most probable level.
at line 48
float
normalized()
Get the score as a fraction of the highest level.