我正在使用声纳数据进行分类。
我尝试使用插入符软件包执行逻辑回归:
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
您能否解释此消息的含义,以及解决引起此消息的问题的方法是什么?