_models#
- ns_sdn.engine._internals._models = <module 'ns_sdn.engine._internals._models' from '/home/runner/work/ns-sdn/ns-sdn/src/ns_sdn/engine/_internals/_models.py'>[source]#
Protected base classes for model specifications.
_BaseModelownsendogvalidation and the abstractfit._SpectralDecompositionModelis the family base: it validates every specification argument at construction, builds the network, runs the schedule, and packs the raw outputs into a_SpectralFit. The publicNSSDNclass adds nothing butfit, which assembles the public result from that record and the specification.Both bases are generic in the result type
Rso that a subclass’sfitis typed with its own result, and both use__slots__so a specification cannot grow attributes after validation.Example
>>> import numpy as np >>> from ns_sdn.spectral_decomposition import NSSDN >>> model = NSSDN(np.arange(10.0), time=np.arange(10.0) * 2.0) >>> isinstance(model, _SpectralDecompositionModel), isinstance(model, _BaseModel) (True, True) >>> model.nobs_total, model.exog_dim, model.positive_frequency (10, 0, True)