MCPcopy Create free account
hub / github.com/apache/madlib / __logistic_trans_compute

Function __logistic_trans_compute

src/modules/regress/clustered_errors.cpp:344–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344void __logistic_trans_compute (MutableClusteredState& state,
345 const MappedColumnVector& x, const double& y)
346{
347 double sm = 0;
348 for (int i = 0; i < state.widthOfX; i++) sm += state.coef(i) * x(i);
349
350 double sgn = y > 0 ? -1 : 1;
351 double t1 = sigma(sgn * sm);
352 double t2 = sigma(-sgn * sm);
353
354 for (int i = 0; i < state.widthOfX; i++)
355 state.meat_half(0,i) += t1 * sgn * x(i);
356
357 state.bread += (t1 * t2) * (x * trans(x));
358}
359
360// ------------------------------------------------------------------------
361

Callers

nothing calls this directly

Calls 2

transFunction · 0.85
sigmaFunction · 0.70

Tested by

no test coverage detected