ncem.train.GridSearchContainer.plot_best_model_by_hyperparam
- GridSearchContainer.plot_best_model_by_hyperparam(graph_model_class: str, baseline_model_class: str, partition_show: str = 'test', metric_show: str = 'r_squared_linreg', partition_select: str = 'val', metric_select: str = 'r_squared_linreg', param_x: str = 'um_radius', param_hue: str = 'model', rename_levels: Optional[List[Tuple[str, str]]] = None, subset_hyperparameters: Optional[List[Tuple[str, str]]] = None, cv_mode: str = 'mean', yaxis_limit: Optional[Tuple[float, float]] = None, xticks: Optional[List[int]] = None, rotate_xticks: bool = True, figsize: Tuple[float, float] = (3.5, 4.0), fontsize: Optional[int] = None, example_cellradius: Optional[int] = 10, plot_mode: str = 'lineplot', palette: Optional[dict] = {'NCEM': 'C1', 'baseline': 'C0'}, color: Optional[str] = None, save: Optional[str] = None, suffix: str = 'best_by_hyperparam.pdf', show: bool = True, return_axs: bool = False)[source]
Plot best model by hyperparameter.
- Parameters
graph_model_class (str) – Graph model class.
baseline_model_class (str) – Baseline model class.
partition_show (str) – Showing partition.
metric_show (str) – Showing metric.
partition_select (str) – Selected partition.
metric_select (str) – Selected metric.
param_x (str) – Parameter on x axis.
param_hue (str) – Parameter for hue.
rename_levels (list, optional) – Rename levels with stated logic.
subset_hyperparameters (list, optional) – Subset hyperparameters.
cv_mode (str) – Cross validation mode.
yaxis_limit (tuple, optional) – y axis limits.
xticks (list, optional) – List of x ticks.
rotate_xticks (bool) – Whether to rotate x ticks.
figsize (tuple) – Figure size.
fontsize (int, optional) – Font size.
plot_mode (str) – Plotting mode, can be boxplot, lineplot or mean_lineplot.
palette (dict, optional) – Palette.
color (str, optional) – Color.
save (str, optional) – Whether (if not None) and where (path as string given as save) to save plot.
suffix (str) – Suffix of file name to save to.
show (bool) – Whether to display plot.
return_axs (bool) – Whether to return axis objects.
- Returns
- Return type
axis if return_axs is True.