`lowess` returns 0 for points of an exact fit after robustness iterations
维护者通常 1 天内回复
@aviralgarg05 已经在做这个了。
开始于 2026年11月17日。
评估
调研方向
从 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 分钟
- 30 天内合并 PR
- 45
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 天前认领,目前没有进行中的 PR。 未关闭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 天前认领,目前没有进行中的 PR。 未关闭bug
难度 2/5 1-3 小时 新手友好度 75/100
scverse/PyDESeq2#519 · 1 条评论 ·
维护者通常 1 天内回复
-
`prior_LFC_var` is squared in the Wald test's ridge可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 78/100
nael5x/creative-ai#130 ·
-
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 天内回复
-
bug user-report
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复