
Autocarver
io.github.mdefrance由 GitHub 帳號 mdefrance 發布v7.8.4更新於 Nov 4, 2026
Qualify dataset columns and process them against a target with AutoCarver, fully on your machine.
概覽
AutoCarver 的本機 MCP 伺服器,讓助理對資料集欄位進行特徵鑑定,並針對目標變數切分為受監督、易讀的分箱。
- 可以做什麼
- 鑑定資料檔案中的欄位,推斷特徵類型並提出切分方案
- 針對二元、多類別、有序或連續目標切分數值、類別與有序特徵
- 回傳切分後的分箱彙總表,含每箱目標率與頻數
- 全部透過工具呼叫在本機完成,無需手寫程式碼
- 適用情境
- 適合希望由助理為信用評分、詐欺偵測或風險建模準備特徵,或在建模前把原始欄位變成可稽核分箱、又不想自行撰寫分箱程式碼的情境。
- 執行需求
- 以 stdio 方式在本機執行;需安裝含 MCP 擴充的套件,並以 python -m AutoCarver.mcp(或透過 uv)啟動。需要 Python 環境與支援 MCP 的用戶端,如 VS Code Copilot、Claude Desktop 或 Cursor。未宣告驗證或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Autocarver,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[PyPI] [Python] [License] [SPEC 0] [Docs] [Tests] [Coverage]
[AutoCarver in one loop: discretize, rank groupings, carve]
AutoCarver turns raw numeric, categorical, and ordinal columns into supervised, drift-robust, human-readable bins in a few lines of code. Stop losing model performance to suboptimal manual binning — and stop discovering overfit bins in production monitoring.
- Searched, not eyeballed — a dynamic-programming search ranks the candidate groupings by Tschuprow's T (default) or Cramér's V, for your
min_freqandmax_n_mod. - Robust by construction — every candidate grouping is vetoed unless it holds on a held-out dev set (and optional CV folds), at
fittime rather than in monitoring. - Define → carve → model — declare your
Features,fita carver,transform: the whole feature set is carved in one supervised pass, not one notebook per feature. One carver per target type —BinaryCarver,MulticlassCarver,OrdinalCarver,ContinuousCarver(regression) — all with the identical API. - AI-assisted — a local MCP server lets your LLM assistant qualify and carve columns through tool calls, fully on your machine.
On the Titanic quick start, Fare collapses from 72 pre-carving modalities to 2 bins while its association with survival rises: Tschuprow's T 0.18 raw → 0.29 carved.
Built for credit scoring, fraud detection, and risk modeling.
🆕 What's New
📊 Cross-validated robustness. fit now accepts a cv argument for extra
held-out robustness views on top of (or instead of) a dev set:
carver.fit(X, y, cv=5). Accepts an int, any scikit-learn splitter, or
explicit index pairs, resolved via sklearn.model_selection.check_cv — folds
veto over-fit combinations but never reorder them (ranks stay anchored to the
full train set). See Cross-validation folds.
🤖 LLM & MCP integration. AutoCarver now ships a local Model Context Protocol server: point an MCP-aware assistant (VS Code Copilot, Claude Desktop, Cursor, …) at a data file and let it qualify the columns and carve them against your target through tool calls. The server runs fully on your machine — your dataset is never sent to AutoCarver or any external service (only your own LLM provider sees what the assistant shares). Carving quality depends on the LLM, so have a human confirm the feature definitions before production use. See the LLM & MCP guide.
Once configured, just ask your assistant:
Qualify the columns in
titanic.csvand carve them againstSurvived.
The assistant infers feature types, proposes a carving, and returns the summary table — no code written by hand.
Client config
Add to .vscode/mcp.json (VS Code / GitHub Copilot) or claude_desktop_config.json (Claude Desktop, under mcpServers instead of servers):
If you use uv, point command at uv instead so it resolves the environment for you:
Install
Quick Start
You already have a DataFrame and a target — that's the first box ticked before you start:
- Load data
- Split train / dev
- Declare features by type
- Fit the carver, validated on the dev set
- Inspect the carved bins
- Persist
The rest is the snippet below — binary classification on the Titanic dataset:
min_freq and max_n_mod are the only two knobs that matter to start with — the defaults (0.02 / 5) reflect common scoring practice, and every behavioral toggle lives in one ProcessingConfig object. Scan, adjust, move on.
For multiclass classification use MulticlassCarver (one binning per feature, against the full K-class target) — or OneVsRestCarver for a separate binning per class; for ordinal targets use OrdinalCarver; for regression use ContinuousCarver — the API is identical. To pre-select features by target association and inter-feature redundancy, pipe the carved output through ClassificationSelector or RegressionSelector with features=carver.features (the carver carves its own copy, so your original features stay raw).
What you get
Two questions worth answering before your next model review: can you defend every bin boundary of your current model to a stakeholder — and can you show each one holds on data it has never seen? AutoCarver makes both a one-liner:
-
The best grouping, not the first acceptable one — candidate groupings are ranked by Tschuprow's T (default) or Cramér's V, and the highest-ranked one that holds on the dev set is kept, so you don't stop at the first grouping that looks fine.
-
Stop silent overfitting before production — bins that only exist in your training sample degrade quietly under drift. Every candidate combination is validated on a dev set (and optional CV folds): any whose target rates flip or whose buckets fall below
min_freqis rejected at fit time, not discovered in monitoring. -
First-class ordinal features —
OrdinalDiscretizerenforces your declared modality order, so under-represented levels are merged with their nearest neighbour instead of being collapsed by frequency. -
You are the final auditor —
carver.features.summaryandcarver.features.historyexpose the bin definitions, per-bin target rate / frequency, and the full carving trace; disagree with a boundary and you can override it, andtransformapplies your fix like any carved bin: -
Interpretable buckets — human-readable boundaries you can audit, document, and ship to a scorecard.
-
Dimensionality reduction — groups under-represented modalities and caps bins per feature (
max_n_mod), which is especially useful before one-hot encoding. -
Feature pre-selection —
ClassificationSelector/RegressionSelectorrank features by target association and filter on inter-feature correlation.
[Raw feature vs AutoCarver buckets: frequency and target rate before/after supervised binning]
Titanic Age, one BinaryCarver.fit call: 84 raw values collapse to 3 buckets with a monotonic survival rate.
How does it compare?
All three libraries are sklearn-Pipeline compatible; AutoCarver adds JSON round-trip persistence (carver.save("...json")). AutoCarver (ClassificationSelector, RegressionSelector) and optbinning (BinningProcess(selection_criteria=...)) both offer feature pre-selection. The full feature matrix, side-by-side runnable snippets, and a "when to pick which" guide live on the comparison page.
Documentation
Full reference, tutorials, and end-to-end notebook examples on ReadTheDocs.
來源:README.md,提交 6f003ab
工具
0版本歷史
5- v7.8.4最新Nov 4, 2026
- v7.8.3Oct 29, 2026
- v7.8.2Oct 25, 2026
- v7.8.1Sep 30, 2026
- v7.8.0Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分