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

Comet Logging #1

wants to merge 236 commits into from

Conversation

sherpan
Copy link
Owner

@sherpan sherpan commented Jan 10, 2023

Related Issue or bug

Info about Issue or bug

Closes #[issue number that will be closed through this PR]

Describe the changes you've made

A clear and concise description of what you have done to successfully close your assigned issue. Any new files? or anything you feel to let us know!

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

Describe if there is any unusual behaviour of your code(Write NA if there isn't)

A clear and concise description of it.

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

Screenshots

Original Updated
original screenshot updated screenshot

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 = 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

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

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)

pycaret/loggers/comet_logger.py Show resolved Hide resolved
Yard1 and others added 30 commits March 18, 2023 18:15
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
…p_to_3.0.0

Remove nightly build, bump version to 3.0.0
added index cleaning utility for time series
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
…e_#3457

fix of CatboostRegresser on GPU with distribution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.