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 MLFLOW TRACKING URI
. To set it up we have two ways:
Option 1: Set the tracking URI at the beggining of our code¶
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)
Option 2: Set the tracking URI as an environment variable¶
export MLFLOW_TRACKING_URI=http://localhost:5000
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()