Skip to content

fix: issue #60 — W-Dist センチネル廃止し Gudhi の実 Wasserstein に統一 - #63

Merged
t-uda merged 1 commit into
uda-lab:mainfrom
koki3070:fix/issue60-wdist-real-wasserstein
Jun 21, 2026
Merged

fix: issue #60 — W-Dist センチネル廃止し Gudhi の実 Wasserstein に統一#63
t-uda merged 1 commit into
uda-lab:mainfrom
koki3070:fix/issue60-wdist-real-wasserstein

Conversation

@koki3070

Copy link
Copy Markdown
Contributor

Summary

Changes

  • tda_ml/persistence.py: 空点群時の早期 return 削除(Wasserstein / Bottleneck)
  • tda_ml/metrics.py: empty_pred_wdist 削除、常に compute_w_distance 経由
  • tests/test_persistence.py 新規、tests/test_metrics.py 更新

Test plan

  • uv run pytest → 46 passed
  • 学習経路(trainer / 位相損失)は未変更 — MCC/G-Mean の再学習は不要
  • (follow-up)REPRODUCIBILITY.md に評価 W-Dist 定義を追記
  • (follow-up)旧センチネルからの W-Dist 数値非互換の migration note / 再評価

Closes #60

Made with Cursor

空予測点群時の 999/99/9.99 早期 return を削除し、評価指標も同一経路で OT 距離を返す。

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

評価用 W-Dist のセンチネル値(999/99/9.99)を廃止し、空予測(predicted inliers が空)も含めて Gudhi による H₁ 1-Wasserstein(および Bottleneck)距離の定義へ統一するPRです。tda_ml 内の評価指標計算が「定義可能な OT 距離」として一貫するようになります。

Changes:

  • compute_w_distance / compute_bottleneck_distance の空点群時センチネル返却を削除し、Gudhi の距離計算に統一
  • compute_recall_specificity_gmean_mcc_wdist から empty_pred_wdist を削除し、常に compute_w_distance 経由で算出
  • 空予測ケースの挙動を固定するテストを追加/更新

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/test_persistence.py 空点群入力でも有限な Wasserstein/Bottleneck が返ること(センチネル非使用)をテスト追加
tests/test_metrics.py empty_pred_wdist を廃止し、空 inlier 予測時の W-Dist を compute_w_distance と一致させるようテスト更新
tda_ml/persistence.py Wasserstein/Bottleneck 距離の空点群センチネル処理を削除し、Gudhi 距離定義に統一
tda_ml/metrics.py W-Dist 計算を常に compute_w_distance に委譲し、センチネル引数を削除

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@t-uda t-uda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@t-uda
t-uda merged commit 4b4ac75 into uda-lab:main Jun 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

マジックナンバー(999/99/9.99等)の定数化と用途・設計意図の明文化

3 participants