Rapidata flow item
RapidataFlowItem #
RapidataFlowItem(
id: str,
flow_id: str,
openapi_service: OpenAPIService,
flow_type: FlowType = "ranking",
)
Source code in src/rapidata/rapidata_client/flow/rapidata_flow_item.py
get_response_count #
Get the total number of responses for this flow item.
For ranking flow items the count is derived from the win/loss matrix by
summing all entries, which triggers :meth:get_win_loss_matrix. For
classify flow items it is read from the results via :meth:get_results.
Either way this waits for the flow item to finish.
Returns:
| Type | Description |
|---|---|
float | int
|
float | int: The total number of responses collected. |
Source code in src/rapidata/rapidata_client/flow/rapidata_flow_item.py
get_status #
Get the current state of this flow item.
Returns:
| Name | Type | Description |
|---|---|---|
FlowItemState |
FlowItemState
|
The current state (Pending, Running, Completed, Failed, Stopping, Stopped, or Incomplete). |
Source code in src/rapidata/rapidata_client/flow/rapidata_flow_item.py
get_results #
get_results() -> FlowItemResult | ClassifyFlowItemResult
Get the results of this flow item from the API.
Waits until the flow item has reached a terminal state.
Returns:
| Name | Type | Description |
|---|---|---|
FlowItemResult |
FlowItemResult | ClassifyFlowItemResult
|
For ranking flow items, a mapping of asset identifier to elo score and the total number of votes. |
ClassifyFlowItemResult |
FlowItemResult | ClassifyFlowItemResult
|
For classify flow items, the majority category, response distribution and response count per asset identifier, and the total number of responses. |
Source code in src/rapidata/rapidata_client/flow/rapidata_flow_item.py
get_win_loss_matrix #
Get the win/loss matrix of this ranking flow item from the API.
The win/loss matrix shows pairwise comparison counts where data[i][j] is
the number of times row i was preferred over column j.
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: A DataFrame where rows and columns are asset identifiers, and values are win/loss counts. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If this is a classify flow item. |