cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
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.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group