Created
August 8, 2017 14:20
-
-
Save anonymous/ac5ec1c4deb52ae555215222ac730526 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private def assemblePipeline(): Pipeline = { | |
val stages = Array( | |
cleanerPipeline(), | |
tokenizePipeline(), | |
vectorizePipeline(), | |
ldaPipeline(), | |
logisticRegressionPipeline() | |
).flatten | |
new Pipeline().setStages(stages) | |
} | |
override def fit(dataset: Dataset[_]): PipelineModel = { | |
logger.info(s"Preparing to fit quora question pipeline with params:\n${explainParams()}") | |
val model = assemblePipeline().fit(dataset) | |
logMetrics(model, dataset) | |
logTopics(dataset.sparkSession, model) | |
model | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment