Datasets

using GeometricDatasets;
using CairoMakie;

Below are some commom datasets from topology.

Spheres

doc

Create a sphere in R^(dim) with n points and radius radius.

Arguments

  • n::Integer: the number of points.
  • dim::Integer: the dimension of the sphere (that is: in which R^dim it is).
  • radius::Number: the radius of the sphere.
  • noise::Function: a function such that y = noise(dim) is a Vector{<:Number} with size(y) = (dim;).
 X = sphere(1000; dim = 2, radius = 4);
 scatter(X)

Add some noise

X = sphere(1000; dim = 2, noise = x -> rand(x) * 0.2);
scatter(X)

X = sphere(1000; dim = 2, noise = x -> rand(x) * 1);
scatter(X)

X = sphere(1000; dim = 3, noise = x -> rand(x) * 0.3);
scatter(X)

Cubes

doc

Create a cube in R^(dim``) withnpoints and radiusradius`.

Arguments

  • n::Integer: the number of points.
  • dim::Integer: the dimension of the cube (that is: in which R^dim it is).
  • radius::Number: the “radius” of the cube, that is, the distance from the center to one of its sides..
  • noise::Function: a function such that y = noise(dim) is a Vector{<:Number} with size(y) = (dim;).
X = cube(1000; dim = 2);
scatter(X)

X = cube(500; dim = 3);
scatter(X)

Torus

doc
torus(n::Integer = 100; r::Number = 1, R::Number = 3)

Arguments

  • n::Integer: the number of points.
  • r::Number: the inner radius.
  • R::Number: the outer radius.
X = torus(1000);
scatter(X)