November 2019
Intermediate to advanced
296 pages
7h 52m
English
Three clusters are generated from the Gaussian distribution. Like we did in the previous chapter, we can use tf.randomNormal in TensorFlow.js to sample data points from the Gaussian distribution. The mean of the distribution is [0, 0] in a two-dimensional space. It is necessary to move the center by adding constants:
const N = 30;const c1 = tf.randomNormal([N, 2]).add([2.0, 1.0]);const c2 = tf.randomNormal([N, 2]).add([-2.0, -1.0]);const c3 = tf.randomNormal([N, 2]).add([-2.0, 2.0]);const xs = c1.concat(c2).concat(c3);
The three clusters can be illustrated as follows:

Since the clustering problem is a form of unsupervised ...
Read now
Unlock full access