Feature request: semiparametric (monotone-spline) link for qualitative/ordinal data — learn the measurement-model shape instead of fixing probit/logit
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 15/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
Start from the existing fixed-link code behind qualitative_scale (probit/logit/hinge) and the SBML/PEtab observable measurement-model layer the issue names as the likely attachment point; #976 holds the MPRA setup. Reproduce the default probit path and its likelihood/profile-likelihood plumbing first, then add the I-spline link, ordered thresholds, and the qualitative_link/df/knot-placement config keys. Done means the identity-spline case reproduces probit exactly, the fitted monotone m stays differentiable under the existing gradient machinery, and a fixed-vs-flexible profile-likelihood comparison runs end to end.
索引モデルが issue の本文から書いたものです。
説明
Summary
For qualitative/ordinal data, PyBNF's likelihood models use a link of fixed shape: the probit (confidence/tolerance), the logit (logit scale), or the hinge. qualitative_scale = fit s lets a fit estimate the link's width, but not its shape.
This is a feature request for a semiparametric link: let the fit learn the shape of the map from a model prediction to category probabilities, using a monotone spline. In statistical terms, the current models are single-index models with a known link; this would allow an unknown link.
Motivation
1. Misspecification of the link biases biophysical parameters, silently.
Concrete case (MPRA-style data, one promoter variant per BNGL function, one BPSL constraint per sequenced cell; see #976 for the setup). Fitting a thermodynamic model to above/below-wild-type calls with the fixed probit gave an apparently well-determined RNAP concentration, with a likelihood-ratio statistic of 24.7 against the weak-binding limit. A synthetic-data check then showed that two plausible departures from the assumed link — noise whose width grows with the predicted value, and the stratified sorting design the real experiment actually used — each manufacture a larger signal (51–114) from data generated with no such parameter at all. The estimate was an artifact of the link, not evidence in the data.
A fit cannot currently distinguish "the data say this" from "my assumed link says this".
2. There is precedent, and theory.
MAVE-NN (Tareen et al., Genome Biology 23:98, 2022) fits the same class of models to the same class of data, and learns the measurement process p(y|φ) from the data: "a multilayer perceptron with one hidden layer (having tanh activations) and a softmax output layer", trained jointly with the genotype-phenotype map by maximizing the likelihood.
More generally this is the semiparametric single-index model with an unknown link (Ichimura; Härdle & Stoker; Horowitz), where the response depends on the covariates only through a scalar index. The relevant known result is that the index is then identified only up to location and scale — MAVE-NN calls these "diffeomorphic modes" and fixes them by convention. That identifiability cost is the honest price of the robustness, and it is the point of item 4 below.
Proposed feature
A monotone-spline link, not a neural network. The index here is scalar, so a 1-D monotone transformation is the natural object and is much better suited than an MLP: few parameters, monotone by construction, interpretable, and differentiable, so it works with the existing gradient and profile-likelihood machinery.
For a predicted value q (the constraint margin, as the probit/logit models already compute it), replace the fixed CDF with a cumulative-link model
P(category <= k | q) = Phi( t_k - m(q) ) k = 1 .. K-1
where m is a monotone spline (an I-spline basis with non-negative coefficients, or a monotone PCHIP through fitted knot heights) and t_k are ordered thresholds. With m the identity this reduces exactly to the present probit, so the existing behaviour is the default and a special case.
Sketch of the configuration surface, parallel to qualitative_scale:
qualitative_link = spline, df = 5 # or: probit (default), logit
qualitative_link_knots = quantile # knot placement over the observed range of q
As with qualitative_scale, one link would be tied across all qualitative constraints, which is the identifiable case.
What this buys, in four parts:
- Robustness. Biophysical parameters stop absorbing the link's misspecification.
- A measurement model worth reading. The fitted
mis itself informative about the assay (saturation, bin nonlinearity, drift). - Parity with MAVE-NN on the data type where that comparison will be made, within a general rule-based framework.
- A robustness diagnostic, which is the most valuable part. Fit twice, once with the fixed link and once with the flexible one, and compare. If the parameter estimates move materially, the assumed link was carrying the result. This pairs directly with
job_type = profile_likelihood, and in the case above it would have caught the artifact immediately.
Caveats, which belong in the documentation
- Identifiability is traded away deliberately. A flexible link absorbs exactly the signal that identifies parameters acting only through a reshaping of the index. Parameters estimable under a fixed link may become unidentifiable. That is a feature when the fixed link is wrong and a real loss when it is right, so both fits are worth reporting.
- It needs enough categories and enough data. With only two categories there is little shape to learn and much to lose; the feature is aimed at ordinal data with several categories, or several conditions.
- Monotonicity should be enforced, not hoped for, or the link and the model will trade places.
Related
- #976 (the setup these data come from), and the measurement-model layer already present for SBML/PEtab observables, which may be the natural place to attach this.
- 主要言語
- Python
- スター
- 25
- フォーク
- 25
- 平均マージ
- 4時間 5分
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
lanl/PyBNF のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug minor
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug minor
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug silent-incorrectness
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
メンテナーはふだん 6 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
gh-sync ship audits cards before writing station done, so every ship reports false STATUS findingsオープンharness
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mruangutai/harness#2455 ·
メンテナーはふだん 1 日以内に返信
-
stripthink leaves thinking text in place when the chat template opens the think tag in the prompt対応中かも @MaiAditya が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
xcorr sizes its bin array from the largest observed m/z, so one out-of-range peak kills the run対応中かも @BioGeek が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
instadeepai/winnow#312 ·