aito.client.v2.responses.V2Hit

class aito.client.v2.responses.V2Hit(json: Dict)

Bases: object

A single hit of a rows response

User columns are read by name; the computed columns keep the $ prefix they were requested with in select ($p, $value, $why), which is why they are guaranteed not to collide with a user column.

Parameters:

json (Dict) – the content of the hit

Methods

get(item[, default])

read a field of the hit, returning default when it is absent

Attributes

json

the raw content of the hit

probability

the $p of a predict, recommend or match hit

value

the predicted value, i.e. $value.

why

the $why explanation tree

get(item, default=None)

read a field of the hit, returning default when it is absent

Return type:

Any

property json: Dict

the raw content of the hit

Return type:

Dict

property probability: float

the $p of a predict, recommend or match hit

Raises:

KeyError$p was not selected

Return type:

float

property value: Any

the predicted value, i.e. $value

v2 names this $value; v1 named it feature. The SDK does not alias it back — see docs/v2-client-design.md.

Raises:

KeyError$value was not selected

Return type:

Any

property why: Dict

the $why explanation tree

Raises:

KeyError$why was not selected

Return type:

Dict