Skip to content

Instantly share code, notes, and snippets.

Created November 6, 2017 18:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
import resource._
import ml.combust.bundle.BundleFile
import ml.combust.mleap.runtime.MleapContext.defaultContext
import ml.combust.mleap.runtime.MleapSupport._
import ml.combust.mleap.runtime.serialization.FrameReader
object HelloWorld {
def main(args: Array[String]) {
* Loading the model in zip file; deserializing it
val mleapTransformerLr = (for (bf <- managed(BundleFile("jar:file:/Users/harshvardhan/Downloads/"))) yield {
* Test Data
val s ="").mkString
val bytes = s.getBytes("UTF-8")
* Running the test data against the model to get a prediction
for (frame <- FrameReader("ml.combust.mleap.json").fromBytes(bytes);
frameLr <- mleapTransformerLr.transform(frame);
frameLrSelect <-"price_prediction")) {
println("Price LR: " + frameLrSelect.dataset(0).getDouble(0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment