mpd
sgp.models.mpd.Optimizers
module-attribute
Optimizers = Literal['Scipy-LBFGSB', 'Scipy-NelderMead', 'Scipy-Powell', 'Scipy-TNC', 'SKO-DE', 'SKO-GA', 'SKO-PSO', 'SKO-SA', 'SKO-AFSA']
sgp.models.mpd.config
module-attribute
config = Config(verbose=lower() in trues, password=get('SGP_PASSWORD', ''), numba_enabled=get('NUMBA_DISABLE_JIT', '0') == '0', language=value('language', name()))
sgp.models.mpd.distributions
module-attribute
sgp.models.mpd.DistributionResult
sgp.models.mpd.HashableBaseModelIO
Bases: BaseModel
Input/output utilities for the models with support for the following features:
- Hashing of the model
- Conversion to and from dictionaries, json, toml, and yaml files
- Compatibility with pydantic v1 and v2
sgp.models.mpd.HashableBaseModelIO.exclude
property
Fields to exclude from the model, typically used to exclude arbitrary types when it is allowed in the pydantic model to avoid hashing issues.
sgp.models.mpd.HashableBaseModelIO.fromBytes
classmethod
Load the model from a binary string or file if a path is provided.
sgp.models.mpd.HashableBaseModelIO.fromCryptography
classmethod
Decrypt the model using the key.
sgp.models.mpd.HashableBaseModelIO.fromDict
classmethod
fromDict(*, data: dict, **kwargs) -> Self
Load the model from a dictionary.
sgp.models.mpd.HashableBaseModelIO.fromJson
classmethod
Load the model from a json string or file if a path is provided.
sgp.models.mpd.HashableBaseModelIO.fromToml
classmethod
Load the model from a toml string or file if a path is provided.
sgp.models.mpd.HashableBaseModelIO.fromYaml
classmethod
Load the model from a yaml string or file if a path is provided.
sgp.models.mpd.HashableBaseModelIO.toBytes
Convert the model to a binary string or save it to a file if a path is provided.
sgp.models.mpd.HashableBaseModelIO.toCryptography
Encrypt the model using the key.
sgp.models.mpd.HashableBaseModelIO.toDict
toDict(**kwargs) -> dict
Convert the model to a dictionary.
sgp.models.mpd.HashableBaseModelIO.toJson
Convert the model to a json string or save it to a file if a path is provided.
sgp.models.mpd.HashableBaseModelIO.toToml
Convert the model to a toml string or save it to a file if a path is provided.
sgp.models.mpd.HashableBaseModelIO.toYaml
Convert the model to a yaml string or save it to a file if a path is provided.
sgp.models.mpd.HashableBaseModelIO.update
update(data: dict = None, **kwargs) -> Self
Update the options of the optimizer
sgp.models.mpd.Johnson
Bases: HashableBaseModelIO
Johnson distribution model.
sgp.models.mpd.Johnson.X2Y
classmethod
X2Y(X: ArrayLike | Number, type: Literal['su', 'sb', 'sl'], aX: float, bX: float, aY: float, bY: float) -> ndarray | Number
Denormalize the data from the Johnson distribution.
sgp.models.mpd.Johnson.Y2X
classmethod
Y2X(Y: ArrayLike | Number, type: Literal['su', 'sb', 'sl'], aX: float, bX: float, aY: float, bY: float) -> ndarray | Number
Normalize the data to the Johnson distribution.
sgp.models.mpd.Johnson.__call__
Calculate the fitness of the Johnson distribution.
sgp.models.mpd.Johnson.dist
classmethod
dist(type: Literal['su', 'sb', 'sl'], aX: float, bX: float, aY: float, bY: float, mu: float = 0.0, sigma: float = 1.0) -> Tuple[rv_continuous, Tuple, Dict[str, ...]]
Get the distribution object and distribution parameters.
sgp.models.mpd.Johnson.fit
Fit the Johnson distribution to the data.
sgp.models.mpd.Johnson.fitness
Calculate the fitness of the Johnson distribution.
sgp.models.mpd.Johnson.kstest_pvalue
Calculate the p-value of the Johnson distribution.
sgp.models.mpd.MPD
Bases: PredictionBase
Multivariate Distribution (MPD) model.
sgp.models.mpd.MPD.corr_bootstrap
Calculate the correlation matrix.
sgp.models.mpd.MPD.fit
Fit the Johnson distribution to the data.
| RETURNS | DESCRIPTION |
|---|---|
A tuple containing the distributions, the optimization results, the statistics, and the p-values.
|
|
sgp.models.mpd.MPD.optimize
optimize(df: DataFrame, *, method: Optimizers, **kwargs)
Optimize the z-value for the Johnson distribution.
sgp.models.mpd.MPDConditionalResult
Bases: HashableBaseModelIO
sgp.models.mpd.MPDDistributionalResult
sgp.models.mpd.MPDDistributionalResults
Bases: HashableBaseModelIO
sgp.models.mpd.OptimizerResult
sgp.models.mpd.PredictionBase
Bases: HashableBaseModelIO
Base class for prediction models.
sgp.models.mpd.PredictionBase.predict
abstractmethod
predict(**inputs: float) -> Dict[str, float | HashableBaseModelIO]
Predict the output from the input.
sgp.models.mpd.corr_bootstrap
Calculate the bootstrapping correlation matrix.
sgp.models.mpd.hashkey
Return a cache key for the specified hashable arguments, convert non-hashable arguments to hashable ones.