Surfaced during PR #49 review (silent-failure-hunter).
pyAMICA/amica.py's AMICA.fit() sets self.is_fitted_ = True unconditionally after self.model_.fit(...), regardless of self.model_.stop_reason. If a fit ends degenerate (stop_reason in nan_ll/singular_ll), transform()/fit_transform() will still run and return NaN sources with no exception and no wrapper-level surfacing (only a backend logger.warning several frames down).
This is pre-existing (not introduced by #49) and broader than the multi-model c update, but the n_models>1 feature makes it more reachable in ordinary use.
Scope:
- After
fit(), if stop_reason indicates degeneracy, either raise or expose it clearly (and/or refuse transform() on a degenerate model), consistent with state_dict() which already refuses to serialize such a model.
- Decide the contract: hard error vs. a
converged_/stop_reason_ attribute the caller must check.
Note: PR #49 added a containment guard so the per-model bias c can no longer go NaN from a dead model, which reduces (but does not remove) the ways a multi-model fit can end degenerate.
Surfaced during PR #49 review (silent-failure-hunter).
pyAMICA/amica.py'sAMICA.fit()setsself.is_fitted_ = Trueunconditionally afterself.model_.fit(...), regardless ofself.model_.stop_reason. If a fit ends degenerate (stop_reasoninnan_ll/singular_ll),transform()/fit_transform()will still run and return NaN sources with no exception and no wrapper-level surfacing (only a backendlogger.warningseveral frames down).This is pre-existing (not introduced by #49) and broader than the multi-model
cupdate, but then_models>1feature makes it more reachable in ordinary use.Scope:
fit(), ifstop_reasonindicates degeneracy, either raise or expose it clearly (and/or refusetransform()on a degenerate model), consistent withstate_dict()which already refuses to serialize such a model.converged_/stop_reason_attribute the caller must check.Note: PR #49 added a containment guard so the per-model bias
ccan no longer go NaN from a dead model, which reduces (but does not remove) the ways a multi-model fit can end degenerate.