_mixins#
- ns_sdn.engine._internals._mixins = <module 'ns_sdn.engine._internals._mixins' from '/home/runner/work/ns-sdn/ns-sdn/src/ns_sdn/engine/_internals/_mixins.py'>[source]#
capabilities a frozen result opts into.
Every class declares
__slots__ = ()and no fields. A mixin annotates the attributes it reads and the concrete result declares them, which is what lets several compose onto one slotted dataclass. The surface and the names matchcultivars’ mixins so a result from this package reads the same way to a user of that one.Three capabilities: rendering (
_SummaryMixin, which turns a_summary_tableintosummary(),repr,strand the notebook display), frame interop (_SeriesMixin,to_dictandto_pandasover the aligned per-observation outputs), and criterion-named comparison (_ComparisonMixin, the information criteria andcompare).Example
>>> import numpy as np >>> from ns_sdn.spectral_decomposition import NSSDN, Stage >>> y = np.sin(0.3 * np.arange(80.0)) >>> res = NSSDN(y, k=1, state_dim=4, schedule=(Stage(1e-2, 5),), seed=0).fit() >>> [m.__name__ for m in type(res).__mro__ if m.__name__.endswith("Mixin")] ['_SummaryMixin', '_SeriesMixin', '_ComparisonMixin'] >>> res.summary().title, res.to_dict()["observed"].shape, res.aic > res.llf ('NSSDN(k=1) Results', (80,), True)
- Type:
Behavior mixins