MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Variance

Function Variance

tensorflow/contrib/tensor_forest/kernels/v4/stat_utils.cc:53–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53float Variance(const LeafStat& stats, int output) {
54 if (stats.weight_sum() == 0) {
55 return 0;
56 }
57 const float e_x =
58 stats.regression().mean_output().value(output).float_value() /
59 stats.weight_sum();
60 const auto e_x2 =
61 stats.regression().mean_output_squares().value(output).float_value() /
62 stats.weight_sum();
63 return e_x2 - e_x * e_x;
64}
65
66float TotalVariance(const LeafStat& stats) {
67 float sum = 0;

Callers 1

TotalVarianceFunction · 0.70

Calls 2

weight_sumMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected