diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RegressionEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RegressionEvaluator.java index 263a69aa0bd..f61c409d2eb 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RegressionEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RegressionEvaluator.java @@ -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()); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java index 94f4106439a..699a5629d1d 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java @@ -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); }