Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yard1 committed Feb 16, 2021
1 parent bc38b9d commit 745e007
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions pycaret/internal/Display.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def __init__(
self.round = round
try:
self.enviroment = str(get_ipython())
self.enviroment = "google.colab" if is_in_colab() else self.enviroment
self.enviroment = "google.colab" if self.is_in_colab() else self.enviroment
except:
self.enviroment = ""

Expand All @@ -173,9 +173,9 @@ def __init__(
monitor_rows, columns=[" " * i for i in range(len(monitor_rows[0]))],
).set_index("")


def is_in_colab():
try:
return "google.colab" in str(get_ipython())
except:
return False
@staticmethod
def is_in_colab():
try:
return "google.colab" in str(get_ipython())
except:
return False
10 changes: 5 additions & 5 deletions pycaret/internal/tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -5817,6 +5817,11 @@ def is_tree(e):
"Feature Importance and RFE plots not available for estimators that doesnt support coef_ or feature_importances_ attribute."
)

if plot == "residuals_interactive" and is_in_evaluate and Display.is_in_colab():
raise ValueError(
"Interactive Residuals plot not available in evaluate_model() in Google Colab. Do plot_model(model, plot='residuals_interactive') instead."
)

# checking fold parameter
if fold is not None and not (type(fold) is int or is_sklearn_cv_generator(fold)):
raise TypeError(
Expand Down Expand Up @@ -5865,11 +5870,6 @@ def is_tree(e):
)
display.display_progress()

if plot == "residuals_interactive" and is_in_evaluate and display.enviroment == "google.colab":
raise ValueError(
"Interactive Residuals plot not available in evaluate_model() in Google Colab. Do plot_model(model, plot='residuals_interactive') instead."
)

logger.info("Preloading libraries")
# pre-load libraries
import matplotlib.pyplot as plt
Expand Down

0 comments on commit 745e007

Please sign in to comment.