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

Comet Logging #1

Open
wants to merge 236 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
236 commits
Select commit Hold shift + click to select a range
5cd12f5
small changes to __init__, functional, defined allowed engines and ad…
ethanglaser Aug 10, 2022
02d4859
cluster sklearnex support fixed and tested
ethanglaser Aug 12, 2022
4297eb0
modified unsupervised experiment instead of reimplementing in oop
ethanglaser Aug 19, 2022
3a86340
initial commit
sherpan Jan 10, 2023
2fa5d05
added comet to docstrings
sherpan Jan 11, 2023
5a20397
added notebook tests
tvdboom Jan 13, 2023
12e9c8e
Merge branch 'master' into add_notebook_tests
Yard1 Jan 16, 2023
587b83e
Fix nested mlflow logging
Yard1 Jan 16, 2023
dbe276e
Fix lint
Yard1 Jan 16, 2023
f55f085
Documentation
Yard1 Jan 16, 2023
e6e9aa5
Merge branch 'pycaret:master' into comet_logging
sherpan Jan 17, 2023
2e83b1c
fixed errors
sherpan Jan 17, 2023
b9af5f7
Merge branch 'comet_logging' of https://github.com/sherpan/pycaret in…
sherpan Jan 17, 2023
718ac7d
Merge branch 'pycaret:master' into comet_logging
sherpan Jan 17, 2023
b504789
added ml
sherpan Jan 17, 2023
6346632
added naming + bi tracking
sherpan Jan 18, 2023
a04fc14
fixed typos
sherpan Jan 18, 2023
af961d8
added prefix to params
sherpan Jan 19, 2023
90d8df4
fixed custom tags saving
sherpan Jan 20, 2023
1ba8738
Fix bad tuning grid for cuML RF regressor
Yard1 Jan 26, 2023
39e583b
Fixes
Yard1 Jan 26, 2023
764af3d
Merge branch 'master' into fix_nested_mlflow_logging
Yard1 Jan 27, 2023
6a8dd6c
Merge branch 'master' into add_notebook_tests
Yard1 Jan 27, 2023
ef4532a
logging assets, fixed log_other
sherpan Jan 28, 2023
0468c39
Merge branch 'master' into fix_rapids
Yard1 Jan 30, 2023
d93843e
fixed conficlts
sherpan Jan 30, 2023
4c2a882
add comet to requirements
sherpan Jan 30, 2023
7bcfa2d
fixed merge conflic
sherpan Jan 30, 2023
a113fcb
Update Binary Classification Tutorial Level Beginner (中文) - CLF101.i…
Danpilz Jan 31, 2023
a44717e
fixed formatting
sherpan Jan 31, 2023
c54b2c8
removed duplicate joblib
sherpan Jan 31, 2023
af5c024
Pin black, isort, flake8 versions in CI
Yard1 Feb 2, 2023
5a22544
Update test.yml
Yard1 Feb 2, 2023
ca4459a
Merge pull request #3294 from pycaret/ci_quality_pin_versions
Yard1 Feb 2, 2023
2a2c58d
Merge branch 'master' into comet_logging
Yard1 Feb 2, 2023
a6fca92
re-formats from black
sherpan Feb 2, 2023
7da170f
Merge branch 'comet_logging' of https://github.com/sherpan/pycaret in…
sherpan Feb 2, 2023
a45d6a1
fixed flake8 lint
sherpan Feb 3, 2023
9b76c5c
removed uneeded import
sherpan Feb 3, 2023
0e271e6
Merge pull request #3286 from pycaret/fix_rapids
Yard1 Feb 5, 2023
84f5bb6
Merge pull request #3289 from sherpan/comet_logging
Yard1 Feb 5, 2023
3b40f7e
Merge branch 'master' into fix_nested_mlflow_logging
Yard1 Feb 5, 2023
32cb44d
Tweak
Yard1 Feb 5, 2023
b0d0070
Fix yellowbrick plots being saved without legend
Yard1 Feb 5, 2023
03c8a66
Remove `tune_model` from unsupervised
Yard1 Feb 5, 2023
7602824
Remove NLP and ARules modules
Yard1 Feb 5, 2023
443c517
Update setup.py
Yard1 Feb 5, 2023
34c495d
Lint
Yard1 Feb 5, 2023
c969895
Set parent run tag manually
Yard1 Feb 6, 2023
1696d79
Don't nest setup
Yard1 Feb 6, 2023
2f90500
Fix
Yard1 Feb 6, 2023
a616455
Fix
Yard1 Feb 6, 2023
2f4a893
Merge pull request #3297 from pycaret/fix_yellowbrick_plot_saving
Yard1 Feb 6, 2023
5fd0946
moved examples folder to new repo community-examples
moezali1 Feb 6, 2023
e841ca9
Merge branch 'master' into ethan
jmhatre-work Feb 6, 2023
b827002
Merge branch 'pycaret:master' into ethan
jmhatre-work Feb 6, 2023
f68bcc2
Merge branch 'master' into patch-1
Danpilz Feb 7, 2023
26b55a2
Merge pull request #3298 from pycaret/tune_model_unsupervised_remove
Yard1 Feb 7, 2023
9c12913
Merge pull request #3261 from pycaret/fix_nested_mlflow_logging
Yard1 Feb 7, 2023
53aac9e
Merge branch 'master' into remove_nlp_arules
Yard1 Feb 7, 2023
0aff0b6
Merge branch 'remove_nlp_arules' of https://github.com/pycaret/pycare…
Yard1 Feb 7, 2023
d39d7d6
Fixing unsorted imports and engine changes
jmhatre-work Feb 7, 2023
02ccc09
Changing path of test clustering engine
jmhatre-work Feb 7, 2023
0f5c23a
Merge branch 'master' into ethan
jmhatre-work Feb 7, 2023
3547901
Removing unwanted comments and using pytest parameters
jmhatre-work Feb 7, 2023
91544b9
Merge branch 'ethan' of https://github.com/ethanglaser/pycaret into e…
jmhatre-work Feb 7, 2023
ca7d76c
Merge pull request #3290 from Danpilz/patch-1
moezali1 Feb 7, 2023
609b35a
Fixing test errors for engines
jmhatre-work Feb 7, 2023
a6c2d06
Merge branch 'pycaret:master' into ethan
jmhatre-work Feb 7, 2023
2e59b6f
Reformatting file using black
jmhatre-work Feb 8, 2023
06b54da
Fixing flake8 fixes
jmhatre-work Feb 8, 2023
6e387ec
Merge pull request #3300 from ethanglaser/ethan
Yard1 Feb 9, 2023
f39ffc4
Merge pull request #3299 from pycaret/remove_nlp_arules
Yard1 Feb 9, 2023
406a114
Merge branch 'master' into add_notebook_tests
Yard1 Feb 9, 2023
408ed47
Switch to tutorials instead of examples
Yard1 Feb 9, 2023
566de57
Update test.yml
Yard1 Feb 9, 2023
b23976c
ignore subfolders
tvdboom Feb 9, 2023
d2fd30c
Update .pre-commit-config.yaml
Yard1 Feb 9, 2023
f236b07
Update version
Yard1 Feb 9, 2023
da5b5a8
Update test.yml
Yard1 Feb 11, 2023
c8dd28d
Merge branch 'master' into add_notebook_tests
Yard1 Feb 11, 2023
6bcc205
tutorial clean up (1/2)
moezali1 Feb 12, 2023
4838cf9
tutorial clean-up 2
moezali1 Feb 12, 2023
6902074
Merge branch 'master' into add_notebook_tests
Yard1 Feb 12, 2023
f9ecc80
clean tutorials folder on add_notebook_tests branch
moezali1 Feb 12, 2023
2bfaf9d
Merge branch 'add_notebook_tests' of https://github.com/pycaret/pycar…
moezali1 Feb 12, 2023
18d60b0
del binary clf intermediate and anom det tutorials
moezali1 Feb 12, 2023
6acdbd4
ignore subfolders 2
tvdboom Feb 13, 2023
c7c2829
remove regression intermediate tutorial nb
moezali1 Feb 13, 2023
bd3dec8
Merge branch 'add_notebook_tests' of https://github.com/pycaret/pycar…
moezali1 Feb 13, 2023
85ac526
ignore subfolders 3
tvdboom Feb 13, 2023
f98c706
Merge remote-tracking branch 'origin/add_notebook_tests' into add_not…
tvdboom Feb 13, 2023
2aad2ab
Merge pull request #3252 from pycaret/add_notebook_tests
Yard1 Feb 14, 2023
eeed821
fix for sktime 0.16.1 release
ngupta23 Feb 14, 2023
d5099a4
Merge pull request #3312 from pycaret/fix_sktime_16p1
Yard1 Feb 14, 2023
cb30144
tutorial clean up
moezali1 Feb 14, 2023
6602fd1
added time series examples back in main repo. these are official exam…
moezali1 Feb 14, 2023
3aed933
added readme file in examples
moezali1 Feb 14, 2023
06423b8
update readme in examples folder
moezali1 Feb 14, 2023
246da52
add clustering tutorial
moezali1 Feb 15, 2023
f597701
added anomaly and time series forecasting tutorial
moezali1 Feb 15, 2023
b506391
update regression tutorial
moezali1 Feb 15, 2023
b6c9e15
update time series forecasting tutorial
moezali1 Feb 16, 2023
668e4cd
update binary clf tutorial
moezali1 Feb 16, 2023
670fca0
update tutorials
moezali1 Feb 16, 2023
b7aa8e6
update clustering tutorial
moezali1 Feb 16, 2023
9ab54aa
update and clean up tutorials
moezali1 Feb 17, 2023
c29cc90
Fix argument in method
daikikatsuragawa Feb 20, 2023
860453c
Fix missing return statement
daikikatsuragawa Feb 20, 2023
d50c6ec
Fix dict
daikikatsuragawa Feb 20, 2023
737cf5d
Fix `get_leaderboard` returning std
Yard1 Feb 20, 2023
f250d70
Make `comet_ml` import lazy
Yard1 Feb 20, 2023
43e001f
Fix `create_api` failing due to target names
Yard1 Feb 20, 2023
69d83a3
Fix variables of the same name but different types
daikikatsuragawa Feb 24, 2023
0c16e27
Merge branch 'master' into master
ngupta23 Feb 24, 2023
ac9262b
Merge pull request #3334 from daikikatsuragawa/master
Yard1 Feb 24, 2023
e7a89b2
fix for #3333
ngupta23 Feb 25, 2023
1ebd1dc
added functionality per #3308
ngupta23 Feb 25, 2023
94ac64a
Merge pull request #3335 from pycaret/ts_index_fix
ngupta23 Feb 25, 2023
9c3ea61
Merge pull request #3336 from pycaret/ts_force_sp
ngupta23 Feb 25, 2023
25bbb6b
Update broken link
haizadtarik Feb 26, 2023
79da22e
Update CONTRIBUTING.md
Yard1 Feb 26, 2023
1bd4181
Update requirements-dev.txt
Yard1 Feb 26, 2023
17338ee
fix #3331
Feb 27, 2023
1bd13ed
update README.md
moezali1 Feb 27, 2023
91d8485
update README.md 2
moezali1 Feb 27, 2023
ea9bf6b
Update requirements-dev.txt
Yard1 Feb 27, 2023
b366f94
Merge pull request #3343 from kumar21120/debug
Yard1 Feb 28, 2023
04067c6
Fix regression blender, tunable models
Yard1 Feb 28, 2023
7d3b0d2
Merge pull request #3342 from haizadtarik/master
Yard1 Feb 28, 2023
9b934b0
Lint
Yard1 Feb 28, 2023
ad5e044
Move `CleanColumNames` to the end of pipeline
Yard1 Feb 28, 2023
62eab2d
Lint
Yard1 Mar 1, 2023
9ba00ea
Fix test
Yard1 Mar 1, 2023
1a2c212
Merge pull request #3346 from pycaret/clean_colum_names_last
Yard1 Mar 2, 2023
d7399ef
clean up examples and tutorials
moezali1 Mar 4, 2023
520e2d1
remove examples folder
moezali1 Mar 4, 2023
de40537
removed resources folder
moezali1 Mar 4, 2023
b47a896
Redirect C-level and child stdout/stderr correctly
Yard1 Mar 4, 2023
6752958
Add warning if metric fails
Yard1 Mar 4, 2023
aad6482
Improve warning message
Yard1 Mar 4, 2023
b3492eb
Ensure that binary metric arguments are correct
Yard1 Mar 4, 2023
4a0a2c0
Fix wurlitzer on windows
Yard1 Mar 5, 2023
e960260
Remove requirement on windows
Yard1 Mar 5, 2023
5fc1f85
Fix test notebooks
Yard1 Mar 5, 2023
2cee973
Fix wildcard
Yard1 Mar 5, 2023
bbc9f90
Pin plotly-resampler>=0.8.3.1
Yard1 Mar 6, 2023
8fb2455
Print dependencies in test_notebooks
Yard1 Mar 6, 2023
5001f9a
Merge pull request #3361 from pycaret/pin_plotly_resampler_0.8.3.1
Yard1 Mar 6, 2023
3bc356e
fix categorical columns when numericalb
tvdboom Mar 6, 2023
3c62ee6
remove prints
tvdboom Mar 6, 2023
0971884
remove feature_names
tvdboom Mar 8, 2023
05955f5
add feature_names for legacy estimators
tvdboom Mar 8, 2023
51843a6
Merge pull request #3359 from pycaret/redirect_c_output_metrics_warning
Yard1 Mar 9, 2023
41c4a1e
Merge branch 'master' into ensure_correct_binary_metric_args
Yard1 Mar 9, 2023
3e04460
index default to True and keep feature groups by default
tvdboom Mar 9, 2023
4cccf76
Fix `predict_model` with target transformation
Yard1 Mar 9, 2023
2c2e79d
Update to pyod>=1.0.8 and remove patches
Yard1 Mar 9, 2023
eda49b0
Pin version
Yard1 Mar 9, 2023
b53e46a
Merge pull request #3360 from pycaret/ensure_correct_binary_metric_args
Yard1 Mar 9, 2023
a1a4dfb
Fix
Yard1 Mar 9, 2023
a094fbc
Merge pull request #3381 from pycaret/update_to_pyod_1.0.8
Yard1 Mar 10, 2023
b395a4e
Update test
Yard1 Mar 10, 2023
1e23448
Merge branch 'master' into fix_ohe
Yard1 Mar 10, 2023
ba6a930
Merge pull request #3367 from pycaret/fix_ohe
tvdboom Mar 10, 2023
df339d6
fix data attributes and add random_state to remove outliers
tvdboom Mar 10, 2023
83152b5
Fix
Yard1 Mar 10, 2023
bb0a145
removed comet_ml from req-optional
moezali1 Mar 11, 2023
b84e0fe
updated all time series notebooks
ngupta23 Mar 11, 2023
4b44b07
updated all time series notebooks
ngupta23 Mar 11, 2023
d7e5295
Merge branch 'master' into fix_ts_notebooks
ngupta23 Mar 11, 2023
3ebe175
update README.md
moezali1 Mar 11, 2023
3c02f5e
update README.md
moezali1 Mar 11, 2023
aa512cc
update files
moezali1 Mar 11, 2023
eb6aca6
update readme.md
moezali1 Mar 11, 2023
3f4b5bb
update readme to include python 3.10 badge
moezali1 Mar 11, 2023
127ac76
Merge pull request #3388 from pycaret/fix_ts_notebooks
ngupta23 Mar 12, 2023
15a1147
update README.md
moezali1 Mar 12, 2023
bee3787
Save target name in transformer wrapper
Yard1 Mar 12, 2023
e8a43cd
Set upper limit of joblib memory at 10GB
Yard1 Mar 12, 2023
aa8ffcd
Lint
Yard1 Mar 12, 2023
f691927
Install Ray on windows
Yard1 Mar 12, 2023
7c5208a
Fix hashing of custom classes
Yard1 Mar 12, 2023
ca4b00c
Merge branch 'master' into fix_data_attributes_calling
Yard1 Mar 12, 2023
53b9317
Fix
Yard1 Mar 12, 2023
3d524e4
Make our preprocessors follow sklearn API
Yard1 Mar 12, 2023
c298497
Merge pull request #3391 from pycaret/memory_reduce_size
Yard1 Mar 13, 2023
c91e274
Merge pull request #3393 from pycaret/fix_custom_class_hashing
Yard1 Mar 13, 2023
b9b59d4
Merge pull request #3392 from pycaret/install_ray_on_windows
Yard1 Mar 13, 2023
d2ff3d0
Merge pull request #3379 from pycaret/inverse_transform_fix
Yard1 Mar 13, 2023
dae5037
Merge pull request #3382 from pycaret/fix_data_attributes_calling
Yard1 Mar 13, 2023
314b6b1
Update README.md
moezali1 Mar 17, 2023
bfb1080
Update README.md
moezali1 Mar 17, 2023
0369a39
Update README.md
moezali1 Mar 17, 2023
fb8ddde
Update README.md
moezali1 Mar 17, 2023
c40f5fb
made oop and functional API same
ngupta23 Mar 18, 2023
3841800
switched to static renderer to save space
ngupta23 Mar 18, 2023
2704229
Merge pull request #3408 from pycaret/3405-ts_save_model
moezali1 Mar 18, 2023
a6805bb
Merge pull request #3409 from pycaret/ts_notebooks
moezali1 Mar 18, 2023
0a19724
Update README.md
moezali1 Mar 18, 2023
ea9fcd6
Update README.md
moezali1 Mar 18, 2023
fc23bf5
Update README.md
moezali1 Mar 18, 2023
ef75c5a
Update README.md
moezali1 Mar 18, 2023
4dcafba
deleted changelog.md file. no more needed.
moezali1 Mar 18, 2023
80df135
Add files via upload
moezali1 Mar 18, 2023
bc80a3f
Fix pdp plot
Yard1 Mar 18, 2023
09d2f40
Fix bad error
Yard1 Mar 18, 2023
ef12067
remove catboost GPU special case
Yard1 Mar 18, 2023
d38b90c
Update README.md
moezali1 Mar 18, 2023
cf3d0d0
Update README.md
moezali1 Mar 18, 2023
8e8e7ce
Fix MSA plot
Yard1 Mar 18, 2023
d3b0ce9
Remove nightly build, bump version to 3.0.0
Yard1 Mar 18, 2023
cfc1ef3
Fix plots
Yard1 Mar 18, 2023
4bf7452
Merge pull request #3411 from pycaret/remove_nightly_build_bump_to_3.0.0
Yard1 Mar 18, 2023
2813a1a
added download badge to readme
ngupta23 Mar 19, 2023
e522a9d
added and organized badges (similar to sktime)
ngupta23 Mar 19, 2023
4e697ef
Merge pull request #3412 from pycaret/add_downloads
moezali1 Mar 19, 2023
3ef7d8a
update Dockerfile
moezali1 Mar 19, 2023
59727da
update Dockerfile
moezali1 Mar 19, 2023
347c9fe
Pin numpy<1.24
Yard1 Mar 20, 2023
4b1db3c
Merge pull request #3414 from pycaret/pin_numpy_1.24
ngupta23 Mar 20, 2023
cd1ec13
cleanup importerror
beckernick Mar 22, 2023
ce4c703
Merge pull request #3423 from beckernick/bug/better-cuml-importerror
Yard1 Mar 22, 2023
e2951c0
add duplicate indices check
tvdboom Mar 24, 2023
39c1b24
fix tests
tvdboom Mar 25, 2023
70c1024
Merge pull request #3430 from pycaret/add_index_check
tvdboom Mar 27, 2023
8705360
added index cleaning utility
ngupta23 Apr 1, 2023
cea8c19
added utility function to error message
ngupta23 Apr 1, 2023
dae68f1
attempt to fix tests
ngupta23 Apr 2, 2023
213eb02
Merge pull request #3448 from pycaret/ts_utils
ngupta23 Apr 3, 2023
b4cf58a
Pin schemdraw<0.16
Yard1 Apr 4, 2023
bc303e3
fix of CatboostRegresser on GPU with distribution.
kyosuke0924 Apr 4, 2023
b84c649
fix of CatboostClassifier on GPU with distribution.
kyosuke0924 Apr 4, 2023
7cd6134
Merge pull request #3458 from kyosuke0924/Modification_of_Issue_#3457
ngupta23 Apr 6, 2023
867db6d
fixed compare model error
sherpan Apr 6, 2023
38ddba9
Merge branch 'pycaret:master' into comet_logging
sherpan Apr 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pycaret/anomaly/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def setup(


log_experiment: bool, default = False
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb')
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb', 'comet_ml')
corresponding to a logger to determine which experiment loggers to use.
Setting to True will use just MLFlow.

Expand Down
2 changes: 1 addition & 1 deletion pycaret/classification/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def setup(


log_experiment: bool or str or BaseLogger or list of str or BaseLogger, default = False
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb')
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb', 'comet_ml')
corresponding to a logger to determine which experiment loggers to use.
Setting to True will use just MLFlow.

Expand Down
2 changes: 1 addition & 1 deletion pycaret/classification/oop.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def setup(


log_experiment: bool or str or BaseLogger or list of str or BaseLogger, default = False
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb')
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb', 'comet_ml)
corresponding to a logger to determine which experiment loggers to use.
Setting to True will use just MLFlow.

Expand Down
2 changes: 1 addition & 1 deletion pycaret/clustering/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def setup(


log_experiment: bool, default = False
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb')
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb', 'comet_ml')
corresponding to a logger to determine which experiment loggers to use.
Setting to True will use just MLFlow.
If ``wandb`` (Weights & Biases) is installed, will also log there.
Expand Down
7 changes: 5 additions & 2 deletions pycaret/internal/pycaret_experiment/tabular_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from pycaret.loggers.dagshub_logger import DagshubLogger
from pycaret.loggers.mlflow_logger import MlflowLogger
from pycaret.loggers.wandb_logger import WandbLogger
from pycaret.loggers.comet_logger import CometLogger
from pycaret.utils._dependencies import _check_soft_dependencies
from pycaret.utils.generic import (
MLUsecase,
Expand Down Expand Up @@ -228,7 +229,7 @@ def _profile(self, profile, profile_kwargs):

def _validate_log_experiment(self, obj: Any) -> None:
return isinstance(obj, (bool, BaseLogger)) or (
isinstance(obj, str) and obj.lower() in ["mlflow", "wandb", "dagshub"]
isinstance(obj, str) and obj.lower() in ["mlflow", "wandb", "dagshub", "comet_ml"]
)

def _convert_log_experiment(
Expand All @@ -242,7 +243,7 @@ def _convert_log_experiment(
or self._validate_log_experiment(log_experiment)
):
raise TypeError(
"log_experiment parameter must be a bool, BaseLogger, one of 'mlflow', 'wandb', 'dagshub'; or a list of the former."
"log_experiment parameter must be a bool, BaseLogger, one of 'mlflow', 'wandb', 'dagshub', 'comet_ml'; or a list of the former."
)

def convert_logging_param(obj):
Expand All @@ -255,6 +256,8 @@ def convert_logging_param(obj):
return WandbLogger()
if obj == "dagshub":
return DagshubLogger(os.getenv("MLFLOW_TRACKING_URI"))
if obj == "comet_ml":
return CometLogger()

if log_experiment:
if log_experiment is True:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,10 @@ def setup(


log_experiment: bool, default = False
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb')
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb', 'comet_ml')
corresponding to a logger to determine which experiment loggers to use.
Setting to True will use just MLFlow.
If ``wandb`` (Weights & Biases) is installed, will also log there.
If ``wandb`` (Weights & Biases) or ``comet_ml``is installed, will also log there.


experiment_name: str, default = None
Expand Down
2 changes: 2 additions & 0 deletions pycaret/loggers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
from .dashboard_logger import DashboardLogger
from .mlflow_logger import MlflowLogger
from .wandb_logger import WandbLogger
from .comet_logger import CometLogger

__all__ = [
"BaseLogger",
"DashboardLogger",
"MlflowLogger",
"WandbLogger",
"DagshubLogger",
"CometLogger"
]
69 changes: 69 additions & 0 deletions pycaret/loggers/comet_logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from pycaret.loggers.base_logger import BaseLogger
from pathlib import Path
import uuid
from copy import deepcopy
import joblib

try:
import comet_ml
except ImportError:
comet_ml = None

class CometLogger(BaseLogger):
def __init__(self) -> None:
if comet_ml is None:
raise ImportError(
"CometLogger requires Comet. Install using `pip install comet_ml`"
)
super().__init__()
self.run = None

def init_experiment(self, exp_name_log, full_name=None, **kwargs):
self.run = comet_ml.Experiment(project_name=exp_name_log, **kwargs)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason to call it "run" and not "experiment"?

does it have to be public?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run is what they used for other loggers and they have made it public. so just am following the maintainer's format

self.run.set_name(full_name)
self.run.log_other('Created from', 'pycaret')
return self.run

def log_params(self, params, model_name=None):
sherpan marked this conversation as resolved.
Show resolved Hide resolved
self.run.log_parameters(params, prefix=model_name)

def set_tags(self, source, experiment_custom_tags, runtime):
tags = [source, runtime]
self.run.add_tags(tags)
self.run.log_others(experiment_custom_tags)

def log_sklearn_pipeline(self, experiment, prep_pipe, model, path=None):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to remove explicit dependency on joblib it's possible to add a method to set a "model_dumper" property on this class

def __init__(self, pipline_dumper):
    self._pipeline_dumper = pipeline_dumper # user can pass joblib.dump or any other suitable function 

the price to pay is that it's not part of the standard API

pipeline = deepcopy(prep_pipe)
pipeline.steps.append(["trained_model", model])
joblib.dump(pipeline, 'pipeline.pkl')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better use a tempfile.NamedTemporaryFile and not a hard coded 'pipeline.pkl' - it will also remove itself if used as a context manager

self.run.log_model(name='model', file_or_folder='pipeline.pkl')

def log_model_comparison(self, model_result, source):
result_copy = deepcopy(model_result)
if "Object" in result_copy:
result_copy["Object"] = result_copy["Object"].apply(
lambda obj: str(type(obj).__name__)
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this transforamtion should be extracted to another function with a meaningful name, so we understand why it is needed

self.run.log_metrics({source: result_copy})

def log_metrics(self, metrics, source=None):
self.run.log_metrics(metrics)

def log_plot(self, plot, title):
self.run.log_figure(figure=plot, figure_name=title)

def log_hpram_grid(self, html_file, title="hpram_grid"):
self.run.log_html(html_file)

def log_artifact(self, file, type="artifact"):
file_name, extension = None, ""
file_pathlib = Path(file)
file_name = file_pathlib.stem.replace(" ", "_") + str(uuid.uuid1())[:8]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too much going on in one line.

better do this

sanitized_step = Path(file).stem.replace(" ", "_")
short_uiud = str(uuid.uuid1())[:8]
nicer to use "{stem}_{uuid}".format(stem=sanitized_stem, short_uuid)

artifact = comet_ml.Artifact(name=file_name, artifact_type=type)
artifact.add(file)
self.run.log_artifact(artifact)

def finish_experiment(self):
sherpan marked this conversation as resolved.
Show resolved Hide resolved
if self.run:
self.run.end()
6 changes: 4 additions & 2 deletions pycaret/nlp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pycaret.loggers.base_logger import BaseLogger
from pycaret.loggers.dagshub_logger import DagshubLogger
from pycaret.loggers.mlflow_logger import MlflowLogger
from pycaret.loggers.wandb_logger import WandbLogger
from pycaret.loggers.comet_logger import CometLogger
from pycaret.utils import __version__
from pycaret.utils._dependencies import _check_soft_dependencies
from pycaret.utils.generic import get_logger
Expand Down Expand Up @@ -82,7 +82,7 @@ def setup(


log_experiment: bool, default = False
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb')
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb', 'comet_ml')
corresponding to a logger to determine which experiment loggers to use.
Setting to True will use just MLFlow.

Expand Down Expand Up @@ -450,6 +450,8 @@ def convert_logging_param(obj):
return WandbLogger()
if obj == "dagshub":
return DagshubLogger(os.getenv("MLFLOW_TRACKING_URI"))
if obj == "comet_ml":
return CometLogger()

if logging_param:
loggers_list = []
Expand Down
4 changes: 2 additions & 2 deletions pycaret/regression/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,10 @@ def setup(


log_experiment: bool, default = False
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb')
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb', 'comet_ml')
corresponding to a logger to determine which experiment loggers to use.
Setting to True will use just MLFlow.
If ``wandb`` (Weights & Biases) is installed, will also log there.
If ``wandb`` (Weights & Biases) or ``comet_ml`` is installed, will also log there.


system_log: bool or str or logging.Logger, default = True
Expand Down
4 changes: 2 additions & 2 deletions pycaret/regression/oop.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,10 @@ def setup(


log_experiment: bool, default = False
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb')
A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb', 'comet_ml')
corresponding to a logger to determine which experiment loggers to use.
Setting to True will use just MLFlow.
If ``wandb`` (Weights & Biases) is installed, will also log there.
If ``wandb`` (Weights & Biases) or ``comet_ml`` is installed, will also log there.


system_log: bool or str or logging.Logger, default = True
Expand Down