Last active
October 29, 2016 00:59
-
-
Save myui/b3ebbdd0604eed2b7dfec69682dc15f2 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
val testData = | |
ssc.textFileStream(...).map(LabeledPoint.parse) // Infinite stream | |
testData.predict { case testDf => | |
// Explode features in input streams | |
val testDf_exploded = ... | |
testDf_exploded | |
.join(model, testDf_exploded("feature") === model("feature"), "LEFT_OUTER") | |
.select($"rowid", ($"weight" * $"value").as("value")) | |
.groupby("rowid").sum("value") | |
.select($"rowid", sigmoid($"SUM(value)")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment