In this section, we are going to experiment on the dataset in a 3D space. The data points that will be generated in the 3D space cannot be rendered in the two-coordinate system.
Projecting 3D points into a 2D space with PCA
Three-dimensional clusters
We have already seen how we can generate the dataset from a normal distribution. To reduce the dimensionality of the original dataset, we will need to use the shape (Batch, 3):
const N = 30;
const D = 3;
// tf.randomNormal generates the tensor with the given shape from the normal distribution.
const c1 = tf.randomNormal([N, D]).add([1.0, 0.0, 0.0]);
const c2 = tf.randomNormal([N, D]).add([-1.0, 0.0, 0.0]);
const c3 = tf.randomNormal([N, D]).add([0.0, 1.0, 1.0]);
const xs = c1.concat...