@@ -0,0 +1,866 @@
+package edu.neu.ccs.pyramid.regression.prob_reg_tree;%0A%0A/**%0A * probabilistic sum of squared error%0A * Created by chengli on 10/16/14.%0A */%0Aclass ProbabilisticSSE %7B%0A%0A    static double sse(double%5B%5D labels, double%5B%5D probs)%7B%0A        double sum = 0;%0A        double mean = mean(labels,probs);%0A        for (int i=0;i%3Clabels.length;i++)%7B%0A            double error = labels%5Bi%5D - mean;%0A            sum += error*error*probs%5Bi%5D;%0A        %7D%0A        return sum;%0A    %7D%0A%0A    /**%0A     * weighed average, weights are probs%0A     * @param labels%0A     * @param probs%0A     * @return%0A     */%0A    static double mean(double%5B%5D labels, double%5B%5D probs)%7B%0A        double nominator = 0;%0A        double denominator = 0;%0A        for (int i=0;i%3Clabels.length;i++)%7B%0A            nominator += labels%5Bi%5D*probs%5Bi%5D;%0A            denominator += probs%5Bi%5D;%0A        %7D%0A        return nominator/denominator;%0A    %7D%0A%0A%0A%7D%0A

add class ProbabilisticSSE