trevorstephens / gplearn

Genetic Programming in Python, with a scikit-learn inspired API
http://gplearn.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.56k stars 274 forks source link

question about _weighted_pearson #288

Closed LotuSrc closed 1 year ago

LotuSrc commented 1 year ago

I have read the source code of _weighted_pearson funtion in fitness.py. Why dose this function return np.abs(corr)? The corr should be in range -1 ~ 1, but in the function it's in 0 ~ 1.

trevorstephens commented 1 year ago

https://gplearn.readthedocs.io/en/stable/intro.html#transformer

"the absolute value of the correlation is maximized in order to accept strongly negatively correlated programs."