<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Mlflow not saving flavor correctly in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/mlflow-not-saving-flavor-correctly/m-p/91303#M3689</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;Im trying to save my model with mlflow in databricks, it is a xgboost model, when I save it using code it saves with a sklearn flavor and not saves other parameters, also I'm using kedro with kedro-mlflow plugin.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def log_metrics_and_model(model, metrics: pd.DataFrame, params: Dict, X_train: pd.DataFrame):

    model_name = params.get("model_name", "model")
    
    mlflow.log_params(params)
    model_params = model.get_params()
    mlflow.log_params(model_params)

    for metric_name, metric_values in metrics.items():
        mlflow.log_metric(f"{model_name}_{metric_name}_train", metric_values.iloc[0])
        mlflow.log_metric(f"{model_name}_{metric_name}_test", metric_values.iloc[1])
    
    input_example = X_train.iloc[:5]
    signature = infer_signature(X_train, model.predict(X_train.iloc[:5]))

    mlflow.xgboost.log_model(
        model,
        model_name,
        signature=signature,
        input_example=input_example
    )
    &lt;/LI-CODE&gt;&lt;P&gt;In databricks it saves a simple sklearn model, but locally saves xgboost with all properties correctly, any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 22 Sep 2024 03:42:09 GMT</pubDate>
    <dc:creator>Yairama</dc:creator>
    <dc:date>2024-09-22T03:42:09Z</dc:date>
    <item>
      <title>Mlflow not saving flavor correctly</title>
      <link>https://community.databricks.com/t5/machine-learning/mlflow-not-saving-flavor-correctly/m-p/91303#M3689</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;Im trying to save my model with mlflow in databricks, it is a xgboost model, when I save it using code it saves with a sklearn flavor and not saves other parameters, also I'm using kedro with kedro-mlflow plugin.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def log_metrics_and_model(model, metrics: pd.DataFrame, params: Dict, X_train: pd.DataFrame):

    model_name = params.get("model_name", "model")
    
    mlflow.log_params(params)
    model_params = model.get_params()
    mlflow.log_params(model_params)

    for metric_name, metric_values in metrics.items():
        mlflow.log_metric(f"{model_name}_{metric_name}_train", metric_values.iloc[0])
        mlflow.log_metric(f"{model_name}_{metric_name}_test", metric_values.iloc[1])
    
    input_example = X_train.iloc[:5]
    signature = infer_signature(X_train, model.predict(X_train.iloc[:5]))

    mlflow.xgboost.log_model(
        model,
        model_name,
        signature=signature,
        input_example=input_example
    )
    &lt;/LI-CODE&gt;&lt;P&gt;In databricks it saves a simple sklearn model, but locally saves xgboost with all properties correctly, any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2024 03:42:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/mlflow-not-saving-flavor-correctly/m-p/91303#M3689</guid>
      <dc:creator>Yairama</dc:creator>
      <dc:date>2024-09-22T03:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Mlflow not saving flavor correctly</title>
      <link>https://community.databricks.com/t5/machine-learning/mlflow-not-saving-flavor-correctly/m-p/91313#M3690</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;It was the magic of all porpoise clusters, just restart the cluster and done x.x&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2024 04:40:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/mlflow-not-saving-flavor-correctly/m-p/91313#M3690</guid>
      <dc:creator>Yairama</dc:creator>
      <dc:date>2024-09-22T04:40:24Z</dc:date>
    </item>
  </channel>
</rss>

