scikit-learn-contrib / forest-confidence-interval

Confidence intervals for scikit-learn forest algorithms
http://contrib.scikit-learn.org/forest-confidence-interval/
MIT License
282 stars 47 forks source link

Sum taken over wrong axis #104

Closed bchugg closed 2 months ago

bchugg commented 3 years ago

Hi there,

I believe the centered predictions are being computed incorrectly. Line 278 in forestci.py takes the average over the predictions, as opposed to the trees. The resulting shape of pred_mean is (forest.n_estimators,) when it should be (X_test.shape[0],). See below:

https://github.com/scikit-learn-contrib/forest-confidence-interval/blob/6d2a9c285b96bd415ad5ed03f37e517740a47fa2/forestci/forestci.py#L278

Thanks for the great package otherwise! :)

nikaashpuri commented 1 year ago

are there any thoughts on this one?

nikaashpuri commented 1 year ago

please check https://github.com/scikit-learn-contrib/forest-confidence-interval/issues/80

danieleongari commented 2 months ago

pred_mean is correct to compute the variance of pred. I guess you missed that the matrix pred is trasposed.