DEV Community

Cover image for Getting Started with Comet ML
Angelica Lo Duca
Angelica Lo Duca

Posted on

Getting Started with Comet ML

An overview of the popular experimentation platform for Machine Learning, with a practical example.

Comet ML is an experimentation platform, which permits testing Machine Learning projects, from the beginning up to the final monitoring. Many other similar platforms exist on the Web, including Neptune.ai, Guild.ai, Sacred, and so on.
Comet ML can be easily integrated with the most popular Machine Learning libraries, including scikit-learn, Pytorch, Tensorflow, Keras, and so on. Experiments can be written in Python, Javascript, Java, R, and REST APIs.
In this article, I focus on Python.

The article is organized as follows:

  • Overview of Comet ML
  • Working with Comet ML
  • Example of usage

1 Overview of Comet ML

Comet ML is an online platform, which permits tracking experiments. The main advantage of Comet ML is that I can easily build a reporting dashboard and a monitoring system.
Comet ML provides the following features:

  • compare experiments: I can easily build different experiments for the same project, and compare the results, in terms of metrics, system metrics, parameters, and so on; monitor the model: I can monitor the model from the early stages up to production. This can be done through alerts and debugging strategies;
  • collaborate with other people: I can share my workspace project with other people;
  • build reports and panels: starting from the results of my experiment, I can easily build reports and dashboards; keep my project public or make it public.

2 Working with Comet ML

Once I enter the Comet ML Web site, I can create a free account. Then, I log in to the platform and I create a new project, by clicking the relative top right button. I fill the form with needed information.

When I click on the Create button, an empty dashboard appears.

I can add a new experiment, by clicking the button on the top right of the page (+Add). I select Experiment from the dropdown menu.
The platform generates a new API for the experiment, that can be used in my Python code:

# import comet_ml at the top of your file
from comet_ml import Experiment

# Create an experiment with your api key
experiment = Experiment(
    api_key="PUT HERE MY API KEY",
    project_name="decisiontree",
    workspace="PUT HERE MY ACCOUNT NAME",
)
Enter fullscreen mode Exit fullscreen mode

Now, I need to install the comet_ml Python package on my local computer:

pip3 install comet_ml 
Enter fullscreen mode Exit fullscreen mode

And then I can start coding, as usual.

Continue Reading on Towards Data Science

Top comments (0)