Created
April 2, 2017 12:10
-
-
Save TomLous/535fa68bc6fb09bf452da68682ff6076 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// probability will be a vector with 2 values resp. for label 0.0 and 1.0. We just need the 1.0 one | |
val getP1 = udf((v: Vector) => v(1)) | |
val predictionsRaw = lrModel.transform(comparableDataset) | |
val predictedLinksDataset = predictionsRaw | |
.select( | |
$"left.dossierNummer".as("dossierNummer_left"), | |
$"right.dossierNummer".as("dossierNummer_right"), | |
$"features", | |
getP1($"probability").as("probability"), | |
$"prediction".as("label") | |
) | |
.filter('label === 1.0) | |
.as[PredictedVector] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment