<?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 Re: Issue with FeatureEngineeringClient().log_model() in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/issue-with-featureengineeringclient-log-model/m-p/127351#M4182</link>
    <description>&lt;P&gt;There is a typo in the libraries versions: I was using&amp;nbsp;databricks-feature-engineering version 0.13, by downgrading to&amp;nbsp;databricks-feature-engineering==0.12.1 (current stable version as of today: 4th August 2025) the code above functions as expected.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Aug 2025 14:59:03 GMT</pubDate>
    <dc:creator>FedeRaimondi</dc:creator>
    <dc:date>2025-08-04T14:59:03Z</dc:date>
    <item>
      <title>Issue with FeatureEngineeringClient().log_model()</title>
      <link>https://community.databricks.com/t5/machine-learning/issue-with-featureengineeringclient-log-model/m-p/127062#M4177</link>
      <description>&lt;P&gt;I am receiving a weird error when trying to log an xgboost model using feature engineering api.&lt;/P&gt;&lt;P&gt;I was able to log the model correctly with classic mlflow.xgboost.log_model() without any issues but when I switched to feature store recommended approach I am not able to correctly log it.&lt;/P&gt;&lt;P&gt;This is the error I get, quite weird since I am not passing any code_path argument:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;TypeError: &lt;/SPAN&gt;log_model() got an unexpected keyword argument 'code_path'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am using:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- Runtime: 15.4.x-cpu-ml-scala2.12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- mlflow:&amp;nbsp;'3.1.4'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&amp;nbsp;databricks-feature-store: '0.17.0'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- xgboost:&amp;nbsp;'3.0.2'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here below is the code (&lt;A href="https://docs.databricks.com/aws/en/machine-learning/feature-store/train-models-with-feature-store#train-models-and-perform-batch-inference-with-feature-tables" target="_self"&gt;I believe I'm following all the right steps per documentation) :&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;mlflow.set_tracking_uri("databricks")
mlflow.set_registry_uri("databricks-uc")

# Read feature store from Unity Catalog
feature_store_name = "catalog.schema.name"
fe = FeatureEngineeringClient()
df_spark = fe.read_table(name=feature_store_name)

seed = 42
target = 'y'
features = ["list of features to use"]
columns_to_keep = ['CustomerID', target]
df_spark = df_spark.select(columns_to_keep)

# Create feature lookup
feature_lookups = [
    FeatureLookup(
      table_name=feature_store_name,
      feature_names=features,
      lookup_key=['CustomerID']
    )
  ]

# Create a training set
training_set = fe.create_training_set(df=df_spark, 
                                      feature_lookups=feature_lookups, 
                                      label=target,
                                      exclude_columns=['CustomerID'])

# Loading the training df
training_df = training_set.load_df()

# Split the data into training and test sets
training_df, test_df = training_df.randomSplit([0.8, 0.2], seed=seed)
training_df = training_df.toPandas()
test_df = test_df.toPandas()

with mlflow.start_run() as run:
    
    xgb_clf = XGBClassifier(colsample_bytree=0.05,
                            max_depth=3,
                            max_leaves=20,
                            eta=0.1,
                            n_estimators=10,
                            seed=seed)

    xgb_clf_model = xgb_clf.fit(training_df[features], training_df[target])

    # prediction
    train_pred = xgb_clf_model.predict_proba(training_df[features])[:, 1]
    test_pred = xgb_clf_model.predict_proba(test_df[features])[:, 1]

    # score
    auc_train = roc_auc_score(training_df[target], train_pred)
    auc_test = roc_auc_score(test_df[target], test_pred)

    # Log model
    fe.log_model(
        model=xgb_clf_model.get_booster(),
        artifact_path="model",
        flavor=mlflow.xgboost,
        training_set=training_set
        )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jul 2025 09:21:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/issue-with-featureengineeringclient-log-model/m-p/127062#M4177</guid>
      <dc:creator>FedeRaimondi</dc:creator>
      <dc:date>2025-07-31T09:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with FeatureEngineeringClient().log_model()</title>
      <link>https://community.databricks.com/t5/machine-learning/issue-with-featureengineeringclient-log-model/m-p/127351#M4182</link>
      <description>&lt;P&gt;There is a typo in the libraries versions: I was using&amp;nbsp;databricks-feature-engineering version 0.13, by downgrading to&amp;nbsp;databricks-feature-engineering==0.12.1 (current stable version as of today: 4th August 2025) the code above functions as expected.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2025 14:59:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/issue-with-featureengineeringclient-log-model/m-p/127351#M4182</guid>
      <dc:creator>FedeRaimondi</dc:creator>
      <dc:date>2025-08-04T14:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with FeatureEngineeringClient().log_model()</title>
      <link>https://community.databricks.com/t5/machine-learning/issue-with-featureengineeringclient-log-model/m-p/127352#M4183</link>
      <description>&lt;P&gt;Thanks for sharing&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/170768"&gt;@FedeRaimondi&lt;/a&gt;&amp;nbsp; solution with us.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2025 15:01:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/issue-with-featureengineeringclient-log-model/m-p/127352#M4183</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2025-08-04T15:01:56Z</dc:date>
    </item>
  </channel>
</rss>

