Skip to content
New issue

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

[BUG]: Allow Custom Logger Configuration to Handle Prophet Dependency Warning #3957

Open
3 tasks done
gabrown opened this issue Apr 4, 2024 · 1 comment
Open
3 tasks done
Labels
bug Something isn't working

Comments

@gabrown
Copy link

gabrown commented Apr 4, 2024

pycaret version checks

Issue Description

Time Series setup allows the passing of a logger object to be passed, and all pycaret messages would be routed to that logger. However just importing the TSForecastingExperiment creates either warning or info messages about the dependancy on prophet and as it as at import time, it is not routed to the logger. This prevents me from creating my own logger to catch and handle the message in the way I want.

This can be problematic in scenarios where we want to control how warnings are logged and displayed, especially in production environments where we might want to suppress certain warnings or redirect them to specific logging channels.

Reproducible Example

from pycaret.time_series import TSForecastingExperiment

Expected Behavior

I expect no logs and no logging file (logs.log) to be created

Actual Results

I get a logs.log file created with the following output:
2024-04-04 10:34:20,632:WARNING:
'prophet' is a soft dependency and not included in the pycaret installation. Please run: `pip install prophet` to install.
Or if prophet is already installed:
2024-04-04 10:36:26,374:INFO:Soft dependency imported: prophet: 1.1.5

Installed Versions

System: python: 3.10.6 (main, Jan 12 2024, 15:30:20) [Clang 15.0.0 (clang-1500.1.0.2.5)] executable: /Users/XXXXXX/work_projects/temp/venv/bin/python machine: macOS-14.4.1-arm64-arm-64bit

PyCaret required dependencies:
pip: 24.0
setuptools: 69.2.0
pycaret: 3.3.0
IPython: 8.23.0
ipywidgets: 8.1.2
tqdm: 4.66.2
numpy: 1.26.4
pandas: 2.1.4
jinja2: 3.1.3
scipy: 1.11.4
joblib: 1.3.2
sklearn: 1.4.1.post1
pyod: 1.1.3
imblearn: 0.12.2
category_encoders: 2.6.3
lightgbm: 4.3.0
numba: 0.59.1
requests: 2.31.0
matplotlib: 3.7.5
scikitplot: 0.3.7
yellowbrick: 1.5
plotly: 5.20.0
plotly-resampler: Not installed
kaleido: 0.2.1
schemdraw: 0.15
statsmodels: 0.14.1
sktime: 0.26.0
tbats: 1.1.3
pmdarima: 2.0.4
psutil: 5.9.8
markupsafe: 2.1.5
pickle5: Not installed
cloudpickle: 3.0.0
deprecation: 2.1.0
xxhash: 3.4.1
wurlitzer: 3.0.3

PyCaret optional dependencies:
shap: Not installed
interpret: Not installed
umap: Not installed
ydata_profiling: Not installed
explainerdashboard: Not installed
autoviz: Not installed
fairlearn: Not installed
deepchecks: Not installed
xgboost: Not installed
catboost: Not installed
kmodes: Not installed
mlxtend: Not installed
statsforecast: Not installed
tune_sklearn: Not installed
ray: Not installed
hyperopt: Not installed
optuna: Not installed
skopt: Not installed
mlflow: Not installed
gradio: Not installed
fastapi: Not installed
uvicorn: Not installed
m2cgen: Not installed
evidently: Not installed
fugue: Not installed
streamlit: Not installed
prophet: Not installed

@gabrown gabrown added the bug Something isn't working label Apr 4, 2024
@gabrown
Copy link
Author

gabrown commented Apr 4, 2024

Just some extra context for what seems to be causing the warning. I think it is the creation of the Patched class here. All the other model types only run the _check_soft_dependencies in the init of the model classes, and I guess this is only done during/after setup() has been called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant