# NOT RUN {
if(is_keras_available()){
mtcars$make <- unlist(lapply(strsplit(rownames(mtcars), " "), function(tokens) tokens[1]))
company <- kms(make ~ ., mtcars[3:32, ], Nepochs = 2)
forecast <- predict(company, mtcars[1:2, ])
forecast$confusion
# example where y_test is unavailable
trained <- kms(log(mpg) ~ ., mtcars[4:32,])
X_test <- subset(mtcars[1:3,], select = -mpg)
predictions <- predict(trained, X_test)
}else{
cat("Please run install_keras() before using kms(). ?install_keras for options like gpu.")
}
# }
Run the code above in your browser using DataLab