MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / mean

Function mean

polynomial-regression/index.js:70–76  ·  view source on GitHub ↗
(vector)

Source from the content-addressed store, hash-verified

68// Returns:
69// The arithmetic mean.
70function mean(vector) {
71 let sum = 0;
72 for (const x of vector) {
73 sum += x;
74 }
75 return sum / vector.length;
76}
77
78// Calculate the standard deviation of a vector.
79//

Callers 2

stddevFunction · 0.70
toNormalizedTensorsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected