I want to use MLFlow to do some tracking but the code in the documentation’s tutoriel doesn’t work ?
Here’s the code :
import mlflow
from mlflow.models import infer_signature
import pandas as pd
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
mlflow.set_tracking_uri(uri="http://127.0.0.1:8080")
mlflow.set_experiment("MLflow Quickstart")
The result is a huge exception error, I will post here the end of it :
MlflowException: API request to http://127.0.0.1:8080/api/2.0/mlflow/experiments/get-by-name failed with exception HTTPConnectionPool(host='127.0.0.1', port=8080): Max retries exceeded with url: /api/2.0/mlflow/experiments/get-by-name?experiment_name=MLflow+Quickstart (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001B3EAE274D0>: Failed to establish a new connection: [WinError 10061] Aucune connexion n’a pu être établie car l’ordinateur cible l’a expressément refusée'))
It seems it has to do with some authorisation but I cannot figure it out what.
P.S : I also tried Databricks to avoid the trouble but I cannot create an account, it seems it’s happening quite often, I asked for help on the official website but so far the solution provided didn’t work. So for now I’m stuck with the local
>Solution :
The error you’re encountering suggests that the connection to the MLflow tracking server is being refused. This could be due to several reasons:
Server not running: Ensure that the MLflow server is running and accessible at http://127.0.0.1:8080. You can start the server using the command mlflow server.
Firewall or network issues: Make sure that your firewall or network settings allow connections to 127.0.0.1 on port 8080.
Authorization: If your MLflow server requires authentication, you need to provide the appropriate credentials in your code or through environment variables.
Server configuration: Check the MLflow server configuration to ensure it’s set up correctly and is not blocking connections.
Regarding Databricks, if you’re having trouble creating an account, you might want to reach out to their support for assistance. It’s a common platform for MLflow, so resolving the account creation issue would provide you with an alternative solution.