qilisdk.ml.datasets.logistic_map

Classes

LogisticMap

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.Dataset

Logistic 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 a horizon-step-ahead prediction task, so inputs and targets are shaped (npoints, 1).

Configure a logistic map generator.

Parámetros:
  • r (float) – Growth-rate parameter \(r\). Defaults to 3.9.

  • x0 (float) – Initial value in [0, 1]. Defaults to 0.5.

  • washout (int) – Number of initial iterations discarded. Defaults to 100.

  • horizon (int) – Prediction horizon in steps. Defaults to 1.

  • seed (int | None) – Unused; the system is deterministic. Defaults to None.

Muestra:

ValueError – If x0 is 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 first washout steps. The resulting series is split into inputs and targets, where targets is the same series shifted forward by horizon.

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 both inputs and targets are shaped (npoints, 1).

Tipo del valor devuelto:

DatasetSample

Muestra:

ValueError – If npoints is not positive.