R:“解释”时出现石灰错误

时间:2019-12-23 01:48:55

标签: r machine-learning r-caret glm

我不知道为什么,对于那个简单的例子,我无法让Lime工作。这是显示问题的独立代码:

data(Theoph)

library(caret)

outcomeName <- 'conc'
predictors<-names(Theoph)[!names(Theoph) %in% outcomeName]

model_gbm <- train(Theoph[,predictors],Theoph[,outcomeName],method='gbm')

library(lime)
library(tidyr)

explainer_caret <- lime(x = as.data.frame(Theoph[, predictors]), model = model_gbm, n_bins = 10)

explanation_caret <- explain(
  x = as.data.frame(Theoph[c(1), predictors]), 
  explainer = explainer_caret, 
  dist_fun = "gower",
  kernel_width = NULL,
  n_features = 2, 
  feature_select = "auto"
)

glm.fit(x = x_fit,y = y,weights = weights,family = gaussian())错误:   NA / NaN / Inf in'y'

有任何想法/建议吗?

0 个答案:

没有答案