`lowess` returns 0 for points of an exact fit after robustness iterations
メンテナーはふだん 1 日以内に返信
@aviralgarg05 がすでに取り組んでいます。
2026年11月17日 から。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 74/100
調査の方向性
stats.py の 116-121 行目から始めます。ここではロバスト性の反復が、絶対残差の中央値がちょうど 0 であることが完全なフィットを意味するかどうかを判断します。そのしきい値が修正点です。再現スニペットを実行して、iter=1 は通る一方で iter=5 はポイント 44-49 で 0 を返すことを確認し、次に傾きと切片を変化させて許容範囲が広すぎないか確認します。ds.py:480 は独立フィルタリングにおける呼び出し元を示していますが、issue では padj の影響は未検証とされているので、lowess のテストを狙います。完了とは、両方の反復回数がラインから 1e-6 以内に収まり、既存の stats テストが通ることを意味します。
索引モデルが issue の本文から書いたものです。
説明
After a robustness iteration, stats.lowess weights points by their residual over six times the median absolute residual; on an exact fit the residuals are rounding noise, so some points get weight 0, and where a whole neighbourhood does, lstsq returns beta = 0 and the fitted value is 0, as at points 46 to 49 of the line y = 3 - 7.5x with frac=0.1, iter=5; a local linear regression of points on a line should return the line, as the same call does with iter=1. stats.py:116-121 treats only a median of exactly 0 as an exact fit; treating a median below a small multiple of the targets' scale as zero would fix it.
lowess smooths the rejection counts of independent filtering (ds.py:480), whose plateaus are locally exact fits; we have not looked for a dataset where this changes padj.
Source line numbers refer to commit 2ca3b74.
Reproduction
import numpy as np
from pydeseq2.stats import lowess
x = np.linspace(0.1, 0.95, 50)
y = 3 - 7.5 * x
for iterations in [1, 5]:
fit = lowess(x, y, frac=0.1, iter=iterations)
off = np.flatnonzero(np.abs(fit - y) > 1e-6)
print(f"iter={iterations}: points off the line {off.tolist()}")
if len(off):
print("fitted:", fit[off].round(4).tolist())
print("line:", y[off].round(4).tolist())
Expected: no points off the line for either number of iterations.
Actual, with PyDESeq2 0.6.0:
iter=1: points off the line []
iter=5: points off the line [44, 45, 46, 47, 48, 49]
fitted: [-3.373, -3.4016, 0.0, 0.0, 0.0, 0.0]
line: [-3.4745, -3.6046, -3.7347, -3.8648, -3.9949, -4.125]
Split out from #491.
- 主要言語
- Python
- スター
- 770
- フォーク
- 98
- 平均マージ
- 19時間 55分
- マージ済み PR(30日)
- 45
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
scverse/PyDESeq2 のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
`irls_solver` does not enforce `min_beta` when IRLS converges, and documents `max_beta`'s default as -30再び着手できるかも @aviralgarg05 が 15 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
scverse/PyDESeq2#521 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
`MAP_dispersions` of refitted genes keep the value from before outlier replacement再び着手できるかも @aviralgarg05 が 15 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
scverse/PyDESeq2#519 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
`prior_LFC_var` is squared in the Wald test's ridge再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
scverse/PyDESeq2 の issue をすべて見る
似ている issue
-
Make the "%" unit spacing the same in the web and in A10対応中かも @kragent66-glitch が今日担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
maiychrus25/OpenTea-DX-OS#226 · コメント 1 件 ·
-
ci severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TMHSDigital/Spackle#205 ·
メンテナーはふだん 1 日以内に返信
-
pkg:lgm type:chore upstream-gaussx
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
jejjohnson/pyrox#610 ·
メンテナーはふだん 1 日以内に返信
-
changelog investigate
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
ramnes/notion-sdk-py#523 ·
-
feature-request
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
open-telemetry/opentelemetry-python#5994 ·
メンテナーはふだん 2 日以内に返信