Save the model to some persistent storage.
Save the model to some persistent storage.
This method should return true if the model has been saved successfully so that PredictionIO knows that it can be restored later during deployment. This method should return false if the model cannot be saved (or should not be saved due to configuration) so that PredictionIO will re-train the model during deployment. All arguments of this method are provided by automatically by PredictionIO.
ID of the run that trained this model.
Algorithm parameters that were used to train this model.
An Apache Spark context.
Mix in and implement this trait if your model cannot be persisted by PredictionIO automatically. A companion object extending IPersistentModelLoader is required for PredictionIO to load the persisted model automatically during deployment.
Notice that models generated by PAlgorithm cannot be persisted automatically by nature and must implement these traits if model persistence is desired.
In Java, all you need to do is to implement this interface, and add a static method with 3 arguments of type String, Params, and SparkContext.
Algorithm parameters class.
PersistentModelLoader