Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]¶
[0.14.0] — 2026-06-07¶
Added¶
- パフォーマンスベンチマーク基盤 (Phase 1) を追加 (#29, H-0021)。
benchmarks/にpytest-benchmarkベースの計測スイートを置き、make benchで実行する。catdap1/catdap2/optimal_binning/discover_error_slicesの hot path を固定 seed の合成 データでスケーリング計測し、ベースラインをdocs/performance.mdに記録。 pytest-benchmarkは dev 専用のbenchdependency-group (利用者向け extra でもdevでもない)。py-cpuinfoのみに依存し numpy/pandas の version cap を持たないため uv の universal lock を汚染しない。wheel/sdist には含まれない。benchmarks/はtestpaths外のためmake ci/make testでは収集・実行されない。discover_error_slicesベンチは OOM 回避のため強くバウンド (max_vars=2、max_candidates上限、5k 行 subsample、slowマーク)。Adult Income は実 fetch せず 形状を模倣した合成データを使用 (network 計測ノイズ回避)。- nightly 非ブロッキング ベンチマーク CI (Phase 2) を追加 (#161, H-0022)。
.github/workflows/benchmarks.ymlが schedule (03:00 UTC) /workflow_dispatchでmake benchを実行し、github-action-benchmarkで履歴をgh-pagesブランチ (dev/bench/) に蓄積。回帰時 (≥1.5×) はコミットコメントで警告するのみで PR/コミットを ブロックしない (fail-on-alert: false)。output.jsonは artifact 保存。make ciの 挙動・時間は不変。 - Pages は docs サイト (Actions デプロイ) が使用中のため、チャートは
gh-pagesブランチ 保存のみで公開 URL には載せない (docs サイトと非競合)。 - scheduled workflow は default branch (
main) 定義で発火するため、nightly 自動実行は 本ワークフローが main に乗る次回リリース以降に有効化。それまではworkflow_dispatchで検証。 - ベンチマーク PR-delta コメント (Phase 3) を追加 (#161, H-0023)。
src/pycatdap/**を変更する PR で非 slow subset を実行し、gh-pagesの baseline と比較した delta を PR コメント (レビューコメント) として投稿 (comment-always、pull-requests: write必須)。履歴は書き換えず (auto-push/save-data-file: false)、PR をブロックしない (fail-on-alert: false)。same-repo PR 限定 (fork PR は read-only token のため検証のみ)。これで #161 (Phase 2+3) 完了。
Changed¶
optimal_binningの auto-accuracy (accuracy=None) が初期ビン数を上限化 (#164, H-0024)。 最小ギャップが範囲に対し_MAX_AUTO_BINS=256を超える初期ビンを生む高カーディナリティ連続 データでは accuracy をrange/256に広げUserWarningを出す。これにより従来ハング/OOM して いた全ユニーク連続 float (例: 10万行 >200s 未完了) が短時間で完了 (実測 0.245s)。 明示accuracyは従来通り verbatim (R 厳密照合・既存挙動に影響なし)。細かい制御は 明示accuracy=を渡す。catdap2 / target_pair の auto パスも同経路で恩恵。
Removed¶
- BREAKING:
pycatdap.datasets.load_hello_goodbyeと同梱データhello_goodbye.csv.gzを削除 (#156, H-0025)。HelloGoodbye は Rcatdap由来で GPL (>=2)・Copyright ISM のため、MIT 配布物 (wheel) に同梱すると下流 (LizyStudio 等 permissive) へ GPL が伝播する。再構成不可 (13954×56 匿名) なため除去。tutorial 04 は 同形状の合成データに書き換え。GPL 化は下流非互換、ISM 許諾は取得不可のため同梱解除を選択。 - BREAKING:
pycatdap.datasets.load_health_dataと同梱データhealth_data.csvを 配布物から除去 (#156, H-0025)。HealthData も catdap 由来 (GPL/ISM)。R bit-exact 照合の 土台のため、非配布の test fixture (tests/fixtures/health_data.csv、wheel/sdist 除外、NOTICEで帰属明記) として保持し検証は CI で継続。tutorial 01 / quickstart / README の デモは permissive なload_heart_disease(UCI) に差替。wheel・sdist に catdap GPL データは 含まれない (uv buildで確認)。
[0.13.0] — 2026-06-07¶
Added¶
- D5 データセット fetcher を追加 (#25, H-0017)。スライス発見・全カテゴリカル CATDAP
のデモ/検証用 UCI 3 データセットを download-on-demand で取得する。既存 D4 fetcher と
同じ
sklearn.datasets.fetch_openmlラッパ流儀で、新規依存なし (既存[data]extra)。 pycatdap.datasets.fetch_wine_quality()— UCI Wine Quality (red+white 結合、 6,497 行)。color ∈ {red, white}列を付与、target はquality。pycatdap.datasets.fetch_bank_marketing()— UCI Bank Marketing (45,211 行)。 OpenML の generic 列V1..V16を UCI 公式名 (age,job, ...) に rename、 target はy。pycatdap.datasets.fetch_mushroom()— UCI Mushroom (8,124 行、全列カテゴリカル)。 target はclass。- pysubgroup interop measure
pycatdap.measures.AICMeasureを追加 (#31, H-0018)。 ΔAIC を pysubgroup の binary-target quality function として公開し、pysubgroup.BeamSearch/SimpleDFSで AIC をスコアに subgroup discovery を実行できる。 pysubgroup は optional 依存で、pycatdap の extra には含めず明示インストール (pip install pysubgroup) する (pysubgroup がnumpy<2.0.0を pin しており、extra 化 すると uv の universal lock がその制約を全 install に伝播させ numpy 2.x を壊すため)。pycatdap.measuresの import は pysubgroup を必須としない (lazy export)。ΔAIC に健全な 上界がないためoptimistic_estimateは提供せず、Apriori / DFS は対象外 (BeamSearch / SimpleDFS 専用)。ガイド:docs/interop/pysubgroup.md。 to_divexplorer_format()にschema="divexplorer"を追加 (#32, H-0019)。ErrorAnalysisResult/SliceDiscoveryResultの両方で、DivExplorer 0.2.x の実カラムsupport / itemset / error / error_div / error_t / length / support_countを直接出力できる。 既定schema="native"は従来出力のまま不変 (後方互換)。support/error_div算出のためSliceDiscoveryResultに additive フィールドn_total/base_error_rateを追加 (引数n_total=/overall_error_rate=で上書き可)。error_tは pycatdap 独自統計 (measure_value / pearson_residual) で DivExplorer の t 値とは異なる旨を docs に明記。 divexplorer は heavyweight (sklearn 等を pull) なため pyproject に含めず、cross-test は 明示pip install divexplorerでローカル検証。ガイド:docs/interop/divexplorer.md。
[0.12.3] — 2026-06-05¶
Changed¶
- R catdap 1.3.5 との strict 数値照合を実稼働化 (#10, #30)。
generate_reference.Rが catdap 1.3.5 の実 API と不整合で実行できなかった問題を修正し、参照 CSV を 生成・コミット。照合は AIC エンジンの厳密一致を検証する: (1) catdap1 のカテゴリ 列、(2) catdap2 のカテゴリ (pool=2) 単変数、(3) 連続変数を R の選んだカット点で ビン化した場合の AIC 等価。連続変数の binning 選択は pycatdap が AIC 貪欲マージ (より AIC 最適) を採用しており R の粗い split とは設計が異なるため、選択そのものは 照合対象外とする (CONTRIBUTING の「R版との照合」参照)。
[0.12.2] — 2026-06-03¶
Changed¶
- 開発品質ゲートを整備 (#34)。ユーザー向け API への影響はなし。
mypy --strictをIPython.*のfollow_imports = "skip"化により、IPython のインストール有無にかかわらず同一結果 (0 エラー) に統一。- ruff に pydocstyle (
D, numpy convention) を追加し、public モジュールの docstring 規約を強制。既存の docstring 違反 17 件を修正。 - pre-commit に
mypy --strictのローカルフックを追加。 make test/make ciを develop CI と同じく slow テスト除外に変更し、 ローカルでネットワーク依存の D4 fetcher がハングする問題を解消。フル実行はmake test-allに分離。
Documentation¶
- DivExplorer 相互運用ガイド
docs/interop/divexplorer.mdを追加 (#32)。pycatdap のto_divexplorer_format()出力と DivExplorer の実スキーマ (0.1.x / 0.2.x 両世代を ソース照合) の対応表、AIC↔divergence のセマンティクス対応、DivExplorer 0.2.x 形式 へ整形する adapter レシピを記載。実スキーマ完全互換 (データ契約変更) は v0.13.0 (#32) で対応予定。 - 公開 Roadmap ページ
docs/project/roadmap.mdを実態へ更新。v0.3.0〜v0.12.0 を 依然「planned」と誤記していたのを released に修正し、v0.12.2 housekeeping / v0.13.0 / v0.14.0 / v1.0.0 の計画を反映 (PLAN.md と整合)。 - チュートリアル名から内部フェーズ呼称を除去し公開名に統一 (#144)。PLAN.md を v0.12.1 出荷実態へ整合 (#143)。
[0.12.1] — 2026-05-30¶
Added¶
pycatdap.error.discover_error_slicesにmax_candidatesパラメータ (デフォルト 200,000) とSliceDiscoveryResult.truncatedフィールドを追加。 support 枝刈りはセルのサイズを制限するが個数は制限しないため、大規模・ 高カーディナリティデータで候補が組合せ爆発しメモリ/時間を使い尽くす恐れがあった (2026-05-30 の OOM インシデント)。上限到達時は探索を打ち切りtruncated=Trueを 立てて警告する (サイレント打ち切りなし)。閾値未満では結果は従来と完全一致 (HISTORY H-0016)。
Fixed¶
discover_error_slices:categorydtype で渡された数値列(例read_csv(dtype="category"))が連続値として AIC binning されず、生の 高カーディナリティカテゴリ扱いになって候補が組合せ爆発する不具合を修正 (H-0016 follow-up、2026-05-30 OOM の根本トリガー)。_is_continuousが 数値カテゴリのcategorydtype を連続値として検出するようになった。文字列 カテゴリは従来どおりカテゴリ変数のまま。
CI¶
actions/upload-pages-artifactを v3→v5、actions/deploy-pagesを v4→v5 に 更新 (Dependabot #136 / #137 を develop へ統合)。
[0.12.0] — 2026-05-30¶
このリリースは H-0015 Phase M に対応し、v0.12.0 の LizyStudio 統合 イネーブルメントと、誤差分析 arc の積み残しを解消する。BLUEPRINT.md §5.7 / §5.8、 HISTORY.md H-0015、Issue #21 を参照。
Added¶
- 回帰スライス探索:
pycatdap.error.discover_error_slicesが回帰タスクに対応 (設計 D1)。|y_true - y_pred|をabs_residual_poolで AIC binning し、 最大平均 |residual| のビンを binaryhigh_residual誤差カテゴリとして 既存の 2 カテゴリ機構(support 枝刈り・measures・ΔAIC scoring)を共有再利用する。 新パラメータn_bins(回帰のみ)。従来のNotImplementedErrorを解消。 - 回帰 / 多クラス calibration reliability plot:
pycatdap.error.regression_calibration_curve(pred_mean × actual_mean、 軸は[0,1]非クランプ)/pycatdap.error.multiclass_calibration_curve(one-vs-rest をクラスごとに[0,1]正方形へオーバーレイ)。matplotlib / plotly 両 backend。既存の二値calibration_curveは無変更。 - 多クラス confusion ラベル:
pycatdap.error.multiclass_confusion_label— クラスごとの one-vs-rest TP/FP/FN/TN をMapping[class, pd.Series]で返す (二値confusion_labelコアを再利用、二値 API は無変更)。 .to_plotly_json()契約テスト: 全結果型の FLAT / SECTIONED 形状・安定キー・ JSON 安全性(allow_nan=False)・plotly.graph_objects.Figure(spec)互換を 検証する契約スイート(tests/contract/)。契約は BLUEPRINT §5.7.1 に明文化。
Fixed¶
DescribeResult.to_plotly_json()が NaN セル(カテゴリ列の mean/std)を含みjson.dumps(allow_nan=False)を壊していたのを修正。非有限値をNoneに置換する 共有ヘルパpycatdap._jsonsafe.scalar_to_jsonを抽出(profile.pyも再利用)。
[0.11.0] — 2026-05-29¶
このリリースは H-0014 Phase L に対応し、ML 誤差分析 arc を完成させる。
多変数サブグループの自動発見(discover_error_slices)・コホート比較
(compare_cohorts)・ドリフト検出(detect_drift)を追加し、さらに
Phase K で先送りした 回帰 / multi-class calibration を同梱する。
BLUEPRINT.md §5.8 / Issue #20 を参照。
主要な追加:
- pycatdap.error.discover_error_slices — 予測誤差が集中する多変数コホートを
AIC で自動発見。support(Apriori, anti-monotone)ベースの健全な枝刈り
(ΔAIC は健全な上界を持たないため不採用 — HISTORY H-0014 §C)。pluggable
measure("aic"/"cramers_v"/"mutual_info"/callable, FR-9)。
- pycatdap.error.compare_cohorts / detect_drift — コホート間の分布差・関係性
シフトを ΔAIC で定量化。Sweetviz 風 to_html レポート。
- pycatdap.error.regression_calibration_table / regression_calibration_error
— 回帰の predicted-vs-actual 分位 calibration。
- pycatdap.error.multiclass_calibration_table /
multiclass_expected_calibration_error — one-vs-rest の多クラス calibration。
Added — Phase L slice discovery & drift (pycatdap.error)¶
discover_error_slices(df, y_true, y_pred, *, max_vars=3, measure="aic", top_k=10, min_support=30, columns=None) -> SliceDiscoveryResult— 多変数サブグループ発見(分類のみ)。連続列は誤差ラベルに対して AIC binning。SliceDiscoveryResultはto_divexplorer_format()/to_dict()を提供。ErrorSlice/SliceDiscoveryResult— 多変数スライスの不変コンテナ (単変数Sliceとは別型、後方互換)。compare_cohorts(df_a, df_b, *, response=None) -> CohortComparison—summary(特徴別 ΔAIC + 最大分布差)・distributions・任意のresponse_delta。to_html(path=)/to_dict()。detect_drift(df_train, df_prod, *, y_true=None, y_pred=None) -> DriftReport— 特徴を |ΔAIC| 降順でランク。y_true/y_pred指定時は prod 誤差率を併記。
Added — calibration follow-up (pycatdap.error)¶
regression_calibration_table(y_true, y_pred, *, n_quantiles=10)/regression_calibration_error(...)— 回帰 calibration(純 numpy)。multiclass_calibration_table(y_true, y_proba, *, classes=None, strategy="aic", n_bins=10)/multiclass_expected_calibration_error(...)— one-vs-rest。既存の二値 calibration コアを再利用(二値パスは無変更)。
Changed¶
error/_backend.pyを新設し、confusion.py/residual.py/calibration.pyに重複していた plot backend dispatch を集約(挙動不変)。
Docs¶
- Notebook 14(Phase L)を追加し、mkdocs nav に登録。
[0.10.0] — 2026-05-29¶
このリリースは H-0013 Phase K に対応し、ML 誤差分析 arc に
キャリブレーション診断(二値分類)を追加する。pycatdap 固有の
AIC 最適 binning を確率軸に適用し、reliability diagram・Brier
score・ECE/MCE を提供する。error_analysis() に y_proba= を渡せば
ErrorAnalysisResult.calibration_curve() で 1 メソッド可視化できる。
BLUEPRINT.md §5.8 / Issue #19 を参照。
主要な追加:
- pycatdap.error.calibration_curve / calibration_table — reliability
diagram(Wilson 95% CI)と背後の per-bin テーブル。
- pycatdap.error.brier_score / expected_calibration_error /
maximum_calibration_error — スカラーメトリクス。
- ErrorAnalysisResult.y_proba フィールド + calibration_curve()
delegation メソッド。error_analysis(..., y_proba=) で populate。
Added — Phase K calibration (pycatdap.error)¶
calibration_curve(y_true, y_proba, *, strategy="aic"|"equal_width"|"quantile", n_bins=10, backend="matplotlib"|"plotly", **kwargs) -> Axes | Figure— reliability diagram。y = x完全校正線 + Wilson 95% 二項信頼区間。 matplotlib はax=受け入れAxes、plotly はFigureを返す。strategy="aic"(既定)は確率軸を_pooling.optimal_binningで AIC 最適 binning(初期グリッドは有界化、連続確率でもビン爆発しない)。calibration_table(y_true, y_proba, *, strategy="aic", n_bins=10) -> pd.DataFrame—bin_low/bin_high/n/prob_pred/prob_true/ci_low/ci_high。占有ビンのみ。 メトリクスと diagram の single source of truth。brier_score(y_true, y_proba) -> float—mean((y_proba - y_true)**2)。 sklearnbrier_score_loss(二値)と一致。expected_calibration_error(...) / maximum_calibration_error(...) -> float— ビン重み付き平均ギャップ / 最悪ビンギャップ。空ビンは除外。ErrorAnalysisResult.y_proba(既定None、__post_init__freeze)+ErrorAnalysisResult.calibration_curve(*, strategy, n_bins, backend, **kwargs)delegation。error_analysis(..., y_proba=)で保持。
Notes¶
- Wilson 信頼区間は pure-numpy(scipy 非依存)。
- スコープは二値分類のみ。回帰 calibration(predicted-vs-actual quantiles)と multi-class(one-vs-rest)は v0.11.0 へ defer。
- 破壊的変更なし。
y_proba追加は既存コンストラクタ・error_analysis()呼び出しに 無影響(to_dict()/to_plotly_json()スキーマ不変)。
[0.9.0] — 2026-05-29¶
このリリースは H-0012 Phase I+J に対応し、ML 誤差分析 arc の
可視化レイヤー(classification confusion + regression residual)
と、ErrorAnalysisResult への delegation メソッドを追加する。
v0.8.0 で出荷した error_analysis() の結果を、直接 1 メソッド呼び出し
で可視化できるようになる。BLUEPRINT.md §5.8 / Issue #18 を参照。
主要な追加:
- pycatdap.error.plot_confusion / plot_confusion_by_slice / confusion_aic
— Phase I 分類エラー可視化 + ΔAIC スコア。
- pycatdap.error.residual_plot / residual_by_category / residual_pool_plot
— Phase J 回帰残差可視化(scatter / box / AIC pooling histogram)。
- ErrorAnalysisResult.y_true / .y_pred — 生ラベルを result に保持
(H-0009 immutable pattern で __post_init__ 内 freeze)。
- ErrorAnalysisResult.plot_confusion() / .residual_plot() — 直接呼び
delegation メソッド。binary + multi-class + regression dispatch。
Added — Phase I classification visualisation (pycatdap.error)¶
plot_confusion(y_true, y_pred, *, labels=None, normalize=None, backend="matplotlib"|"plotly", **kwargs)— N×N confusion matrix heatmap、多クラス対応、4 normalize モード("true"/"pred"/"all"/None) サポート。matplotlib backend はax=受け入れ、Axesを返す。plotly backend はFigureを返す。plot_confusion_by_slice(df, y_true, y_pred, var, *, labels=None, n_cols=3, normalize="true", backend=..., **kwargs)—varカテゴリ別 small-multiples confusion グリッド。matplotlib backend はFigureを 返す(H-0012 §F-bis 例外、multi-panel のためAxes規約から逸脱)。confusion_aic(y_true, y_pred) -> float— 予測の情報量を ΔAIC で 定量化。pycatdap._aic.compute_delta_aicの薄いラッパー。負ほど informative(target_analysis/catdap1の既存規約に従う)。 Issue #18 本文は「positive when informative」だが、プロジェクト規約 優先のため反転(H-0012 §A5 で理由明記)。
Added — Phase J regression residual visualisation (pycatdap.error)¶
residual_plot(y_true, y_pred, *, kind="scatter_pred_resid"| "scatter_true_pred"|"histogram", color_by=None, backend=..., **kwargs)— 3 種類の診断プロット。color_by=で散布図に第 3 変数の色分け追加。residual_by_category(df, y_true, y_pred, var, *, bins=None, backend=..., **kwargs)—var別の残差 box plot。連続 var はbins=Noneで_pooling.optimal_binning(AIC ベース、残差符号を proxy response として使う)、bins=intで等幅 binning。Categorical dtype は declared order を honor。residual_pool_plot(y_true, y_pred, *, n_bins=4, backend=..., **kwargs)— |residual| ヒストグラム +residual_label(method="aic_pool")由来の 境界線オーバーレイ。AIC マージ後の bin 数はn_bins=より少ない場合あり。
Added — ErrorAnalysisResult delegation (pycatdap.error._result)¶
- 新規フィールド
y_true: NDArray | None = None/y_pred: NDArray | None = None— 生ラベルを result に保持。defaultNoneのため既存の直接構築は 影響なし(cross-check Claim 3 mitigation)。 __post_init__でNoneガード付きの numpy buffer freeze (writeable = False)。error_analysis()ラッパーは.copy()で defensive copy してから渡すため、呼び出し側元配列の freeze は防ぐ。ErrorAnalysisResult.plot_confusion(*, backend="matplotlib"|"plotly", **kwargs)— 内部でpycatdap.error.plot_confusion(self.y_true, self.y_pred, **kwargs)を呼ぶ delegation。binary AND multi-class 両方で動作(H-0012 §F-ter — Phase H wrapper が multi-class でerror_labelに fallback しても、y_true/y_predは保持されているので N×N ヒートマップは描画可能)。regression / 不在ラベルでValueError。ErrorAnalysisResult.residual_plot(*, backend=..., **kwargs)— 同様の delegation、regression 専用、classification / 不在ラベルでValueError。
Changed¶
- 既存
target_analysis/error_analysis/confusion_label等の API には変更なし。Phase I+J は純粋な追加。
Fixed — Issues closed¶
- Closes #18 (Phase I+J Classification & regression error visualization)
Breaking changes¶
- なし。既存 v0.8.0 API は全て後方互換。
ErrorAnalysisResultの コンストラクタ署名変更は defaultNoneフィールド追加のため非破壊。
[0.8.0] — 2026-05-29¶
このリリースは H-0011 Phase H に対応し、ML 誤差分析 arc の
ワンコール入口となる error_analysis() と、Phase H デモ用に
D4 fetch データセット(scikit-learn 経由)を同梱する。
BLUEPRINT.md §5.8 / Issue #17 / Issue #24 を参照。
主要な追加:
- pycatdap.error_analysis(df, y_true, y_pred) — task auto-detect +
Phase G ラベリング + target_analysis の合成によるワンコール ML
誤差分析。ErrorAnalysisResult を返す。
- pycatdap.ErrorAnalysisResult / pycatdap.Slice — v0.6.1 H-0009
immutable pattern(tuple / MappingProxyType / __post_init__
numpy freeze)を最初から適用した frozen dataclass。
- pycatdap.datasets.fetch_california_housing / fetch_adult_income /
fetch_compas — D4 ベンチマークデータセット。新規 pycatdap[data]
extras(scikit-learn>=1.3)。
Added — Phase H one-call wrapper (pycatdap.error_analysis)¶
error_analysis(df, y_true, y_pred, *, task="auto", top_k=5, positive=None, residual_method="aic_pool", n_bins=4, bins=None, criterion="bic")— Phase G のerror_label/confusion_label/residual_labelとtarget_analysisを合成し、feature_rankingtop_slices+ (binary 時)confusionを 1 つの結果に bundle。y_true/y_predは列名(str)/pd.Series/np.ndarrayの 3 形式を受け入れ。- Task dispatch:
autoは_detect_task経由、classification + binary →confusion_label、classification + 3+ unique →error_label(multiclass guard、H-0010 §C のNotImplementedErrorを回避)、 regression →residual_label。 - Slice extraction:
top_k変数のみ走査、|pearson_residual| >= 2.0のセルをSliceとして surfacing、|residual|降順で3 * top_kまでキャップ。多変数 subgroup discovery は Phase L(v0.11.0)で対応。 - 実装 safeguards(cross-check 2026-05-28 で抽出):
- F-1:
__pycatdap_*_label__列が既存する場合に明示ValueError - F-2: 完璧な分類器(
pd.crosstabが FP/FN 行を drop する)で KeyError しないようconfusionを canonical TP/FP/FN/TN 順に reindex - F-3:
equal_poolingboundaries が ascending sort であること を確認、residual-label slice 抽出でbin_0= under、最大番号 bin = over の前提を保証
Added — ErrorAnalysisResult / Slice データクラス¶
ErrorAnalysisResultフィールド:task/label_kind/response_name/feature_ranking(numpy buffer frozen)/top_summaries(MappingProxyType)/top_slices(tuple[Slice, ...])/confusion(pd.DataFrame | None、frozen) /residual_pooling(MappingProxyType | None、dict入力は__post_init__で defensive copy)/n_rows/n_correct/n_incorrect/mae/rmse。Sliceフィールド:variable/category/error_category/n_in_slice/n_error_in_slice/error_rate/pearson_residual/delta_aic。- 5-method serialisation contract:
show()— Jupyter / stdout 両対応サマリto_dict()— JSON-safe Python dictto_html(path=None)— self-contained jinja2 + Plotly inline HTML(atomic write、pycatdap[plotly]未導入時は明示ImportError)to_plotly_json()—feature_ranking/confusion/ 各top_summariesを section dict として返す(DP-4、LizyStudio 直接消費可)to_divexplorer_format()— DivExplorer subgroup API 互換 flat DataFrame(Phase L で完全統合、Phase H はフォーマット互換のみ)
Added — D4 fetch demo datasets (pycatdap.datasets)¶
fetch_california_housing()— sklearn 同梱の California Housing (20,640 × 9)。回帰タスク、MedHouseValがターゲット。fetch_adult_income()— OpenML idadultv2(~48,842 × 15)。 binary classification、classがターゲット(<=50K/>50K)。 Fairness 解析の文脈で広く利用。fetch_compas()— OpenML idcompas-two-yearsv4(~5,278 × 14)。 ProPublica COMPAS 二年再犯予測、fairness-critical な demo データ。 docstring に ProPublica 経由のバイアス出典 disclaimer 明記。- 共通: scikit-learn 未導入時は明示
ImportError(pycatdap[data]extras を案内)。HTTP/retry/checksum/cache は sklearn に委譲 (~/scikit_learn_data/、SCIKIT_LEARN_DATAenv で上書き可)。
Added — Dependencies / extras¶
- 新規
pycatdap[data]extras:scikit-learn>=1.3。 pycatdap[all]extras にscikit-learn>=1.3を統合。[tool.mypy.overrides]にsklearn.*を追加(stubs 未提供)。
Added — Documentation¶
- Tutorial Notebook 11 (
docs/tutorials/11-phase-h-error-analysis.ipynb) — binary classification / multiclass / regression の 3 経路 + 5-method serialisation + F-1 / F-2 / F-3 safeguards デモ。 - BLUEPRINT.md §5.8 を「Phase H 実装済 v0.8.0」に更新、データクラス 契約を実装と一致させる(immutable パターンを正式記載)。
- README.md quickstart に
error_analysis()セクション追加、Phase G セクションも v0.7.0 → v0.8.0 のブリッジ説明を加筆。
Fixed — Issues closed¶
- Closes #17 (Phase H
error_analysis()one-call wrapper) - Closes #24 (Data D4: Adult Income / COMPAS / California Housing)
Breaking changes¶
- なし。既存 v0.7.0 API は全て後方互換。
[0.7.0] — 2026-05-28¶
このリリースは H-0010 Phase G に対応し、ML 誤差分析 arc の基盤となる 誤差ラベリングユーティリティ と、Phase G チュートリアル用に D3 demo データセット を同梱する。BLUEPRINT.md §3.1 / §5.8 を参照。
主要な追加:
- pycatdap.error.error_label / confusion_label / residual_label / abs_residual_pool
— 予測結果を categorical Series にラベル付け
- pycatdap.error._detect_task — task auto-detection ヒューリスティック
- pycatdap.datasets.load_german_credit / load_heart_disease / load_penguins
— D3 demo データセット(UCI / Palmer Penguins)
Added — Phase G error labeling (pycatdap.error)¶
error_label(y_true, y_pred)— 任意 task で予測の正誤をpd.Series("correct" | "incorrect")で返す。confusion_label(y_true, y_pred, *, positive=None)— 二値分類で TP/FP/FN/TN をpd.Seriesで返す。positive=Noneの時は 2 ユニーク値の 片方(大きい方)を自動選択。multiclass はNotImplementedError(H-0010 §C により one-vs-rest は v0.8.0+ 後続)。residual_label(y_true, y_pred, *, method="aic_pool", n_bins=4)— 回帰残差を 3 つの method(aic_pool/quantile/equal_width)で ビン化。aic_poolはpycatdap._pooling.equal_poolingを再利用。abs_residual_pool(y_true, y_pred, *, n_bins=4)—|y_true - y_pred|を AIC pooling で binned categorical に。_detect_task(y_true, y_pred)— 文字列/object → classification、 両方 int で <= 20 ユニーク → classification、float in [0,1] vs binary y_true → classification、それ以外 → regression。
Phase G は 意図的に新規 dataclass を導入していない。H-0009 で対処した
shallow-freeze pattern の再発を防ぐため、すべて pd.Series で返す。
ErrorAnalysisResult は Phase H(v0.8.0)で v0.6.1 immutable pattern を
最初から適用して導入する。
Added — D3 demo datasets (pycatdap.datasets)¶
load_german_credit()— UCI Statlog German Credit(1000 × 21)。 Binary classification benchmark。classラベルは"good"/"bad"、 700/300 split。Public domain via OpenML idcredit-gv1。load_heart_disease()— UCI Cleveland Heart Disease processed subset(303 × 14)。Binary classification、targetラベルは 0/1。 全列 numeric。CC BY 4.0 via OpenML idheart-diseasev1。load_penguins()— Palmer Penguins(344 × 7)。3 クラス分類species ∈ {Adelie, Chinstrap, Gentoo}。CC0 1.0 via OpenML idpenguinsv1。
データセット issue は 独立リリースとして扱わず、それを使う Phase に同梱 する方針(2026-05-28 architect レビュー、PLAN.md §3.3 で文書化)。D3 は v0.5.0 → v0.6.0 と 2 回スリップしたが、Phase G が demo データを必要とする ため自然な fold-in タイミングとして v0.7.0 にまとめた。
Added — Tutorial¶
docs/tutorials/10-phase-g-error-labeling.ipynb— German Credit と 合成回帰データで Phase G API を体系的にデモ。Phase H への接続を解説。
Changed¶
- BLUEPRINT.md §3.1 の
error/ツリーを更新(_labels.py実装済を反映)。 - BLUEPRINT.md §5.8 の Phase G セクションを「v0.7.0 で実装済」に格上げ。
References¶
- HISTORY.md H-0010 (Phase G + D3 dataset folding decision)
- Issue #16 (Phase G)、Issue #23 (D3 datasets)
[0.6.1] — 2026-05-28¶
Changed — API hardening (breaking for callers that mutated result objects)¶
H-0009: 4 @dataclass(frozen=True) types shipped in v0.6.0 had mutable
internal fields (list / dict / pd.DataFrame) despite frozen=True.
This contradicted the "NEVER mutate" rule and allowed silent corruption
of result objects. Fixed in v0.6.1 before Phase G (v0.7.0) inherits the
same shallow-freeze pattern:
SuiteResult.checksis nowtuple[CheckResult, ...]instead oflist[CheckResult]. Calllist(result.checks)to get a mutable copy.CheckResult.affected_columnsis nowtuple[str, ...]instead oflist[str]. Calllist(...)to get a mutable copy.TargetAnalysisResult.top_summariesis now a read-onlyMapping[str, ...](types.MappingProxyType). Reads, iteration, and.items()work as before;__setitem__/__delitem__raiseTypeError. Calldict(...)to get a mutable copy.TargetAnalysisResult.rankingis documented read-only and the underlying numpy buffer is frozen via__post_init__setting.flags.writeable = False. Element assignment (df.values[i] = x) raises; DataFrame-level operations (drop,assign(inplace=False)) still allocate new buffers and remain available. Call.copy()before mutating in place.
Pre-v0.6.0 result objects with the same pattern
(QualityReport.warnings, ProfileResult.variables,
EDADescribe.summary, etc.) are deferred to a follow-up issue for
staged migration before v1.0 — fixing them all together would inflate
this patch beyond a focused release.
CI / Release infrastructure¶
auto-release.ymlnow dispatchesrelease.ymlautomatically viaworkflow_dispatchafter creating the tag and GitHub Release. Previously the defaultGITHUB_TOKEN-pushed tag did not firerelease.yml'spush: tags: [v*]trigger (recursive-trigger suppression), forcing a manualgh workflow run "Release to PyPI"step on every release from v0.3.0 through v0.6.0. The new step usesworkflow_dispatch, which is exempt from the recursive-trigger restriction and works withGITHUB_TOKEN(no PAT required). Requirespermissions: actions: writeonauto-release.yml.
[0.6.0] — 2026-05-28¶
このリリースは H-0008 Phase D に対応し、target 駆動分析と CI 統合可能な
品質スイート を追加する。v0.5.0 の flagship profile() を補完する 4 つの
新規公開 API(quality_report / target_analysis / pycatdap.measures /
pycatdap.suite)と、association_matrix(measure=...) の non-AIC 拡張を
含む。詳細は HISTORY.md H-0008 および以下の節を参照。
主要な追加:
- pycatdap.quality_report(df).passed — CI gate 用の高速データ品質スキャン
- pycatdap.target_analysis(df, response) — ΔAIC ランキング + 上位 K の TargetSummary
- pycatdap.measures.{aic, cramers_v, mutual_info, register} — pluggable interestingness 指標
- pycatdap.association_matrix(df, measure="cramers_v") — 非 AIC 関連度行列
- pycatdap.suite.AICIndependenceSuite(df, response).run().passed — deepchecks 風 CI スイート
Added¶
- Tutorial Notebook 09 —
docs/tutorials/09-phase-d-target-analysis-and-suite.ipynbwalks through every Phase D API on the Titanic dataset:quality_report→target_analysis→pycatdap.measures.*→pycatdap.suite.AICIndependenceSuitewith theassert suite_result.passed, suite_result.summary()CI idiom (H-0008 PR-D6). pycatdap.suitesubpackage — deepchecks-style CI-integrable suite per Issue #15 (H-0008 PR-D5). Public API:pycatdap.suite.AICIndependenceSuite(df, response=...).run() -> SuiteResult— default bundle of the 4 standard checks- Individual checks:
ConstantColumnCheck,HighCardinalityCheck,IndependenceCheck,PoolingSuggestionCheck(all@dataclass(frozen=True)so thresholds are immutable; noeval()/ string DSL anywhere — safe on untrusted DataFrames) SuiteResultwith.passedboolean forassert suite_result.passed,.failures(all non-passing checks including"info"-severity),.summary(),.show(),.to_html(path),.to_dict(),.to_plotly_json()association_matrix(df, measure=...)extension — dispatch on any registered :mod:pycatdap.measuresmeasure.measure="aic"(default) keeps the existing :func:target_summary-based path;"cramers_v"/"mutual_info"/ custom measures use a generic crosstab path with uniformpd.qcutbinning of continuous columns (H-0008 PR-D5).pycatdap.measuressubpackage with a pluggable interestingness- measure registry (BLUEPRINT §5.11, H-0008 PR-D4). Each measure has the uniform signatureCallable[[npt.NDArray[np.float64]], float]. Standard measures shipped:pycatdap.measures.aic(cross_freq)— ΔAIC (negative = informative)pycatdap.measures.cramers_v(cross_freq)— Cramér's V (0..1, pure-numpy, no scipy dependency)pycatdap.measures.mutual_info(cross_freq)— mutual information in nats (pure-numpy)pycatdap.measures.register(name, fn)/get(name)/list_measures()for custom measures (pysubgroup / DivExplorer interop, Issues #31 / #32)pycatdap.target_analysis(df, response)— target-driven ΔAIC ranking of every non-response column. Keeps the fullTargetSummary/RegressionTargetSummaryfor the top-K most informative columns (top_k=5by default). Exposes.show(),.to_html(path),.to_dict(), and.to_plotly_json()matching theProfileResult4-method contract; HTML report embeds each top-K cross-tab inline via Plotly (H-0008 PR-D3).pycatdap.TargetAnalysisResultre-export.pycatdap.quality_report(df)— focused data-quality scan returning aQualityReportdataclass. Shares the warning logic ofprofile()via the newsrc/pycatdap/_quality.pyhelper but skipsassociation_matrix/catdap2, so it stays fast on wide CI frames. Exposes.passed(boolean forassert qr.passed),.by_severity(),.by_kind(),.show(),.to_html(path),.to_dict(), and.to_plotly_json()(H-0008 PR-D2).pycatdap.QualityReportre-export.
Changed¶
- Internal refactor:
_scan_qualitylifted frompycatdap.profileintopycatdap._qualitysoquality_report/profile/pycatdap.suiteshare one helper. Public surface unchanged (H-0008 PR-D1). BLUEPRINT.md§3.1 / §5.10 / §5.11 updated to reflect the shipped Phase D module structure and APIs (H-0008 PR-D6).README.mdQuickstart now shows the target-analysis / quality report / suite / measures workflow (H-0008 PR-D6).SuiteResult.warnings→SuiteResult.failures(rename, H-0008 PR-D6 quality pass). The previous name was misleading because the property returned ALL non-passing checks regardless of severity, including"info"-severity findings that do not flip.passedtoFalse. The list semantics are unchanged. Pre-release rename; no users yet depend on.warningssince v0.6.0 is not yet published.
Fixed¶
quality_report(df)andprofile(df)no longer raiseZeroDivisionErroron a 0-row DataFrame —_scan_qualityskips columns withn_obs == 0and returns an empty warnings list (H-0008 PR-D6 quality pass; caught by python-reviewer).pycatdap.measures.cramers_vno longer emitsRuntimeWarning: invalid value encountered in divideon tables with an all-zero marginal row or column — switched tonp.divide(..., where=...)for side-effect-free masked division. The returned numeric value is unchanged (H-0008 PR-D6 quality pass).
[0.5.0] — 2026-05-28¶
このリリースは EDA レイヤの フラッグシップ API pycatdap.profile() を導入:
H-0007(Phase C)に対応し、describe + association_matrix + target_summary +
catdap2 を 1 コールに統合、jinja2 + インライン Plotly による
self-contained HTML レポートを生成する。ydata-profiling / skrub.TableReport
の pycatdap 版に相当。詳細は HISTORY.md H-0007 および以下の節を参照。
Added¶
- ワンコール EDA レポート API(H-0007 Phase C、Issue #14):
pycatdap.profile(df, *, response=None, bins=None, criterion="bic", top_k_subsets=5, quality_thresholds=None) -> ProfileResult—describe+association_matrix+target_summary+catdap2を 1 コールに統合ProfileResultfrozen dataclass —overview/variables/association/top_subsets/quality_warnings/response/n_rows/n_colsを保持。.show / .to_dict / .to_plotly_json / .to_htmlを提供VariableCardfrozen dataclass — 列ごとの type / cardinality / missing / top / continuous 統計量 / ΔAIC vs response / AIC binning 境界QualityWarningfrozen dataclass — 4 種類の警告(high_cardinality/constant/id_candidate/high_missing、quality_thresholds=で上書き可)ProfileResult.to_html(path=None)— jinja2 テンプレート(src/pycatdap/templates/profile.html.j2) で単一の self-contained HTML を生成。Plotly figure はinclude_plotlyjs="inline"で同梱(オフライン閲覧可)。path指定時は_io.atomic_write_text経由で原子的書き込み。jinja2が無い場合はpycatdap[plotly]extras を促すImportError- チュートリアル
docs/tutorials/08-profile-titanic.ipynb— Titanic データセットでprofile()の全機能(quality thresholds の上書き、to_html/to_dict/to_plotly_json各シリアライズ)をデモ BLUEPRINT.md§3.1 / §5.9 — H-0007 で追加したモジュール(profile.py/templates/)とProfileResult/VariableCard/QualityWarningの確定 API を反映README.mdQuickstart — v0.5+ One-call EDA report 節をpycatdap.profile()の 動く例に置き換え(v0.3+ プレースホルダから昇格)
Fixed¶
pycatdap.profile(df, quality_thresholds={})が空 dict をNone同等に黙って 落としていた falsy trap を修正(PR #75)。空 dict は「上書き無し」として明示的に 扱う(is not Noneチェック、feedback_python_falsy_or_default_trap)ProfileResult.to_dict()が+/-infをそのまま emit していたため、json.dumpsの strict モードや JavaScript のJSON.parseで reject される RFC 8259 違反だった。_scalar_to_jsonヘルパーでNaNと統一してNoneに変換(PR #75)
Changed¶
ProfileResult.show()の Jupyter 経路をIPython.display.HTMLラッパーを使わない 形に変更し、DescribeResult/TargetSummaryの慣習と揃えた(local mypy noise が 5 errors → 3 errors に減少、機能変更なし、PR #75)ProfileResult.to_html(path)が_io.atomic_write_text(..., encoding="utf-8")を 明示指定(PR #75、コードベース既存 3 call site と整合)
[0.4.0] — 2026-05-27¶
このリリースは EDA レイヤを ペア・全列ペア まで広げる minor 拡張:
H-0004(target_summary / plot_target)+ H-0005(連続目的変数 Gaussian 回帰 AIC)
+ H-0006(Phase B 二変量 API: plot_pair / aic_heatmap / association_matrix /
association_plot)の 3 つの HISTORY エントリと、それを支える 5 本のチュートリアル
ノートブック(03 / 04 / 05 / 06 / 07)を含む。詳細は HISTORY.md および以下の各節を参照。
Fixed¶
DescribeResult.to_html(path)/TargetSummary.to_html(path)を atomic write 化(pycatdap._io.atomic_write_text経由)。同時に読み取るプロセス(mkdocs serve の watcher 等)が空ファイルや書き込み途中の状態を観測するリスクを排除
Added¶
- Phase B 二変量 API(H-0006、Issue #13)— 段階的に追加:
pycatdap.plot_pair(df, x, y, *, kind="auto", bins=None, backend=...)— 対称ラッパー。dtype に基づき (target, explanatory) を決定しplot_targetに委譲 (連続 × カテゴリ → カテゴリが target、連続 × 連続 →yが target、両カテゴリ →yが target)pycatdap.association_matrix(df, *, measure="aic", bins=None, criterion="bic")— 全列ペアの ΔAIC 行列を返す(非対称、対角 NaN)。target_summaryを全(i, j)ペアで 呼び出し、M.loc[i, j]にtarget=i, explanatory=jのdelta_aicを格納。measure="cramers_v"/"mutual_info"は H-0007 で別途追加予定pycatdap.aic_heatmap(result, *, threshold=0.0, backend=...)—Catdap1Resultまたはpd.DataFrameを受け取り、diverging colormap (RdYlGn_r、中心 0)で ΔAIC ヒートマップを描画。threshold未満のセルに*注釈pycatdap.association_plot(table, *, threshold=2.0, backend=...)— vcdassoc(shade=TRUE)風 Pearson 標準化残差ヒートマップ。TargetSummaryまたはpd.DataFrame(クロス頻度表)を受け取り、 diverging colormap(RdBu_r、中心 0)で描画。RegressionTargetSummaryはTypeError(plot_target(kind="scatter")を推奨)- チュートリアル
docs/tutorials/07-bivariate-phase-b.ipynb— Phase B の 4 つの API を Titanic データセットで通しデモ - 目的変数 × 説明変数ペア分析 API(H-0004):
pycatdap.target_summary(df, target, explanatory, *, bins=None) -> TargetSummary— counts / row_prop / col_prop / expected / pearson_residuals / delta_aic を保持し、.show / .to_html / .to_dict / .to_plotly_jsonを提供pycatdap.plot_target(df, target, explanatory, *, kind="auto", bins=None, backend=...)— dtype 組合せで stacked / mosaic / violin / box / hist を自動選択(matplotlib/plotly 両対応)- 連続説明変数は
bins=Noneで AIC 最適 binning、bins=intで等幅、bins=listで明示境界 - 連続目的変数サポート — Gaussian 回帰 AIC 拡張(H-0005、Issue #56):
pycatdap.RegressionTargetSummary新規 dataclass — 連続 target に対する per-X-bin{count, target_mean, target_std}+delta_aic+r_squared+n_effective+intervals+criterion、.show / .to_html / .to_dict / .to_plotly_jsonを提供target_summaryにtarget_bins/criterionパラメータ追加。連続 target かつtarget_bins=NoneでRegressionTargetSummaryを返し、target_bins指定で既存TargetSummary(候補 © fallback)を返すcriterion="bic"(default、Yao 1988 推奨)/"aic"/"aicc"(Hurvich-Tsai 系)- 欠損値ハンドリング戦略 M2: Y のみ dropna; X 欠損は明示的
_missing_pseudo-bin に集約。同一 Y 上の異なる X 候補でAIC_nullが一致(R-1) plot_targetのkindに"scatter"/"bin_means"を追加、連続 target × 連続 X で散布図 + bin 平均線、連続 target × カテゴリ X で box / violin を自動選択- 参照実装:
nbx-liz/AdvancedCATDAPscoring.py:calc_score_reg_bincount_idxから移植 - 連続 target に対する従来の
ValueErrorは廃止 —RegressionTargetSummaryを返す挙動に変更 - チュートリアルノートブック 3 本を追加(Issue #27):
docs/tutorials/03-iris-pooling.ipynb— iris での AIC 最適 binningdocs/tutorials/04-hellogoodbye-multivariate.ipynb— 56 binary 変数でのnvar利用例docs/tutorials/05-real-world-eda.ipynb— seaborn Titanic(欠損あり)での実データ EDAdocs/tutorials/06-target-pair-titanic.ipynb—target_summary/plot_targetの全分岐デモ(cat × cat / multi-level / cat × continuous)、AIC 最適 binning と等幅 binning の比較、全 explanatory の ΔAIC ランキング、HTML / Plotly export。 末尾に連続 target サポートの研究 Issue #56 へのリンクpycatdap[tutorial]extras(seaborn)— Notebook 05 用- CI で nbmake によるノートブック実行検証(
notebooksジョブ) [dependency-groups].notebooks— Notebook 実行用開発依存(nbmake / seaborn / plotly / matplotlib / ipykernel)
Changed¶
docs/tutorials/02-eda-titanic.ipynb— 03/04/05 へのクロスリファレンスを追加、bundled clean 版と seaborn messy 版の関係を明示。さらにtarget_summaryを使った single-pair drill-down teaser 節を追加し、06 へリンクdocs/tutorials/05-real-world-eda.ipynb— クリーニング済み Titanic でtarget_summaryをsex/age(連続)に適用する節を追加、AIC 最適 binning の効果を確認docs/tutorials/06-target-pair-titanic.ipynb— 末尾の「Coming soon: continuous targets」プレースホルダ節を H-0005 の動作デモ(連続 target =fare、RegressionTargetSummary、plot_targetの box / scatter、criterion="aic" / "aicc" / "bic"比較、target_binsfallback の対比)へ置換。Summary 表に regression-mode の 3 行を追加docs/tutorials/01-basic-catdap.ipynb— 解説文を英訳。v0.2 由来の日本語ナレーションを CONTRIBUTING.md の English-only ポリシーに揃える(PR #52)BLUEPRINT.md§3.1 / §5.7 — H-0004 / H-0005 / H-0006 で追加したモジュール(_target_pair.py/_association.py)と公開 API(4 関数 + 2 ペア API)を反映
[0.3.0] — 2026-05-26¶
このリリースで pycatdap は「AIC ベース EDA + ML 誤差分析ライブラリ」として再定位された。詳細は HISTORY.md H-0001 / H-0002 / H-0003 を参照。
Added¶
公開 API¶
pycatdap.plot— 描画バックエンドの選択機能(matplotlib / plotly 両対応)pycatdap.plot.matplotlib.*,pycatdap.plot.plotly.*— バックエンド別実装- Plotly バックエンドの完全実装:
mosaic_plot,barplot_twoway,aic_comparison_plot - 結果オブジェクトの
.to_plotly_json()メソッド(Catdap1Result,Catdap2Result) pycatdap.describe(df) → DescribeResult— 単変量サマリ.show()/.to_html()/.to_dict()/.to_plotly_json()各メソッド- 列分類: continuous / categorical / boolean / datetime / other(pandas 2.x の StringDtype に対応)
pycatdap.plot_variable(df, col, kind="auto"|"hist"|"bar", backend=...)— 単変量プロットpycatdap.plot_missing(df, backend=...)— 欠損値パターンのバーチャート
サンプルデータセット¶
pycatdap.datasets.load_titanic()— Rdatasets::Titanic由来(2,201 × 4、全カテゴリカル)pycatdap.datasets.load_iris()— Fisher's iris(150 × 5、連続 4 列 + 種別)pycatdap.datasetsを__init__から直接アクセス可能に
任意依存¶
pycatdap[plotly]extras(plotly + jinja2)pycatdap[all]extras(plot + plotly 一括)
ドキュメント・計画¶
- 戦略ドキュメント
HISTORY.md— H-0001/H-0002/H-0003 accepted - 全体開発計画
PLAN.md— v0.2.x〜v1.0 のロードマップ BLUEPRINT.md§3.2 — 5 つの Mermaid アーキテクチャ図- ドキュメントサイト
mkdocs-material+ GitHub Pages - mkdocstrings による API リファレンス自動生成
- mkdocs-jupyter による notebook 埋め込み
- 新規チュートリアル
02-eda-titanic.ipynb— Phase A API の総覧 - README リフレッシュ(ポジショニング、比較表、quickstart、ロードマップ)
- CONTRIBUTING.md に R 参照 CSV 生成手順を追加
品質・インフラ¶
tests/test_against_r.py2層化: property-based + 厳密数値比較(CSV reference があれば atol=1e-4)- Makefile に
r-reference/test-slowターゲット追加 .github/workflows/docs.yml— PR ビルド検証 + main push で Pages 自動デプロイpyproject.tomlの dependency-group:docsを追加
Changed¶
pycatdap.plotting.*(v0.2 互換)はpycatdap.plot.matplotlib.*への透過的な re-export shim に変更(既存ユーザー影響なし)docs/tutorial.ipynbをdocs/tutorials/01-basic-catdap.ipynbに移動
Migration¶
破壊的変更なし。from pycatdap.plotting import mosaic_plot は v1.0 まで動作し続ける。
新規ユーザーは canonical な from pycatdap.plot import mosaic_plot(backend=... で切替)を推奨。
[0.2.0] — 2026-03-22¶
Added¶
- コアAIC計算 (
_aic.py):compute_aic_twoway,compute_base_aic,compute_delta_aic - 分割表構築 (
_contingency.py):build_crosstab,build_multidim_crosstab - CATDAP-01 (
catdap1.py): 全カテゴリカル変数ペアのΔAIC評価 - プーリング (
_pooling.py): 等間隔・不等間隔の連続変数カテゴリ化 - CATDAP-02 (
catdap2.py): 最適説明変数部分集合探索 - サンプルデータセット (
datasets.py): HealthData (52例), HelloGoodbye (13,954例) - 可視化 (
plotting.py):aic_comparison_plot,barplot_twoway,mosaic_plot - チュートリアルノートブック (
docs/tutorial.ipynb) — 10項目の正当性検証付き - R比較テスト (
tests/test_against_r.py) - Project scaffold with src layout
- CI/CD pipeline (GitHub Actions)
- PyPI trusted publishing via TestPyPI → PyPI