I built a random forest model using the following code: 

```
import org.apache.spark.ml.classification.RandomForestClassificationModel
import org.apache.spark.ml.classification.RandomForestClassifier
val rf = new RandomForestClassifier().setLabelCol("indexedLabel").setFeaturesCol("features")
val labelConverter = new    IndexToString().setInputCol("prediction").setOutputCol("predictedLabel").setLabels(labelIndexer.labels)
val training = labelIndexer.transform(df)
val model = rf.fit(training)

```

now I want to save the model in order to predict later using the following code:

```
val predictions: DataFrame = model.transform(testData)

```

I've looked into Spark documentation [here](https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.ml.classification.RandomForestClassifier) and didn't find any option to do that. Any idea? 
It took me a few hours to build the model , if Spark is crushing I won't be able to get it back.