Skip to content

plot_pipeline


method plot_pipeline(model=None, show_params=True, title=None, figsize=None, filename=None, display=True) [source]

Plot a diagram of a model's pipeline.

Parameters:

model: str or None, optional (default=None)
Model from which to plot the pipeline. If no model is specified, the current pipeline is plotted.

show_params: bool, optional (default=True)
Whether to show the parameters used for every estimator.

title: str or None, optional (default=None)
Plot's title. If None, the title is left empty.

figsize: tuple or None, optional (default=None)
Figure's size, format as (x, y). If None, it adapts the size to the length of the pipeline.

filename: str or None, optional (default=None)
Name of the file. Use "auto" for automatic naming. If None, the figure is not saved.

display: bool or None, optional (default=True)
Whether to render the plot. If None, it returns the matplotlib figure.

Returns: matplotlib.figure.Figure
Plot object. Only returned if display=None.


Example

from atom import ATOMClassifier

atom = ATOMClassifier(X, y)
atom.impute(strat_num="median", strat_cat="drop", max_nan_rows=0.8)
atom.encode(strategy="LeaveOneOut", max_onehot=8, frac_to_other=0.02)
atom.balance(strategy="adasyn", sampling_strategy=1.0)
atom.run("LR", metric="auc", n_calls=10)

atom.plot_pipeline(model="LR")
plot_pipeline
Back to top