Skip to content

plot_pipeline


method plot_pipeline(models=None, draw_hyperparameter_tuning=True, color_branches=None, title=None, figsize=None, filename=None, display=True) [source]

Plot a diagram of the pipeline.

Parameters:

model: str or None, optional (default=None)
Name of the models for which to draw the pipeline. If None, all pipelines are plotted.

draw_hyperparameter_tuning: bool, optional (default=True)
Whether to draw if the models used Hyperparameter Tuning.

color_branches: bool or None, optional (default=None)
Whether to draw every branch in a different color. If None, branches are colored when there is more than one.

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 pipeline drawn.

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.


Tip

Print atom.pipeline in a notebook for sklearn's interactive visualization of the current pipeline.

Example

from atom import ATOMClassifier

atom = ATOMClassifier(X, y)
atom.impute(strat_num="median")
atom.encode(max_onehot=5)
atom.run(["GNB", "RNN", "SGD", "MLP"])
atom.voting(models=atom.winners[:2])

atom.plot_pipeline()  # For a single branch
plot_pipeline_1
from atom import ATOMClassifier

atom = ATOMClassifier(X, y)
atom.scale()
atom.prune()
atom.run("RF", n_calls=10, n_initial_points=3)

atom.branch = "oversample"
atom.balance(strategy="adasyn")
atom.run("RF_os")

atom.branch = "undersample_from_master"
atom.balance(strategy="nearmiss")
atom.run("RF_us")

atom.plot_pipeline()  # For multiple branches
plot_pipeline_2
Back to top