Returns a function that computes zscore-based normalisation.
// Calculate necessary componentsconst m = mean(data);const s = standardDeviation(data);// Get the functionconst fn = compute(m, s);// Use itfn(10); // Yields the normalised value Copy
// Calculate necessary componentsconst m = mean(data);const s = standardDeviation(data);// Get the functionconst fn = compute(m, s);// Use itfn(10); // Yields the normalised value
It can be used to normalise a whole array
const normalised = someData.map(fn); Copy
const normalised = someData.map(fn);
If you want to calculate for a whole array, use array.
Mean of data
Standard deviation of data
Returns a function that computes zscore-based normalisation.
It can be used to normalise a whole array
If you want to calculate for a whole array, use array.