mlflowpycaret

MLflow not tracking anything with pycaret


I have the mlflow ui (v.2.1.1.) running. This code with pycaret 2.3.10 does not track anything for some reason. Only the experiment name shows up.

import pycaret
import mlflow
mlflow.set_tracking_uri("http://localhost:5000")

# import libraries
import pandas as pd
import numpy as np

# read csv data
data = pd.read_csv('https://raw.githubusercontent.com/srees1988/predict-churn-py/main/customer_churn_data.csv')
data = data.sample(1000)

# initialize setup
from pycaret.classification import *

s = setup(data, target = 'Churn', session_id = 123, ignore_features = ['customerID'], log_experiment = True, experiment_name = 'churn1', silent=True)

best_model = compare_models()
model = create_model('rf')
plot_model(model, 'confusion_matrix')
predict_model(model)
finalize_model(model)
save_model(model, 'model')

I would expect the metrics and potentially the images to appear.

enter image description here


Solution

  • Did you try to expand the square button in front of Session Initialized? For me, it's logged under the session. If it does not work try to downgrade mlflow to the version that PyCaret supports.

    The current version of PyCaret (3.0.0rc8) only supports the mlflow between 1.24.0 and less than 2.0.0 you can reference from here.

    mlflow_logging