subkanthi commented on issue #9277:
URL: https://github.com/apache/pinot/issues/9277#issuecomment-1383398684
@siddharthteotia while testing, noticed that with the following
implementation get a lot of NaN values, but with apache commons math
PearsonCoefficient class its not NaN, just like the `skewness` and `kurtosis`
implementation trying to change to use the apache commons function.
```
double sumX = correlationTuple.getSumX();
double sumY = correlationTuple.getSumY();
double sumXY = correlationTuple.getSumXY();
double squareSumX = correlationTuple.getSquareSumX();
double squareSumY = correlationTuple.getSquareSumY();
double bottom = Math.sqrt((count * squareSumX
- sumX * sumX) * (count * squareSumY - sumY * sumY));
if (bottom == 0) {
return 0d;
}
double top = count * sumXY - sumX * sumY;
return top / bottom;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]