plot_product#
Warning
The code reference is a work in progress and may contain inconsistencies.
- socialnet.plot.plot_product(model_folder: Path | str, fig_vars: Sequence[str], one_neighbour: bool = True, limitsZ: list[float] | None = None, limitsZD: list[float] | None = None, save_folder: Path | None = None, fig_name_suffix: str = '')[source]#
Plots the combination (product) of
plot.plot_interaction_scores()andplot.plot_aggregation_subnetwork(), visualizing how the interaction and attention subnetworks jointly affect the predicted interaction scores.
Example output with variables
fv nbv nbx nby.#- Parameters:
model_folder (Path | str) – Path to the session folder containing the model.
fig_vars (Sequence[str]) – Variables to use in the map plot, in the order [row_variable, col_variable, x_variable, y_variable]. These determine the axes and grid of the subplots.
one_neighbour (bool, optional) – If True, sets the number of neighbours to 1 when loading the model. If False, uses the default. Default is True.
limitsZ (list[float] | None, optional) – Colorbar limits for the attraction-repulsion score plots. If None, limits are determined automatically. Default is None.
limitsZD (list[float] | None, optional) – Colorbar limits for the alignment score plots. If None, limits are determined automatically. Default is None.
save_folder (Path | None, optional) – Folder to save the resulting figures. If None, saves to model_folder. Default is None.
fig_name_suffix (str, optional) – Suffix to append to the saved figure filenames. Default is “”.
- Returns:
The function saves the generated figures to disk and does not return anything.
- Return type:
None
Notes
This function multiplies the outputs of the attention and pairwise subnetworks to visualize their combined effect on interaction scores. It produces three figures: attraction, alignment, and a combined attraction-alignment plot, each as a grid of contour plots determined by fig_vars and the model’s plot configuration.