【发布时间】:2020-10-01 05:55:12
【问题描述】:
我已经提到了这个post 和这个post。但这并不能解决我的问题。请不要将其标记为重复
我正在尝试使用R kernel 在Jupyter Notebook 中运行以下代码。
model_predictors <- buildModel(flag, fv_full_data, outcomeName, folder)
我收到如下错误消息
Model about to be built # this is log message and not error
1 package is needed for this model and is not installed. (randomForest). Would you like to try to install it now? # here I see that it asks for a question but without my input it selects `No`
Error: Required package is missing
Traceback:
1. buildModel(flag, fv_full_data, outcomeName, folder)
2. train(x = trainDF[, predictorsNames], y = factor(trainLabels),
. method = "rf", metric = "Fscore", trControl = objControl,
. tuneGrid = rf_grid, preProcess = c("center", "scale"))
3. train.default(x = trainDF[, predictorsNames], y = factor(trainLabels),
. method = "rf", metric = "Fscore", trControl = objControl,
. tuneGrid = rf_grid, preProcess = c("center", "scale"))
4. checkInstall(models$library)
5. stop("Required package is missing", call. = FALSE)
如何避免此错误并防止 jupyter 选择 No 作为动态提示的默认值?
【问题讨论】:
-
我认为你不应该依赖自动提示来安装你需要的包。运行一次
install.packages("randomForest"),这个问题应该会消失。 -
好的,谢谢。但是我可以知道/向您学习是否有任何方法可以在运行时在
jupyter notebook中键入yes或no
标签: r jupyter-notebook jupyter jupyter-irkernel