metbit.plotting
Visualization and apps module in metbit 7.3.10.
import metbit.plottingClasses
Plots
Plot cross validation results
Parameters
cvmodelCrossValidation objectCross validation model constructed in cross_validation module.
Methods
__init__(self, cvmodel)
plot_scores(self, save_plot: bool=False, file_name: str=None)
Plot scores. If OPLS/OPLS-DA is specified, the score plot for OPLS/OPLS-DA is used, i.e., the first component of orthogonal versus predictive scores are used for the plot, otherwise, the first two components of score plots are used.
Parameters
save_plotboolWhether the plot should be saved. Default is False.
file_namestr | NoneFile name for saving the plot. They should be compatible in Matplotlib. The figure format supported by Matplotlib can be found at
https//matplotlib.org/api/backend_bases_api.html#matplotlib.backend_bases.FigureCanvasBase.get_supported_filetypesDefault is "png". If the file_name doesn't have dot, an extension of "png" will be added, but if the string after the dot is not supported by Matplotlib, an error will be raised. Thus if the extension is not intended to be specified, dot shouldn't be present in file_name.
Returns
None
splot(self, save_plot: bool=False, file_name: bool=None)
S-plot
Parameters
save_plotboolWhether the plot should be saved. Default is False.
file_namestr | NoneFile name for saving the plot. They should be compatible in Matplotlib. The figure format supported by Matplotlib can be found at
https//matplotlib.org/api/backend_bases_api.html#matplotlib.backend_bases.FigureCanvasBase.get_supported_filetypesDefault is "png". If the file_name doesn't have dot, an extension of "png" will be added, but if the string after the dot is not supported by Matplotlib, an error will be raised. Thus if the extension is not intended to be specified, dot shouldn't be present in file_name.
Returns
None
References
[1] Wiklund S, et al. Visualization of GC/TOF-MS-Based Metabolomics Data for Identification of Biochemically Interesting Compounds Using OPLS Class Models. Anal Chem. 2008, 80, 115-122.
jackknife_loading_plot(self, alpha: float=0.05, save_plot: bool=False, file_name: str=None)
Loading plot with Jack-knife intervals.
Parameters
alphafloatSignificance level for calculating the intervals. Default is 0.05.
save_plotboolWhether the plot should be saved. Default is False.
file_namestr | NoneFile name for saving the plot. They should be compatible in Matplotlib. The figure format supported by Matplotlib can be found at
https//matplotlib.org/api/backend_bases_api.html#matplotlib.backend_bases.FigureCanvasBase.get_supported_filetypesDefault is "png". If the file_name doesn't have dot, an extension of "png" will be added, but if the string after the dot is not supported by Matplotlib, an error will be raised. Thus if the extension is not intended to be specified, dot shouldn't be present in file_name.
Returns
loading_meannp.ndarrayMean of cross validated loadings.
loading_intervalnp.ndarrayJack-knife confidence intervals
plot_cv_errors(self, save_plot: bool=False, file_name: str=None)
Plot cross validation classification errors.
Returns
None