mirror of https://github.com/apache/lucene.git
SOLR-11203-Simple regression output should include R-square
This commit is contained in:
parent
522367cc4d
commit
ee69616957
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue