November 2019
Intermediate to advanced
296 pages
7h 52m
English
Comparing the variance of the data can demonstrate that PCA is able to achieve the most variance if we convert it into a low-dimensional space. The variance of the data is the Euclidean distance of the difference between the data points and the mean of the feature. As we saw previously, the mean of each feature is calculated by xs.mean(0):
function variance(xs: tf.Tensor) { const v = xs.sub(xs.mean(0)).pow(2).mean(); console.log(v.dataSync());}
Let's see how the variance can be changed by projecting the data in four ways:
This can be done using the following code:
console.log("Variance of ...Read now
Unlock full access