Pycaret plot_model() crashing after closing plot

Is this a bug, or am I doing it wrong?

There’s an issue with PyCaret plot_model() function. It does open the specified plot, but when closing the plot by clicking on the “X” mark or Ctrl+W the script crashes with following output:

Traceback (most recent call last):
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/./inverter_ML_regression_2F_test.py", line 69, in <module>
    experiment1.plot_model(tuned_gbr, plot = 'error')     # Prediction Error Plot
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib/python3.11/site-packages/pycaret/regression/oop.py", line 1946, in plot_model
    return super().plot_model(
           ^^^^^^^^^^^^^^^^^^^
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib/python3.11/site-packages/pycaret/internal/pycaret_experiment/tabular_experiment.py", line 2045, in plot_model
    return self._plot_model(
           ^^^^^^^^^^^^^^^^^
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib/python3.11/site-packages/pycaret/internal/pycaret_experiment/tabular_experiment.py", line 1913, in _plot_model
    ret = locals()[plot]()
          ^^^^^^^^^^^^^^^^
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib/python3.11/site-packages/pycaret/internal/pycaret_experiment/tabular_experiment.py", line 1227, in error
    return show_yellowbrick_plot(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib/python3.11/site-packages/pycaret/internal/plots/yellowbrick.py", line 115, in show_yellowbrick_plot
    visualizer.show(clear_figure=True)
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib/python3.11/site-packages/yellowbrick/base.py", line 249, in show
    self.fig.clear()
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib64/python3.11/site-packages/matplotlib/figure.py", line 3148, in clear
    super().clear(keep_observers=keep_observers)
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib64/python3.11/site-packages/matplotlib/figure.py", line 978, in clear
    self.delaxes(ax)  # Remove ax from self._axstack.
    ^^^^^^^^^^^^^^^^
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib64/python3.11/site-packages/matplotlib/figure.py", line 945, in delaxes
    self._axobservers.process("_axes_change_event", self)
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib64/python3.11/site-packages/matplotlib/cbook/__init__.py", line 319, in process
    self.exception_handler(exc)
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib64/python3.11/site-packages/matplotlib/cbook/__init__.py", line 103, in _exception_printer
    raise exc
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib64/python3.11/site-packages/matplotlib/cbook/__init__.py", line 314, in process
    func(*args, **kwargs)
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib64/python3.11/site-packages/matplotlib/figure.py", line 3253, in <lambda>
    self._axobservers.connect("_axes_change_event", lambda arg: func(arg))
                                                                ^^^^^^^^^
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib64/python3.11/site-packages/matplotlib/backend_bases.py", line 2848, in notify_axes_change
    self.toolbar.update()
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib64/python3.11/site-packages/matplotlib/backend_bases.py", line 3382, in update
    self.set_history_buttons()
  File "/home/boris/Documents/EDU/AI-ML_examples/inverter_virtualenv/lib64/python3.11/site-packages/matplotlib/backends/_backend_tk.py", line 892, in set_history_buttons
    self._buttons['Back']['state'] = state_map[can_back]
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/lib64/python3.11/tkinter/__init__.py", line 1732, in __setitem__
    self.configure({key: value})
  File "/usr/lib64/python3.11/tkinter/__init__.py", line 1721, in configure
    return self._configure('configure', cnf, kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/tkinter/__init__.py", line 1711, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: invalid command name ".!navigationtoolbar2tk.!button2"

Only plot that doesn’t crash when closed is the ‘pipeline’ plot. All other plot types are crashing on close.

PyCaret version:

(inverter_virtualenv) boris@E5440-DELL:~/Documents/EDU/AI-ML_examples/inverter_virtualenv$ pip list | grep pycaret
pycaret                   3.3.2
(inverter_virtualenv) boris@E5440-DELL:~/Documents/EDU/AI-ML_examples/inverter_virtualenv$ pip list | grep yellowbrick
yellowbrick               1.5
(inverter_virtualenv) boris@E5440-DELL:~/Documents/EDU/AI-ML_examples/inverter_virtualenv$ pip list | grep matplotlib
matplotlib                3.7.5
matplotlib-inline         0.1.7

This is my code sample:

from pycaret.regression import *

experiment1 = RegressionExperiment()
experiment1.setup(X_train, target="delay")
print(experiment1)

top3_best = experiment1.compare_models(exclude=['lightgbm'], n_select=3)
print(top3_best)

initial_et = experiment1.create_model('et')
initial_rf = experiment1.create_model('rf')
initial_gbr = experiment1.create_model('gbr')
print(initial_et)
print(initial_rf)
print(initial_gbr)

#tuned_et = experiment1.tune_model(initial_et)
#tuned_rf = experiment1.tune_model(initial_rf)
tuned_gbr = experiment1.tune_model(initial_gbr)
#print(tuned_et)
#print(tuned_rf)
print(tuned_gbr)

experiment1.plot_model(tuned_gbr, plot = 'pipeline')  # Schematic drawing of the preprocessing pipeline
#experiment1.plot_model(tuned_gbr, plot = 'residuals') # Residuals Plot
experiment1.plot_model(tuned_gbr, plot = 'error')     # Prediction Error Plot
#experiment1.plot_model(tuned_gbr, plot = 'cooks')     # Cooks Distance Plot
#experiment1.plot_model(tuned_gbr, plot = 'rfe')       # Recursive Feat. Selection
experiment1.plot_model(tuned_gbr, plot = 'learning')  # Learning Curve
#experiment1.plot_model(tuned_gbr, plot = 'vc')        # Validation Curve
#experiment1.plot_model(tuned_gbr, plot = 'manifold')  # Manifold Learning
experiment1.plot_model(tuned_gbr, plot = 'feature')   # Feature Importance

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật