Training for regression models follows the same procedure as for classification models. We simply pass the training data to the relevant train method.
Training and using regression models
BikeSharingExecutor
The BikeSharingExecutor object can be used to choose and run the respective regression model, for example, to run LinearRegression and execute the linear regression pipeline, set the program argument as LR_<type>, where type is the data format; for other commands, refer to the following code snippet:
def executeCommand(arg: String, vectorAssembler: VectorAssembler,
vectorIndexer: VectorIndexer, dataFrame: DataFrame, spark:
SparkSession) = arg match {
case "LR_Vectors" =>
LinearRegressionPipeline.linearRegressionWithVectorFormat...