# NOT RUN {
sparkR.session()
t <- as.data.frame(Titanic)
training <- createDataFrame(t)
model <- spark.svmLinear(training, Survived ~ ., regParam = 0.5)
summary <- summary(model)
# fitted values on training data
fitted <- predict(model, training)
# save fitted model to input path
path <- "path/to/model"
write.ml(model, path)
# can also read back the saved model and predict
# Note that summary deos not work on loaded model
savedModel <- read.ml(path)
summary(savedModel)
# }
Run the code above in your browser using DataLab