tadasets.swiss_roll

tadasets.swiss_roll(n: int = 100, r: float = 10.0, noise: float | None = None, ambient: int | None = None, seed: int | None = None) ndarray[source]

Sample n data points from a Swiss roll.

Parameters:
  • n (int, default=100) – Number of data points in shape.

  • r (float, default=10.0) – Length of roll.

  • noise (float, optional) – Standard deviation of normally distributed noise added to data.

  • ambient (int, optional) – Embed the swiss roll into a space with ambient dimension equal to ambient. The swiss roll is randomly rotated in this high dimensional space.

  • seed (int, optional) – Seed for random state.

References

Equations mimic `Swiss Roll and SNE by jlmelville https://jlmelville.github.io/smallvis/swisssne.html`_.

Returns:

data (np.ndarray) – An (n,3) np.ndarray.