ShortTermPredictionServiceImpl is the class that actually performs the prediction with the given model and data. At first, it transforms PriceData into a Spark DataFrame with the scheme corresponding to the one used for training by calling transformPriceData(priceData: PriceData). Then, the model.transform(dataframe) method is called; we extract the variables we need, write into the debugger log and return to the caller:
override def predictPriceDeltaLabel(priceData: PriceData, mlModel: org.apache.spark.ml.Transformer): (String, Row) = {
val df = transformPriceData(priceData)
val prediction = mlModel.transform(df)
val predictionData = prediction.select("probability", "prediction", "rawPrediction").head()
(predictionData.get(1).asInstanceOf[Double].toInt.toString, predictionData...