MolecularDiffusion.utils.plot_function¶
Functions¶
|
Plot a scatter plot comparing predicted vs. true values, with marginal histograms. |
|
Plot a correlation scatter plot between predicted and true values, |
|
Plot a 2D embedding with optional labels (for classification or regression). |
|
Plot a histogram of the distribution for a single target. |
|
Plot the Kernel Density Estimate (KDE) of a single target distribution. |
|
Plot KDEs of multiple target distributions on the same axes. |
Module Contents¶
- MolecularDiffusion.utils.plot_function.plot_correlation_with_histograms(true_values: numpy.ndarray, predicted_values: numpy.ndarray, property_name: str = 'E', unit: str = 'eV', output_path: str | None = None) None¶
Plot a scatter plot comparing predicted vs. true values, with marginal histograms.
- Parameters:
true_values (np.ndarray) – True target values.
predicted_values (np.ndarray) – Predicted target values.
property_name (str) – Name of the property (for axis labels). Default is “E”.
unit (str) – Unit of the property. Default is “eV”.
output_path (Optional[str]) – If provided, path to save the figure.
- MolecularDiffusion.utils.plot_function.plot_correlation_with_kde(true_values: numpy.ndarray, predicted_values: numpy.ndarray, property_name: str = 'E', output_path: str | None = None) None¶
Plot a correlation scatter plot between predicted and true values, with probability density coloring, R² and MAE.
- Parameters:
- MolecularDiffusion.utils.plot_function.plot_embedding(embedding: numpy.ndarray, labels: numpy.ndarray | None = None, label_names: str | List[str] | None = None, label_type: str = 'reg', output_path: str = 'tSNE.png') None¶
Plot a 2D embedding with optional labels (for classification or regression).
- Parameters:
embedding (np.ndarray) – 2D array of shape (n_samples, 2) representing t-SNE embedding.
labels (Optional[np.ndarray]) – 1D array of target labels (regression values or class indices).
label_names (Optional[Union[str, List[str]]]) – Name of the regression label or list of class names.
label_type (str) – Type of label (“reg” for regression, “class” for classification).
output_path (str) – Path to save the output image. Defaults to ‘tSNE.png’.
- MolecularDiffusion.utils.plot_function.plot_histogram_distribution(predictions: numpy.ndarray, task_name: str, output_path: str | None = None, num_bins: int = 50) None¶
Plot a histogram of the distribution for a single target.
- MolecularDiffusion.utils.plot_function.plot_kde_distribution(predictions: numpy.ndarray, task_name: str, output_path: str | None = None) None¶
Plot the Kernel Density Estimate (KDE) of a single target distribution.