# NOT RUN {
df <- read.df("data/mllib/sample_binary_classification_data.txt", source = "libsvm")
# fit Factorization Machines Classification Model
model <- spark.fmClassifier(
df, label ~ features,
regParam = 0.01, maxIter = 10, fitLinear = TRUE
)
# get the summary of the model
summary(model)
# make predictions
predictions <- predict(model, df)
# save and load the model
path <- "path/to/model"
write.ml(model, path)
savedModel <- read.ml(path)
summary(savedModel)
# }
Run the code above in your browser using DataLab