<?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 Why I started evaluating the pipeline instead of choosing the best model at each stage in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/why-i-started-evaluating-the-pipeline-instead-of-choosing-the/m-p/174794#M4736</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I recently worked on a multi-label classification pipeline on Databricks, using embeddings, scikit-learn classifiers, Delta Lake, and MLflow to track experiments.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;One result caught my attention: the embedding model that ranked fourth in my initial screening ended up in the best-performing combination when evaluated with the actual classifier.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The experiments also surfaced a few less obvious issues:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;The best decision threshold varied significantly across model combinations.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Rebuilding the label vocabulary at inference time could silently associate predictions with the wrong labels.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Differences between training and inference inputs could go unnoticed if you only evaluate individual stages.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;I documented the experiments, results, code, and lessons learned here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://medium.com/@FrankAzzollini/why-the-best-model-on-its-own-wasnt-the-best-pipeline-801494136b77" target="_blank" rel="noopener"&gt;My Medium Article&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm curious how others approach this in Databricks: when you have multiple interacting components, do you run a joint search over the pipeline, or narrow down candidates using stage-level metrics first?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Oct 2026 19:42:25 GMT</pubDate>
    <dc:creator>FrankAzzollini</dc:creator>
    <dc:date>2026-10-27T19:42:25Z</dc:date>
    <item>
      <title>Why I started evaluating the pipeline instead of choosing the best model at each stage</title>
      <link>https://community.databricks.com/t5/machine-learning/why-i-started-evaluating-the-pipeline-instead-of-choosing-the/m-p/174794#M4736</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I recently worked on a multi-label classification pipeline on Databricks, using embeddings, scikit-learn classifiers, Delta Lake, and MLflow to track experiments.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;One result caught my attention: the embedding model that ranked fourth in my initial screening ended up in the best-performing combination when evaluated with the actual classifier.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The experiments also surfaced a few less obvious issues:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;The best decision threshold varied significantly across model combinations.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Rebuilding the label vocabulary at inference time could silently associate predictions with the wrong labels.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Differences between training and inference inputs could go unnoticed if you only evaluate individual stages.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;I documented the experiments, results, code, and lessons learned here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://medium.com/@FrankAzzollini/why-the-best-model-on-its-own-wasnt-the-best-pipeline-801494136b77" target="_blank" rel="noopener"&gt;My Medium Article&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm curious how others approach this in Databricks: when you have multiple interacting components, do you run a joint search over the pipeline, or narrow down candidates using stage-level metrics first?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2026 19:42:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/why-i-started-evaluating-the-pipeline-instead-of-choosing-the/m-p/174794#M4736</guid>
      <dc:creator>FrankAzzollini</dc:creator>
      <dc:date>2026-10-27T19:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why I started evaluating the pipeline instead of choosing the best model at each stage</title>
      <link>https://community.databricks.com/t5/machine-learning/why-i-started-evaluating-the-pipeline-instead-of-choosing-the/m-p/175336#M4740</link>
      <description>&lt;P&gt;Your fourth-place embedding winning the full combo is a great example of why picking the best model at each stage can mislead you. Stage metrics measure each piece alone, but the classifier and threshold only see what the embedding hands them.&lt;/P&gt;&lt;P&gt;What tends to work for me is a middle path: use stage-level metrics only to prune the clearly bad options (keep the top few, not the top one), then do a joint search over what's left. With MLflow nested runs that stays readable:&lt;/P&gt;&lt;PRE&gt;import itertools, mlflow, numpy as np
from sklearn.metrics import f1_score

with mlflow.start_run(run_name="pipeline_search"):
    for emb, clf_name in itertools.product(top_embeddings, classifiers):
        with mlflow.start_run(run_name=f"{emb}+{clf_name}", nested=True):
            X_tr, X_val = embed(emb, train_texts), embed(emb, val_texts)
            clf = make_clf(clf_name).fit(X_tr, Y_tr)   # e.g. OneVsRest, returns (n, n_labels) probs
            probs = clf.predict_proba(X_val)
            t, f1 = max(((t, f1_score(Y_val, probs &amp;gt;= t, average="micro"))
                         for t in np.arange(0.1, 0.9, 0.05)), key=lambda x: x[1])
            mlflow.log_params({"embedding": emb, "classifier": clf_name, "threshold": round(t, 2)})
            mlflow.log_metric("val_micro_f1", f1)&lt;/PRE&gt;&lt;P&gt;Two things I'd add to your list:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Tune the threshold per combination on validation data, then report the final number on a separate test split. Otherwise the threshold quietly overfits.&lt;/LI&gt;&lt;LI&gt;For the label vocabulary problem, save the exact label order with the model, e.g. mlflow.log_dict({"labels": list(mlb.classes_)}, "labels.json"), or wrap binarizer, classifier and threshold into one pyfunc so inference can't rebuild it differently.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Mon, 02 Nov 2026 14:41:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/why-i-started-evaluating-the-pipeline-instead-of-choosing-the/m-p/175336#M4740</guid>
      <dc:creator>Isaac_18</dc:creator>
      <dc:date>2026-11-02T14:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why I started evaluating the pipeline instead of choosing the best model at each stage</title>
      <link>https://community.databricks.com/t5/machine-learning/why-i-started-evaluating-the-pipeline-instead-of-choosing-the/m-p/175400#M4741</link>
      <description>&lt;P&gt;Frank, here’s a third answer to your joint-search vs. prune-first question, building on &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/55845"&gt;@Isaac&lt;/a&gt;_18’s.&lt;/P&gt;&lt;P&gt;Instead of running a new search every time, I build an offline evaluation suite from historical run data. I replay candidate pipelines against those captured snapshots, try different combinations, and score each on the final outcome. Because the suite is built once and reused, every later change is scored against the same baseline, whether it’s a new embedding model, a different classifier or a retuned threshold. It also works as a regression check.&lt;/P&gt;&lt;P&gt;I also change what counts as winning. Instead of taking the combination with the top score, I look for the smallest, fastest, or most deterministic pipeline that still clears an acceptable bar on the suite. That keeps the pipeline cheaper to run and easier to debug, which matters for batches that have to run reliably every day.&lt;/P&gt;&lt;P&gt;On the label vocabulary, to build on Isaac_18’s mlflow.log_dict tip: load the pinned labels at inference and fail loudly if they don’t match the model’s output width. Pinning prevents the drift, and the check catches it if something upstream changes anyway.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;labels = mlflow.artifacts.load_dict(f"runs:/{run_id}/labels.json")["labels"]
probs = model.predict_proba(X)
if probs.shape[1] != len(labels):
    raise ValueError(f"{len(labels)} labels but model emits {probs.shape[1]} outputs")&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 02 Nov 2026 19:26:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/why-i-started-evaluating-the-pipeline-instead-of-choosing-the/m-p/175400#M4741</guid>
      <dc:creator>slowder</dc:creator>
      <dc:date>2026-11-02T19:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why I started evaluating the pipeline instead of choosing the best model at each stage</title>
      <link>https://community.databricks.com/t5/machine-learning/why-i-started-evaluating-the-pipeline-instead-of-choosing-the/m-p/177186#M4747</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The fourth-place embedding winning the full pipeline is a good reason to score the components together. I used MLflow on an attrition model, and for your setup I would add one check before deployment. Run the same raw inputs through the notebook pipeline and the logged model, then compare the final labels for each input.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Say the notebook labels a support ticket as Billing, but the logged model returns Account Access for that exact ticket. I would compare the scores before thresholding. If the scores match, check whether both paths use the same threshold and label order. If the scores differ, start by checking how each path cleans and embeds the text.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would include one ticket with multiple labels and another close to the decision threshold. That gives you two cases worth keeping in a regression check for the next model version.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2026 13:01:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/why-i-started-evaluating-the-pipeline-instead-of-choosing-the/m-p/177186#M4747</guid>
      <dc:creator>tajamulkhan</dc:creator>
      <dc:date>2026-11-21T13:01:35Z</dc:date>
    </item>
  </channel>
</rss>

