我遇到此错误。
features <- layer_input(shape = c(ncol(dat.X)))
Error in path.expand(path) : invalid 'path' argument
这里是完整代码
library(keras)
# we fit j =0 with feature matrix dat.X , claims dat$C1 and volumes dat$C0
dat <- Final
dat.X <- dat[-c(12:15)]
dat.Y <- as.matrix( dat$C1 / sqrt ( dat$C0 )) # observed responses
dat.W <- as.matrix( sqrt( dat$C0 )) # volumes used as offsets
q <- 20 # number of hidden neurons
# definition of neural network
features <- layer_input(shape = c(ncol(dat.X)))
net <- features % >%
layer_dense ( units = q , activation = "tanh") % >%
layer_dense ( units = 1, activation = k_exp )
我希望代码使我成为神经网络模型。
我认为您的keras软件包安装不正确,试试这个
library(keras)
install_keras()