/
You are viewing the documentation for metbit 1.8.0. Change release context

metbit.plotting

Plot the results after cross validation.

import metbit.plotting

Classes

Plots

Plot cross validation results

Parameters

cvmodelCrossValidation object

Cross 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_plotbool

Whether the plot should be saved. Default is False.

file_namestr | None

File 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_filetypes

Default 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_plotbool

Whether the plot should be saved. Default is False.

file_namestr | None

File 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_filetypes

Default 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

alphafloat

Significance level for calculating the intervals. Default is 0.05.

save_plotbool

Whether the plot should be saved. Default is False.

file_namestr | None

File 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_filetypes

Default 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.ndarray

Mean of cross validated loadings.

loading_intervalnp.ndarray

Jack-knife confidence intervals

plot_cv_errors(self, save_plot: bool=False, file_name: str=None)

Plot cross validation classification errors.

Returns

None

Source

metbit/plotting.py at v1.8.0
Downloads for metbit 1.8.0PyPI and GitHub measure different distribution channels. Statistics refresh daily.

Counts are distribution activity, not unique users. GitHub source archives and Git clones are not included. Sources: PyPI Stats, Pepy, ClickPy, and GitHub Releases.

metbit 1.8.0 documentation