Skip to content

feat(mice): add binary logistic FCS kernel - #102

Open
alisadeghiaghili wants to merge 6 commits into
mainfrom
feat/mice-binary-logistic-fcs
Open

alisadeghiaghili wants to merge 6 commits into
mainfrom
feat/mice-binary-logistic-fcs

Conversation

@alisadeghiaghili

Copy link
Copy Markdown
Owner

Summary

  • Add a default MICE conditional kernel for categorical targets with exactly two observed levels: sklearn logistic regression plus chain-seeded Bernoulli draws.
  • Preserve binary pandas Categorical, nullable boolean, and nullable string target dtypes; preserve observed cells and caller inputs.
  • Route default binary targets through the manual FCS path even without typed-result/history options, while retaining existing numeric Bayesian-ridge and custom-estimator paths.
  • Publish per-target typed-plan metadata: binary_logistic_fcs; provenance distinguishes numeric, binary, and multiclass/ordinal contracts. Multiclass and ordered categorical targets with more than two observed levels remain explicitly limited ordinal-encoded Bayesian-ridge approximations.
  • Preserve where structural missingness, predictor-matrix selection, numeric bounds, and typed MI schema semantics.

TDD and verification

  • Red public contracts failed under the prior implementation because every categorical target was labeled and processed as ordinal-encoded Bayesian ridge.
  • New public tests cover string, nullable boolean, and ordered Categorical binary targets; support-only Bernoulli outputs; deterministic repeated seeded chains; dtype/observed-value/caller preservation; typed plan/provenance/warnings; where, predictor matrix, and numeric bounds interaction.
  • Relevant MICE/MI/oracle tests: 172 passed.
  • Ruff clean; mypy missingly/impute.py 0 errors; installed-module impute doctest 93 attempted/0 failed; diff-check and added-lines <=88 clean.

Statistical scope and risk

This is a bounded #71 capability, not a claim of full FCS validation, R mice parity, or #79 inference support. The frozen R mice oracle is numeric-only and is not used as categorical parity evidence. Logistic estimation falls back only on recoverable backend errors to an observed Bernoulli-rate draw with an actionable warning. Default binary completed values may differ from the prior ordinal-encoded Bayesian-ridge approximation; this is the intentional documented behavior correction. No coverage threshold, omission, exclusion, or pragma changes.

Baseline official main artifact: 92.50% (3846/4158), 312 missed. CI artifact determines any delta.

Refs #71
Refs #69
Refs #60

This branch has not been deployed

No deployments
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.

1 participant