Result Class
ml_debugger.result.base.result.Result
Bases: ABC
Base class for ML evaluation results.
Manages polling for evaluation completion, issue retrieval, and provides abstract methods for summarizing and viewing results.
属性:
| 名前 | タイプ | デスクリプション |
|---|---|---|
result_id |
str
|
Unique evaluation job identifier. |
result_name |
str
|
Alias for the evaluation result. |
model_name |
str
|
Name of the evaluated model. |
version_name |
str
|
Version identifier of the evaluated model. |
service_client |
ServiceClient
|
Client interface for API calls. |
evaluation_completed |
bool
|
True once evaluation has finished. |
issues_data |
Optional[Dict[str, Any]]
|
Cached issues once retrieved. |
__init__(result_id, result_name, model_name, version_name, service_client)
Initialize the Result and wait for evaluation completion.
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
|
str
|
Unique identifier of the evaluation job. |
必須 |
|
str
|
User-facing alias for the result. |
必須 |
|
str
|
Name of the evaluated model. |
必須 |
|
str
|
Version of the evaluated model. |
必須 |
|
ServiceClient
|
Client for service API interactions. |
必須 |
metrics_summary(dataset_type=None)
issue_category_summary(dataset_type=None)
get_summary(dataset_type=None)
Print a formatted summary of evaluation results to stdout.
Template method: renders the shared section skeleton (evaluation
metadata, optional analysis note, per-dataset_type category detail,
and the trailing term-definition block) identically for every task. The
only task-specific pieces are supplied by overridable hooks /
class attributes: :meth:_build_category_metric_lines (per-category
Metrics: rows), :attr:_ERROR_CODE_PAD (ErrorCodes column width),
and :attr:_TERM_DEFINITION (error-code legend).
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
|
Optional[str]
|
dataset_type filter. |
None
|
get_issues()
Retrieve list of issues.
戻り値:
| タイプ | デスクリプション |
|---|---|
DataFrame
|
The final evaluation result from the server |
get_view(*args, **kwargs)
abstractmethod
Retrieve the final evaluation result.
戻り値:
| タイプ | デスクリプション |
|---|---|
DataFrame
|
pd.DataFrame: summary of the evaluation result |
get_heatmap(x_axis=None, y_axis=None, target=None, n_bins=20, dataset_type=None, aggregation_level='input_id', bbox_strategy=None, input_strategy=None, property_filters=None, sequence_mapping=None)
Fetch a heatmap for the requested configuration (one server call).
Returns a :class:~ml_debugger.visualization.schemas.Heatmap. Render it
with .show() (display), .to_figure() (Figure only) or
.save(path); subtract two heatmaps (hm_a - hm_b) for a
:class:~ml_debugger.visualization.schemas.HeatmapDelta. Rendering
options (mode / cmap / color_scale / figsize) live on
those methods, so the fetched data can be re-rendered without another
server call.
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
|
str | None
|
X-axis column key. |
None
|
|
str | None
|
Y-axis column key. |
None
|
|
str | None
|
Target column key used for error coloring. |
None
|
|
int
|
Bins per axis (1-100). |
20
|
|
str | None
|
Which dataset to read out of the result (e.g.
|
None
|
|
Literal['bbox', 'input_id', 'sequence']
|
|
'input_id'
|
|
Union[BBoxStrategy, Dict[str, Any], str] | None
|
BBox aggregation/filter config (same shape as
DataFilter's |
None
|
|
Union[SequenceAggregation, Dict[str, Any], str] | None
|
Sequence aggregation config; may be a yaml/json path. |
None
|
|
Dict[str, List[Any]] | None
|
Additional discrete filters keyed by column
name (e.g. |
None
|
|
Dict[str, Any] | None
|
Explicit input_id -> sequence_id mapping for
sequence aggregation. |
None
|
戻り値:
| 名前 | タイプ | デスクリプション |
|---|---|---|
Heatmap |
Union[Heatmap, HeatmapGroup]
|
single-dataset flattened heatmap. |
発生:
| タイプ | デスクリプション |
|---|---|
ValueError
|
|
get_note(analysis_type='performance_analyst', language=None, use_cached=True, wait=True, timeout=600.0, polling_interval=5.0)
Fetch (or generate) a plain-language analysis note for this result.
Returns the latest completed performance_analyst note when one exists
(default use_cached=True); otherwise triggers the server-side analysis,
waits for it to finish, and returns an
:class:~ml_debugger.result.note.AnalysisNote. Render it with .show()
/ print(note) (terminals) or just evaluate it in Jupyter (markdown).
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
|
str
|
Recipe name (default |
'performance_analyst'
|
|
str | None
|
Language for the note (e.g. |
None
|
|
bool
|
When |
True
|
|
bool
|
When |
True
|
|
float
|
Max seconds to wait for completion ( |
600.0
|
|
float
|
Seconds between status polls. |
5.0
|
戻り値:
| タイプ | デスクリプション |
|---|---|
Any
|
AnalysisNote when |
発生:
| タイプ | デスクリプション |
|---|---|
ValueError
|
Local mode (agentic analyses need the API server). |
ConflictError
|
Result not completed / an analysis is already running. |
UnprocessableEntityError
|
Unsupported task on the server side. |
NotFoundError
|
Server without agentic-analysis support. |
APIError
|
Analysis FAILED, timed out, or other transport errors. |
recommend_heatmaps(analysis_type='heatmap_advisor', language=None, use_cached=True, wait=True, timeout=600.0, polling_interval=5.0)
Recommend heatmap views that surface where this model errs.
Returns the latest completed heatmap_advisor advice when one exists
(default use_cached=True); otherwise triggers the server-side analysis,
waits for it to finish, and returns a
:class:~ml_debugger.result.heatmap_advice.HeatmapAdvice. The advice pairs a
plain-language note with recommended heatmap views: render the note with
.show_note() / print(advice.note) (terminals) or evaluate the advice
in Jupyter (markdown), list the views with advice.summary(), and fetch a
view with advice.get_heatmap(0).show() (cache-first, so it is fast).
Supported for classification / object_detection / object_detection_3d (all three tasks; no client-side gate).
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
|
str
|
Recipe name (default |
'heatmap_advisor'
|
|
str | None
|
Language for the note (e.g. |
None
|
|
bool
|
When |
True
|
|
bool
|
When |
True
|
|
float
|
Max seconds to wait for completion ( |
600.0
|
|
float
|
Seconds between status polls. |
5.0
|
戻り値:
| タイプ | デスクリプション |
|---|---|
Any
|
HeatmapAdvice when |
発生:
| タイプ | デスクリプション |
|---|---|
ValueError
|
Local mode (agentic analyses need the API server). |
ConflictError
|
Result not completed / an analysis is already running. |
UnprocessableEntityError
|
Unsupported task on the server side. |
NotFoundError
|
Server without agentic-analysis support. |
APIError
|
Analysis FAILED, timed out, agent analysis is disabled in user settings, or other transport errors. |
recommend_al_strategy(n_data=None, dataset_type=None, language=None, analysis_type='al_strategy_recommender', use_cached=False, wait=True, timeout=300.0, polling_interval=3.0, **agent_args)
Recommend an Active-Learning data-collection strategy for this result.
Triggers the server-side al_strategy_recommender agentic analysis, waits
for it to finish, and returns an :class:ALRecommendation whose
query_strategy feeds DataFilter.query(strategy=rec) and whose
heatmap params drive :meth:ALRecommendation.get_heatmap.
Supported tasks: classification / object_detection /
object_detection_3d. The server owns this list and answers with the
reason when a task is not supported, so it can widen without an SDK upgrade.
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
|
int | None
|
Labeling budget (images / sequences). It is echoed back in the
recommendation and used by |
None
|
|
str | None
|
Evaluation split to analyse (e.g. |
None
|
|
str | None
|
Language for |
None
|
|
str
|
Recipe name (default |
'al_strategy_recommender'
|
|
bool
|
When |
False
|
|
bool
|
When |
True
|
|
float
|
Max seconds to wait for completion ( |
300.0
|
|
float
|
Seconds between status polls. |
3.0
|
|
Any
|
Additional options for the analysis, forwarded as given
— e.g. |
{}
|
戻り値:
| タイプ | デスクリプション |
|---|---|
Any
|
ALRecommendation when |
発生:
| タイプ | デスクリプション |
|---|---|
ValueError
|
Local mode (the analysis runs on the server). |
ConflictError
|
Result not completed / different-parameter analysis running. |
UnprocessableEntityError
|
Unsupported task on the server side. |
NotFoundError
|
Server without agentic-analysis support. |
APIError
|
Analysis FAILED, timed out, or other transport errors. |