SOLR-11203-Simple regression output should include R-square

This commit is contained in:
Joel Bernstein 2017-08-06 13:51:26 -04:00
parent 522367cc4d
commit ee69616957
2 changed files with 3 additions and 0 deletions

View File

@ -72,6 +72,7 @@ public class RegressionEvaluator extends ComplexEvaluator implements Expressible
map.put("intercept", regression.getIntercept());
map.put("R", regression.getR());
map.put("N", regression.getN());
map.put("RSquare", regression.getRSquare());
map.put("regressionSumSquares", regression.getRegressionSumSquares());
map.put("slopeConfidenceInterval", regression.getSlopeConfidenceInterval());
map.put("interceptStdErr", regression.getInterceptStdErr());

View File

@ -6287,8 +6287,10 @@ public class StreamExpressionTest extends SolrCloudTestCase {
Map regression = (Map)tuple.get("regress");
double slope = (double)regression.get("slope");
double intercept= (double) regression.get("intercept");
double rSquare= (double) regression.get("RSquare");
assertTrue(slope == 2.0D);
assertTrue(intercept == 0.0D);
assertTrue(rSquare == 1.0D);
double prediction = tuple.getDouble("p");
assertTrue(prediction == 600.0D);
}