glm.fit:算法未收敛

时间:2020-06-05 14:39:28

标签: r machine-learning classification supervised-learning

我正在使用声纳数据进行分类。

我尝试使用插入符软件包执行逻辑回归:

library(mlbench)
library(caret)

data("Sonar")
head(Sonar)

#remove observations with correlation higher than 0.9
cormat <- cor(Sonar[,-61])
highlycorrelated <- findCorrelation(cormat, cutoff = 0.9)
print(highlycorrelated)
Sonar <- Sonar[-c(15,18,20),]


#Logistic Regression using caret
mod <- train(Sonar[,-61],Sonar[,61], method = "glm", preProcess = c("center", "scale"), tuneLength = 3)
mod


出现以下警告消息:

glm.fit: algorithm did not converge
glm.fit: fitted probabilities numerically 0 or 1 occurred

您能否解释此消息的含义,以及解决引起此消息的问题的方法是什么?

0 个答案:

没有答案