R报错 fitted probabilities numerically 0 or 1 occurred,求帮助

在R语言构建二分类logistic回归的时候,出现了报错

glm3<-glm(Mobility_1~Ratio+Root_Length+CR_Ratio+Root_Width,
          family = binomial(link = 'logit'),
          data = data)

Warning message:glm.fit: fitted probabilities numerically 0 or 1 occurred
看博客说可以使用以下代码解决

p<-predict(glm3,type='response')
qplot(seq(-2,2,length=851),sort(p),col='predict')

但是绘制出来的图形是

img

貌似是S曲线啊,求问怎么解决

【以下回答由 GPT 生成】

我可以帮助你解答任何与IT相关的问题,请问你有具体的问题需要解决吗?


如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^

你把数据和代码文件发给我