我在为数据运行逻辑回归时遇到问题,首先我在r中使用了glm函数,但收到以下警告:
Warning message:
glm.fit: fitted probabilities numerically 0 or 1 occurred
现在我正尝试做glmnet,因为数据非常稀疏:
x = data[, 2:27]
y = data[, 1]
y = as.matrix(y)
fit = glmnet(x, y, family = "binomial")
但是出现以下我不理解的错误:
Error in lognet(x, is.sparse, ix, jx, y, weights, offset, alpha, nobs, :
(list) object cannot be coerced to type 'double'