qilisdk.ml.datasets.logistic_map
Classes
Logistic map, a simple one-dimensional chaotic system: |
Module Contents
- class LogisticMap(*, r: float = 3.9, x0: float = 0.5, washout: int = 100, horizon: int = 1, seed: int | None = None)[fuente]
Bases:
qilisdk.ml.datasets.dataset.DatasetLogistic map, a simple one-dimensional chaotic system:
\[x_{n+1} = r\, x_n (1 - x_n),\]which becomes chaotic as the growth rate \(r\) approaches 4 (the default \(r = 3.9\) sits well inside the chaotic regime).
generate()returns ahorizon-step-ahead prediction task, soinputsandtargetsare shaped(npoints, 1).Configure a logistic map generator.
- Parámetros:
r (
float) – Growth-rate parameter \(r\). Defaults to3.9.x0 (
float) – Initial value in[0, 1]. Defaults to0.5.washout (
int) – Number of initial iterations discarded. Defaults to100.horizon (
int) – Prediction horizon in steps. Defaults to1.seed (
int | None) – Unused; the system is deterministic. Defaults toNone.
- Muestra:
ValueError – If
x0is not in the closed interval[0, 1].
- generate(npoints: int) qilisdk.ml.datasets.dataset.DatasetSample[fuente]
Iterate the logistic map and build a prediction sample.
This produces a single time series of length
npoints + horizon, discarding the firstwashoutsteps. The resulting series is split intoinputsandtargets, wheretargetsis the same series shifted forward byhorizon.- Parámetros:
npoints (
int) – Number of time steps to produce.- Devuelve:
- The DataSetSample containing the inputs and targets.
The output is a
horizon-step-ahead prediction task, so bothinputsandtargetsare shaped(npoints, 1).
- Tipo del valor devuelto:
- Muestra:
ValueError – If
npointsis not positive.