# NOT RUN {
df <- read.df("data/mllib/sample_linear_regression_data.txt", source = "libsvm")
# fit Factorization Machines Regression Model
model <- spark.fmRegressor(
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