Created
August 6, 2017 13:15
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
val logisticRegression: Param[LogisticRegression] = | |
new Param(this, "logisticRegression", "Combine question vectors pairs into a predicted probability.") | |
setDefault(logisticRegression, new LogisticRegression()) | |
private def logisticRegressionPipeline(): Array[PipelineStage] = { | |
val labelCol = "isDuplicateLabel" | |
val assembler = new VectorAssembler().setInputCols(questions("lda")).setOutputCol("mergedlda") | |
val labeler = new SQLTransformer().setStatement( | |
s"SELECT *, cast(isDuplicate as int) $labelCol from __THIS__") | |
val lr = $(logisticRegression) | |
.setFeaturesCol("mergedlda").setProbabilityCol("p").setRawPredictionCol("raw") | |
.setLabelCol(labelCol) | |
Array(assembler, labeler, lr) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment