O'Reilly logo

Machine Learning with Spark - Second Edition by Nick Pentreath, Manpreet Singh Ghotra, Rajdeep Dua

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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     (vectorAssembler, vectorIndexer, dataFrame)     case "LR_SVM" =>      LinearRegressionPipeline.linearRegressionWithSVMFormat(spark)     case "GLR_Vectors" =>      GeneralizedLinearRegressionPipeline .genLinearRegressionWithVectorFormat(vectorAssembler, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required