2017-07-30 79 views
0

如何保存SparkR模型並單獨加載模型並預測?
星火2.0SparkR保存ML模型

# Load training data 
df <- read.df("data/mllib/sample_libsvm_data.txt", source = "libsvm") 
training <- df 
testing <- df 

# Fit a random forest classification model with spark.randomForest 
model <- spark.randomForest(training, label ~ features, "classification", numTrees = 10) 

# Model summary 
summary(model) 



### Save and Load 
?? 

# Prediction 
predictions <- predict(model, test) 
head(predictions) 

回答