33. @jeffksmithjr @xdotai#Devoxx
val conf = new SparkConf().setAppName(“FraudModel")
.setMaster("local[*]")
val sc = new SparkContext(conf)
val sqlContext = new SQLContext(sc)
import sqlContext.implicits._
Spark Setup
34. @jeffksmithjr @xdotai#Devoxx
val data = sqlContext.read.format(“libsvm")
.load("src/main/resources/sample_libsvm_data.txt")
val Array(trainingData, testingData) =
data.randomSplit(Array(0.8, 0.2))
val learningAlgo = new LogisticRegression()
val model = learningAlgo.fit(trainingData)
Data Preparation & Model Learning
50. @jeffksmithjr @xdotai#Devoxx
val ns = NameServerProxy.locateNS(null)
val remoteServer = new
PyroProxy(ns.lookup("neuralserver"))
Finding the Service
80. @jeffksmithjr @xdotai#Devoxx
ml_system.ex:3: Function predict/1 has
no local return
ml_system.ex:6: The call
'Elixir.MLSystem':call_model_b(feature@1
::number()) will never return since it
differs in the 1st argument from the
success typing arguments: (binary())
Dialyzer Output
81. @jeffksmithjr @xdotai#Devoxx
ml_system.ex:22: Invalid type
specification for function
'Elixir.MLSystem':call_model_b/1. The
success typing is (binary()) -> binary()
ml_system.ex:23: Function call_model_b/1
has no local return
ml_system.ex:24: The call
'Elixir.String':upcase(feature@1::number
()) will never return since the success
typing is (binary()) -> bitstring() and
the contract is (t()) -> t()
Dialyzer Output