[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of scanpy.
[X] (optional) I have confirmed this bug exists on the main branch of scanpy.
What happened?
Hi,
since statsmodels 0.14, perfect separation no longer raises an error but a warning (see function doc here). Because scanpy currently only catches the now-outdated error (instead of catch the warning), users may see many warnings from regress_out when no perfect separation exists (see usage in scanpy here). It seems to follow on the heels of this issue in statsmodels. I propose to implement that the warning is caught just as the errors were being caught.
Cheers,
Jesko
Minimal code sample
N/A
Error output
.../statsmodels/genmod/generalized_linear_model.py:1257: PerfectSeparationWarning: Perfect separation or prediction detected, parameter may not be identified
warnings.warn(msg, category=PerfectSeparationWarning)
Please make sure these conditions are met
What happened?
Hi, since statsmodels 0.14, perfect separation no longer raises an error but a warning (see function doc here). Because scanpy currently only catches the now-outdated error (instead of catch the warning), users may see many warnings from
regress_out
when no perfect separation exists (see usage in scanpy here). It seems to follow on the heels of this issue in statsmodels. I propose to implement that the warning is caught just as the errors were being caught. Cheers, JeskoMinimal code sample
Error output
Versions