Share a PyCaret report

PyCaret compresses a week of model comparison into four lines, which creates a new problem: you now have a defensible model selection and no defensible document. compare_models() prints a leaderboard into a notebook cell, and the next person asking "why this model?" gets a screenshot of a table.

For a decision that determines what ships, that is a thin record.

Export the three things worth reviewing

The leaderboard. pull() returns the last scoring grid as a DataFrame:

from pycaret.classification import setup, compare_models, pull, plot_model

setup(data=df, target="churn", session_id=42)
best = compare_models(n_select=3)
leaderboard = pull().to_html(index=False)

The plots that justify the pick.

for p in ("auc", "confusion_matrix", "feature"):
    plot_model(best[0], plot=p, save=True)   # → AUC.png, etc.

The explainer, when the model needs defending rather than describing:

from explainerdashboard import ClassifierExplainer, ExplainerDashboard

ExplainerDashboard(ClassifierExplainer(model, X_test, y_test)).save_html("dashboard.html")

dashboard(model) in PyCaret starts a server, which is local-only and dies with the kernel — save_html is the version that travels.

Publish it

Drop the HTML into Comma, or from the notebook:

import requests, os

requests.post(
    "https://commareports.com/api/v1/reports",
    headers={"Authorization": f"Bearer {os.environ['COMMA_API_TOKEN']}"},
    json={"title": "Churn model selection — v4", "html": leaderboard},
).raise_for_status()

Attach the plot images as report assets on the same report, so the leaderboard and its evidence stay at one URL. Scripts run inside a sandboxed iframe (allow-scripts, no allow-same-origin), so an exported explainer dashboard keeps its tabs and interactive plots. See the API reference.

The document is the decision, not the search

Worth being deliberate about what goes in. The notebook is the search; the report is the decision. A useful one is short:

  • the leaderboard, so the alternatives are visible,
  • the two or three plots behind the choice,
  • one paragraph on why the top-scoring model was not selected, when it was not — usually latency, interpretability, or a leak you found.

That last item is the one that never gets written down and the one every future reviewer wants.

Comments where the row is

Model review fails in the usual way: the objection arrives days later in a channel, detached from the table it is about. Anchored threads keep it on the row — "the CatBoost recall is inflated, the split is time-ordered and this isn't" — and survive republishing when the model is retrained at the same URL. See commenting on HTML.

Who can see it

Per report: private, your team, anyone signed in at your domain, or anyone with the link. A leaderboard over customer data plus feature importances is internal — use team or domain access. See sharing & access control.

Limits

  • Entry HTML: 5 MB. An exported explainer dashboard can exceed it — publish the leaderboard as the body and attach the dashboard as an asset.
  • Assets: 25 MB per file, 250 MB and 500 files total.
  • 60 requests/minute per token.

Try it

Comma is free — unlimited reports, unlimited commenters, unlimited revision history.

Publish a model report →

Related