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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note to docstring for fluent API set_experiment #10795

Merged
merged 4 commits into from Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 13 additions & 5 deletions docs/source/tracking/tracking-api.rst
Expand Up @@ -60,12 +60,20 @@ local path to log data to a directory. The URI defaults to ``mlruns``.

:py:func:`mlflow.get_tracking_uri` returns the current tracking URI.

:py:func:`mlflow.create_experiment` creates a new experiment and returns its ID. Runs can be
launched under the experiment by passing the experiment ID to ``mlflow.start_run``.
:py:func:`mlflow.create_experiment` creates a new experiment and returns the experiment ID. Runs can be
launched under the experiment by passing the experiment ID to ``mlflow.start_run`` or
by setting the active experiment with :py:func:`mlflow.set_experiment`, passing in the experiment ID of the created
experiment.

:py:func:`mlflow.set_experiment` sets an experiment as active and returns the active experiment instance. If you do not
specify an experiment in :py:func:`mlflow.start_run`, new runs are launched under this experiment.

.. note::
If the experiment being set by name does not exist, a new experiment will be
created with the given name. After the experiment has been created, it will be set
as the active experiment. On certain platforms, such as Databricks, the experiment name
must be an absolute path, e.g. ``"/Users/<username>/my-experiment"``.

:py:func:`mlflow.set_experiment` sets an experiment as active. If the experiment does not exist,
creates a new experiment. If you do not specify an experiment in :py:func:`mlflow.start_run`, new
runs are launched under this experiment.

:py:func:`mlflow.start_run` returns the currently active run (if one exists), or starts a new run
and returns a :py:class:`mlflow.ActiveRun` object usable as a context manager for the
Expand Down
11 changes: 7 additions & 4 deletions mlflow/tracking/fluent.py
Expand Up @@ -91,10 +91,13 @@ def set_experiment(
name via `experiment_name` or by ID via `experiment_id`. The experiment name and ID cannot
both be specified.

:param experiment_name: Case sensitive name of the experiment to be activated. If an experiment
with this name does not exist, a new experiment wth this name is
created. On certain platforms such as Databricks, the experiment name
must an absolute path, e.g. ``"/Users/<username>/my-experiment"``.
.. note::
If the experiment being set by name does not exist, a new experiment will be
created with the given name. After the experiment has been created, it will be set
as the active experiment. On certain platforms, such as Databricks, the experiment name
must be an absolute path, e.g. ``"/Users/<username>/my-experiment"``.

:param experiment_name: Case sensitive name of the experiment to be activated.
:param experiment_id: ID of the experiment to be activated. If an experiment with this ID
does not exist, an exception is thrown.
:return: An instance of :py:class:`mlflow.entities.Experiment` representing the new active
Expand Down