napistu_torch.evaluation.edge_prediction

Edge prediction evaluation utilities.

This module provides functions for evaluating edge prediction performance stratified by edge types or other edge attributes.

Public Functions

summarize_edge_predictions_by_strata(edge_predictions, edge_strata)

Summarize edge prediction performance by strata.

plot_edge_predictions_by_strata(df, x_col=None, y_col=None, y_lower_col=None, y_upper_col=None, count_col=None, figsize=(8, 6))

Create a scatter plot showing prediction probabilities vs. enrichment with error bars.

Functions

plot_edge_predictions_by_strata(df[, x_col, ...])

Create a scatter plot showing prediction probabilities vs. enrichment with error bars.

summarize_edge_predictions_by_strata(...)

napistu_torch.evaluation.edge_prediction._get_observed_over_expected_strata(edge_strata: DataFrame | Series) DataFrame
napistu_torch.evaluation.edge_prediction._get_prediction_by_strata(edge_predictions: List[torch.Tensor], edge_strata: DataFrame | Series)
napistu_torch.evaluation.edge_prediction.plot_edge_predictions_by_strata(df, x_col='log2_observed_over_expected', y_col='average_prediction_probability', y_lower_col='prediction_probability_q025', y_upper_col='prediction_probability_q975', count_col='count', figsize=(8, 6))

Create a scatter plot showing prediction probabilities vs. enrichment with error bars.

Parameters:

dfpd.DataFrame

DataFrame containing the data

x_colstr

Column name for x-axis (log2 observed/expected)

y_colstr

Column name for y-axis (average prediction probability)

y_lower_colstr

Column name for lower bound of prediction probability (2.5th percentile)

y_upper_colstr

Column name for upper bound of prediction probability (97.5th percentile)

count_colstr

Column name for point counts (for coloring)

figsizetuple

Figure size (width, height)

napistu_torch.evaluation.edge_prediction.summarize_edge_predictions_by_strata(edge_predictions: List[torch.Tensor], edge_strata: DataFrame | Series)