cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

Disable mlflow autologging in a helper notebook

invalidargument
New Contributor III

We have a helper function that uses a sklearn estimator. We don't want to to be logged to mlflow.

I can do

def myfunc():
    import mlflow
    with mlflow.autolog.ignore:
        # train model
        # use model
    return predictions
But 

I get info prints:
2024/11/29 08:33:05 INFO mlflow.tracking.fluent: Autologging successfully enabled for statsmodels.
2024/11/29 08:33:06 INFO mlflow.tracking.fluent: Autologging successfully enabled for sklearn.
2. I will change the state of autologging to True, even if the user had it to autologging = False before calling myfunc()

How can I solve this? Can I get state of autologging somehow so I can set it back? How to supress info prints?

It would be nice if something like this would be supported, but I cant find anything
def myfunc():
    import mlflow
    with mlflow.autolog.ignore:
        # train model
        # use model
    return predictions

2 REPLIES 2

MuthuLakshmi
Databricks Employee
Databricks Employee

invalidargument
New Contributor III
mlflow.autolog(disable=True, silent=True) fixes the printing. But my other problem with setting autologging back to previous state is still unsolved. I can't find any information about that problem in the docs.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now