def f(): s1 = regressionTreeBase.SampleSummary() s2 = regressionTreeBase.SampleSummary(1.0) s3 = regressionTreeBase.SampleSummary(2.0, 2.0, 2.0) s = (s3 + s2) - s1 return (s.mean, s.stdev, s.variance, s.impurity())
def f(): hist = regressionTreeBase.SampleSummaryHistogram( 0.0, 1.0, 5.0, False) s = regressionTreeBase.SampleSummary(3) hist.observe(0.1, s) hist.observe(1.2, regressionTreeBase.SampleSummary(2)) hist.observe(2.8, regressionTreeBase.SampleSummary(1)) hist.observe(3.9, regressionTreeBase.SampleSummary(2)) hist.observe(4.4, regressionTreeBase.SampleSummary(3)) return hist.bestSplitPointAndImpurityImprovement()
def f(): m = regressionTreeBase._MutableVector(sz, 0) for ix in xrange(sz): m.augmentItem(ix, sz + ix) return [m[ix] for ix in range(len(m))]
def f(): m = regressionTreeBase._MutableVector(sz, 0) for ix in xrange(sz): m.setitem(ix, ix) return [val for val in m]
def f(): s = regressionTreeBase.SampleSummary() return regressionTreeBase.SampleSummary.impurityImprovement(s, s)