【问题标题】:SIS r Error in glm.fit(cbind(ones, x[, index], x[, condind]), y, family = gaussian()) : NA/NaN/Inf in 'x'glm.fit(cbind(ones, x[, index], x[, condind]), y, family = gaussian()) 中的 SIS r 错误:“x”中的 NA/NaN/Inf
【发布时间】:2019-10-24 10:26:52
【问题描述】:

我正在使用 SIS R。我的数据是数字的,包括响应变量。 它有 651 列。我对其进行了标准化,并将其转换为矩阵形式。

图书馆(“SIS”)

model1 <- SIS(GTGTm, gGTym, family = "gaussian", penalty = "lasso",
              tune = "bic", nfolds = 10,perm = FALSE,varISIS= "cons",  nsis = 10,
              standardize = TRUE)

我的数据中没有任何 NA。但我收到以下错误消息。请帮忙!但是,它正在使用 as.matrix 创建空间,所以我不知道如何修复它。

GT = read.csv("train.csv")
GTy = read.csv("trainy.csv")

x <- as.matrix(GT[,])
y <- as.matrix(GTy[,])

With str(x)
 chr [1:129, 1:651] " 44" " 55" " 58" " 39" "100" " 85" " 38" " 58" " 80" ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:651] "Automotive.Industry" "Commercial.Vehicles" "Motorcycles" "SUVs" ...

model1

【问题讨论】:

    标签: r sis


    【解决方案1】:

    我发现解决方案最好使用 data.matrix 而不是 as.matrix。

    【讨论】:

      猜你喜欢
      • 2015-12-30
      • 2020-01-27
      • 2021-08-18
      • 1970-01-01
      • 1970-01-01
      • 2018-10-06
      • 1970-01-01
      • 1970-01-01
      • 2013-04-22
      相关资源
      最近更新 更多