moved printed output into variable; added support for GetTrainPrediction