You basically need to make a Pipeline and build a ParamGrid with different algorithms as stages.  Here is an simple example:

val dt = new DecisionTreeClassifier()

val lr = new LogisticRegression()

val pipeline = new Pipeline()

val paramGrid = new ParamGridBuilder()
.addGrid(pipeline.stages, Array(Array[PipelineStage](dt), Array[PipelineStage](lr)))

val cv = new CrossValidator()

More info in
Thank you Brian Cutler.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s