MCPcopy Index your code
hub / github.com/microsoft/SandDance / rSquared

Function rSquared

docs/app/js/sanddance-app.js:119669–119677  ·  view source on GitHub ↗
(data, x, y, uY, predict)

Source from the content-addressed store, hash-verified

119667}
119668// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE
119669function rSquared(data, x, y, uY, predict) {
119670 let SSE = 0, SST = 0;
119671 visitPoints(data, x, y, (dx, dy)=>{
119672 const sse = dy - predict(dx), sst = dy - uY;
119673 SSE += sse * sse;
119674 SST += sst * sst;
119675 });
119676 return 1 - SSE / SST;
119677}
119678// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE
119679function linear(data, x1, y) {
119680 let X = 0, Y = 0, XY = 0, X2 = 0, n = 0;

Callers 6

linearFunction · 0.70
logFunction · 0.70
expFunction · 0.70
powFunction · 0.70
quadFunction · 0.70
polyFunction · 0.70

Calls 2

visitPointsFunction · 0.70
predictFunction · 0.70

Tested by

no test coverage detected