PositiveTrainerSuite
Bases: TrainerSuite
TrainerSuite for ordered / positive-vs-negative pair semantics.
Source code in gradiend/trainer/suite/positive.py
negative_class_fn
instance-attribute
positive_feature_definitions
instance-attribute
positive_feature_definitions = _normalize_positive_feature_definitions(positive_feature_definitions)
_build_all_but_one_feature_class_group_pair_definitions
Source code in gradiend/trainer/suite/positive.py
_build_all_but_one_feature_pair_definitions
Source code in gradiend/trainer/suite/positive.py
_build_single_pair_definitions
Source code in gradiend/trainer/suite/positive.py
_prepare_child_trainer_kwargs
Source code in gradiend/trainer/suite/positive.py
_resolve_pair_definitions
Source code in gradiend/trainer/suite/positive.py
_resolved_positive_feature_definitions
Source code in gradiend/trainer/suite/positive.py
compute_trainer_pair_encoding_matrix
compute_trainer_pair_encoding_matrix(*, label_mapping=None, full_eval=True, encoder_eval='auto', allow_incomplete=False, **kwargs)
Compute positive-pair trainerĂ—trainer encoding matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label_mapping
|
Optional[Dict[str, str]]
|
Optional child-id to display-label mapping. |
None
|
full_eval
|
bool
|
Whether child encoder evaluation should include all available transitions. |
True
|
encoder_eval
|
str
|
Encoder evaluation policy: |
'auto'
|
allow_incomplete
|
bool
|
If True, tolerate missing child encoder results. |
False
|
**kwargs
|
Any
|
Forwarded to trainer-pair encoding computation. |
{}
|
Source code in gradiend/trainer/suite/positive.py
evaluate_encoder
plot_cross_encoding_heatmap
plot_cross_encoding_heatmap(*, label_mapping=None, pretty_groups=None, split='test', max_size=None, use_cache=True, metric='positive_mean', full_eval=True, encoder_eval='auto', allow_incomplete=False, seed_selection=None, seed_aggregate='mean', dispersion=None, normalize=False, order='input', cluster=False, row_label_mapping=None, column_label_mapping=None, **plot_kwargs)
Plot positive-pair cross-encoding heatmap.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label_mapping
|
Optional[Dict[str, str]]
|
Optional child-id to display-label mapping. |
None
|
pretty_groups
|
Optional[Dict[str, List[str]]]
|
Optional display groups. |
None
|
split
|
str
|
Encoder split used when running evaluation. |
'test'
|
max_size
|
Optional[int]
|
Optional encoder-evaluation cap. |
None
|
use_cache
|
bool
|
Whether to use child evaluation/model caches. |
True
|
metric
|
str
|
Cross-encoding metric to plot. |
'positive_mean'
|
full_eval
|
bool
|
Whether child encoder evaluation includes all transitions. |
True
|
encoder_eval
|
str
|
Encoder evaluation policy: |
'auto'
|
allow_incomplete
|
bool
|
If True, tolerate missing child encoder results. |
False
|
seed_selection
|
Optional[str]
|
Optional seed selection for multi-seed children. |
None
|
seed_aggregate
|
str
|
Aggregate used for seed-level cross encoding. |
'mean'
|
dispersion
|
Optional[str]
|
Optional seed dispersion statistic. |
None
|
normalize
|
bool
|
If True, normalize rows by diagonal values. |
False
|
order
|
Any
|
Heatmap ordering strategy or explicit order. |
'input'
|
cluster
|
bool
|
If True, cluster heatmap rows/columns. |
False
|
row_label_mapping
|
Optional[Dict[str, str]]
|
Optional row display labels. |
None
|
column_label_mapping
|
Optional[Dict[str, str]]
|
Optional column display labels. |
None
|
**plot_kwargs
|
Any
|
Forwarded to comparison heatmap plotting. |
{}
|