OCDocker.OCScore.Utils.DescriptorAggregateBaselines module¶
Simple row-wise baseline scores for OCScore comparisons.
Two families are supported:
Descriptor aggregates (
descriptor_aggregate): mean/median/max/min over all model input features (same matrix passed to the network, after export scaler).SF consensus (
sf_consensus): mean/median/max/min over scoring-function columns only (Vina, Gnina, Smina, PLANTS, ODDT, …), matching historicalSimpleConsensussemantics.
- OCDocker.OCScore.Utils.DescriptorAggregateBaselines.evaluate_descriptor_aggregate_baselines_on_fold(feature_matrix, validation_indices, labels, groups, *, metric_names, bedroc_alpha=20.0, infer_higher_is_better, aggregators=('mean', 'median', 'max', 'min'))[source]¶
Evaluate descriptor-row aggregates on one validation fold.
- Parameters:
feature_matrix (ndarray)
validation_indices (ndarray)
labels (ndarray)
groups (ndarray | None)
metric_names (Sequence[str])
bedroc_alpha (float)
infer_higher_is_better (Callable[[ndarray, ndarray], bool])
aggregators (Sequence[str])
- Return type:
dict[str, dict[str, float]]
- OCDocker.OCScore.Utils.DescriptorAggregateBaselines.evaluate_descriptor_aggregates_by_group(feature_matrix, validation_indices, labels, groups, *, metric_names, bedroc_alpha=20.0, infer_higher_is_better, aggregators=('mean', 'median', 'max', 'min'))[source]¶
Per-receptor metrics for descriptor-row aggregates.
- Parameters:
feature_matrix (ndarray)
validation_indices (ndarray)
labels (ndarray)
groups (ndarray)
metric_names (Sequence[str])
bedroc_alpha (float)
infer_higher_is_better (Callable[[ndarray, ndarray], bool])
aggregators (Sequence[str])
- Return type:
Mapping[str, DataFrame]
- OCDocker.OCScore.Utils.DescriptorAggregateBaselines.evaluate_sf_consensus_baselines_on_fold(dataframe, validation_indices, scoring_columns, labels, groups, *, metric_names, bedroc_alpha=20.0, infer_higher_is_better, aggregators=('mean', 'median', 'max', 'min'))[source]¶
Evaluate SF-only row aggregates on one validation fold.
- Parameters:
dataframe (DataFrame)
validation_indices (ndarray)
scoring_columns (Sequence[str])
labels (ndarray)
groups (ndarray | None)
metric_names (Sequence[str])
bedroc_alpha (float)
infer_higher_is_better (Callable[[ndarray, ndarray], bool])
aggregators (Sequence[str])
- Return type:
dict[str, dict[str, float]]
- OCDocker.OCScore.Utils.DescriptorAggregateBaselines.evaluate_sf_consensus_by_group(dataframe, validation_indices, scoring_columns, labels, groups, *, metric_names, bedroc_alpha=20.0, infer_higher_is_better, aggregators=('mean', 'median', 'max', 'min'))[source]¶
Per-receptor metrics for SF-only row aggregates.
- Parameters:
dataframe (DataFrame)
validation_indices (ndarray)
scoring_columns (Sequence[str])
labels (ndarray)
groups (ndarray)
metric_names (Sequence[str])
bedroc_alpha (float)
infer_higher_is_better (Callable[[ndarray, ndarray], bool])
aggregators (Sequence[str])
- Return type:
Mapping[str, DataFrame]
- OCDocker.OCScore.Utils.DescriptorAggregateBaselines.format_descriptor_aggregate_scorer(aggregator)[source]¶
Return display key for a descriptor-row aggregate (e.g.
desc_mean).- Parameters:
aggregator (str)
- Return type:
str
- OCDocker.OCScore.Utils.DescriptorAggregateBaselines.format_sf_consensus_scorer(aggregator)[source]¶
Return display key for an SF-only row aggregate (e.g.
sf_mean).- Parameters:
aggregator (str)
- Return type:
str
- OCDocker.OCScore.Utils.DescriptorAggregateBaselines.row_aggregate_feature_scores(feature_matrix, aggregators=('mean', 'median', 'max', 'min'))[source]¶
Aggregate each row of a feature matrix with simple reducers.
- Parameters:
feature_matrix (np.ndarray) – Shape
(n_rows, n_features).aggregators (Sequence[str], optional) – Reducers to apply. Supported:
mean,median,max,min.
- Returns:
One score vector per aggregator name (unprefixed keys).
- Return type:
dict[str, np.ndarray]
- OCDocker.OCScore.Utils.DescriptorAggregateBaselines.row_aggregate_sf_scores(dataframe, scoring_columns, row_indices=None, aggregators=('mean', 'median', 'max', 'min'))[source]¶
Aggregate each row across scoring-function columns only.
- Parameters:
dataframe (pd.DataFrame) – Reduced DUDEz (or full) table containing SF columns.
scoring_columns (Sequence[str]) – Scoring-function column names (e.g.
vina_vina).row_indices (np.ndarray | None, optional) – Optional positional row subset (
iloc), matching export split indices. When None, use all rows.aggregators (Sequence[str], optional) – Row reducers to apply.
- Returns:
One score vector per aggregator name (unprefixed keys).
- Return type:
dict[str, np.ndarray]