Connect to MLFlow Server¶
First we need to understand that mlflow runs in a server (like if it were another computer). Then we need to know the "adress" of that computer, think of it as if it where the adress of your house. This adress is known as the tracking URI
. To set it up we have two ways:
- Option 1 👉 Especify the tracking URI at the beggining of our code (the one below)
- Option 2 👉 Set the
MLFLOW_TRACKING_URI
environment variable.
In [10]:
Copied!
import mlflow
# Default url for MLFlow is "http://localhost:5000"
MLFLOW_TRACKING_URI = "http://localhost:5000"
mlflow.set_tracking_uri(MLFLOW_TRACKING_URI)
import mlflow
# Default url for MLFlow is "http://localhost:5000"
MLFLOW_TRACKING_URI = "http://localhost:5000"
mlflow.set_tracking_uri(MLFLOW_TRACKING_URI)
We can check the connection to the server by running the following command:
In [11]:
Copied!
# if not working this will raise an exception
experiments = mlflow.search_experiments()
# if not working this will raise an exception
experiments = mlflow.search_experiments()