pycaret.anomaly.plot_model#
- pycaret.anomaly.plot_model(model, plot: str = 'tsne', feature: str | None = None, label: bool = False, scale: float = 1, save: bool = False, display_format: str | None = None) str | None[source]#
This function analyzes the performance of a trained model.
Example
>>> from pycaret.datasets import get_data >>> anomaly = get_data('anomaly') >>> from pycaret.anomaly import * >>> exp_name = setup(data = anomaly) >>> knn = create_model('knn') >>> plot_model(knn, plot = 'tsne')
- model: scikit-learn compatible object
Trained Model Object
- plot: str, default = ‘tsne’
List of available plots (ID - Name):
‘tsne’ - t-SNE (3d) Dimension Plot
‘umap’ - UMAP Dimensionality Plot
- feature: str, default = None
Feature to be used as a hoverover tooltip and/or label when the
labelparam is set to True. When feature is None, first column of the dataset is used.- label: bool, default = False
Name of column to be used as data labels.
- scale: float, default = 1
The resolution scale of the figure.
- save: bool, default = False
When set to True, plot is saved in the current working directory.
- display_format: str, default = None
To display plots in Streamlit (https://www.streamlit.io/), set this to ‘streamlit’. Currently, not all plots are supported.
- Returns:
Path to saved file, if any.