Problem when column has no missingness
TorbenSell opened this issue · 2 comments
TorbenSell commented
Hi,
I am using MissForest to impute a data frame consisting of two columns, of which only the second one has missing values. I get an error message:
492 if (
493 n_iter >= 2 and
494 len(self.categorical) > 0 and
495 all_gamma_cat[-1] > all_gamma_cat[-2]
496 ):
497 break
499 if (
500 n_iter >= 2 and
501 len(self.numerical) > 0 and
--> 502 all_gamma_num[-1] > all_gamma_num[-2]
503 ):
504 break
506 # mapping the encoded values back to its categories.
IndexError: list index out of range
The code works well as long as I have missing values in both columns (tested by artificially adding a nan in the first column), but not if the first column is completely observed.
Can this be fixed?
Thank you!
yuenshingyan commented
Hi, I have re-created the bug and fixed it. So far, I don't have any problem on my side.
https://pypi.org/project/MissForest/
TorbenSell commented
Thank you, this is fantastic!
… On 8 Dec 2023, at 01:05, Hindy ***@***.***> wrote:
Hi, I have re-created the bug and fixed it. So far, I don't have any problem on my side.
https://pypi.org/project/MissForest/
—
Reply to this email directly, view it on GitHub <#22 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AHZBRSP3VTQUPBLTDNRRNKTYIJRV5AVCNFSM6AAAAABAGESFLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBWGM2DCNBWHE>.
You are receiving this because you authored the thread.