We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have checked that this issue has not already been reported here.
I have confirmed this bug exists on the latest version of pycaret.
I have confirmed this bug exists on the develop branch of pycaret (pip install -U git+https://github.com/pycaret/pycaret.git@develop).
plot_model(model, plot = 'residuals_interactive') generates error. see below to reproduce.
from pycaret.datasets import get_data data = get_data('insurance') from pycaret.regression import * s = setup(data, target = 'charges', session_id = 123) dt = create_model('dt') plot_model(dt, plot = 'residuals_interactive')
The plot is displayed but after the plot error is printed. see below log.
--------------------------------------------------------------------------- UnboundLocalError Traceback (most recent call last) Input In [23], in <cell line: 1>() ----> 1 plot_model(dt, plot = 'residuals_interactive') File ~\anaconda3\envs\pycaret-develop\lib\site-packages\pycaret\internal\utils.py:911, in check_if_global_is_not_none.<locals>.decorator.<locals>.wrapper(*args, **kwargs) 909 if globals_d[name] is None: 910 raise ValueError(message) --> 911 return func(*args, **kwargs) File ~\anaconda3\envs\pycaret-develop\lib\site-packages\pycaret\regression\functional.py:1555, in plot_model(estimator, plot, scale, save, fold, fit_kwargs, plot_kwargs, groups, use_train_data, verbose, display_format) 1455 @check_if_global_is_not_none(globals(), _CURRENT_EXPERIMENT_DECORATOR_DICT) 1456 def plot_model( 1457 estimator, (...) 1467 display_format: Optional[str] = None, 1468 ) -> str: 1470 """ 1471 This function analyzes the performance of a trained model on holdout set. 1472 It may require re-training the model in certain cases. (...) 1552 1553 """ -> 1555 return _CURRENT_EXPERIMENT.plot_model( 1556 estimator=estimator, 1557 plot=plot, 1558 scale=scale, 1559 save=save, 1560 fold=fold, 1561 fit_kwargs=fit_kwargs, 1562 plot_kwargs=plot_kwargs, 1563 groups=groups, 1564 verbose=verbose, 1565 use_train_data=use_train_data, 1566 display_format=display_format, 1567 ) File ~\anaconda3\envs\pycaret-develop\lib\site-packages\pycaret\regression\oop.py:1339, in RegressionExperiment.plot_model(self, estimator, plot, scale, save, fold, fit_kwargs, plot_kwargs, groups, use_train_data, verbose, display_format) 1244 def plot_model( 1245 self, 1246 estimator, (...) 1256 display_format: Optional[str] = None, 1257 ) -> str: 1259 """ 1260 This function analyzes the performance of a trained model on holdout set. 1261 It may require re-training the model in certain cases. (...) 1336 1337 """ -> 1339 return super().plot_model( 1340 estimator=estimator, 1341 plot=plot, 1342 scale=scale, 1343 save=save, 1344 fold=fold, 1345 fit_kwargs=fit_kwargs, 1346 plot_kwargs=plot_kwargs, 1347 groups=groups, 1348 verbose=verbose, 1349 use_train_data=use_train_data, 1350 system=True, 1351 display_format=display_format, 1352 ) File ~\anaconda3\envs\pycaret-develop\lib\site-packages\pycaret\internal\pycaret_experiment\tabular_experiment.py:2023, in _TabularExperiment.plot_model(self, estimator, plot, scale, save, fold, fit_kwargs, plot_kwargs, groups, feature_name, label, use_train_data, verbose, system, display, display_format) 2020 self.logger.info("Visual Rendered Successfully") 2022 # execute the plot method -> 2023 ret = locals()[plot]() 2024 if ret: 2025 plot_filename = ret File ~\anaconda3\envs\pycaret-develop\lib\site-packages\pycaret\internal\pycaret_experiment\tabular_experiment.py:677, in _TabularExperiment.plot_model.<locals>.residuals_interactive() 674 resplots.write_html(plot_filename) 676 self.logger.info("Visual Rendered Successfully") --> 677 return plot_filename UnboundLocalError: local variable 'plot_filename' referenced before assignment
3.0
The text was updated successfully, but these errors were encountered:
Fix #2547
0dce17c
Merge pull request #2550 from pycaret/fix_2547
19f7f14
@Yard1 The issue still exist. I have reproduced it here
Sorry, something went wrong.
Merge pull request #2557 from pycaret/fix_plotting_returns
e4e07c0
Fix plotting returns (#2547)
The issue is fixed now. Thanks
Yard1
Successfully merging a pull request may close this issue.
pycaret version checks
I have checked that this issue has not already been reported here.
I have confirmed this bug exists on the latest version of pycaret.
I have confirmed this bug exists on the develop branch of pycaret (pip install -U git+https://github.com/pycaret/pycaret.git@develop).
Issue Description
plot_model(model, plot = 'residuals_interactive') generates error. see below to reproduce.
Reproducible Example
Expected Behavior
The plot is displayed but after the plot error is printed. see below log.
Actual Results
Installed Versions
3.0
The text was updated successfully, but these errors were encountered: