I've just built my own SPSS model in SPSS Modeler 18 for Predictive Analytics service and uploaded it to the Predictive Analytics service. I'm now trying to read model scores from Apache Spark as done in this tutorial. I keep getting the following error:
MQTT subscribe topics:iot-2/type/+/id/+/evt/accelerometer_events/fmt/+
MQTT uri:ssl://xxxxxxx.messaging.internetofthings.ibmcloud.com:8883
MQTT appid:a:xxxxxxxxxx
MQTT apikey:xxxxxxxxxx
MQTT authtoken:xxxxxxxxx
Testing the connectivity to Watson IoT Platform ...
serverURI:ssl://xxxxxxxx.messaging.internetofthings.ibmcloud.com:8883
clientId:xxxxxxxx
NMoQtT Ta uCtlhiento rifzaeidl etd oto c ocnnonecnectt e(d5 )to the server
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:28)
at org.eclipse.paho.client.mqttv3.internal.ClientState.notifyReceivedAck(ClientState.java:885)
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:118)
at java.lang.Thread.run(Thread.java:785)
Able to connect to Watson IoT Platform successfully !!
Testing the connectivity to Predictive Analytics service ...
Creating new instance of IoTPredictionNonPeriodic
window size is 10
{"flag":false,"message":"Failed to score BlueCarl, msg=ERROR: Missing required input table [test3.csv], details:java.lang.RuntimeException: ERROR: Missing required input table [test3.csv]\n\tat com.ibm.spss.internal.PredictiveScorerCSPImpl$InputIterator.setInputData(PredictiveScorerCSPImpl.java:286)\n\tat com.ibm.spss.internal.PredictiveScorerCSPImpl.score(PredictiveScorerCSPImpl.java:130)\n\tat com.ibm.spss.internal.SynchronizedPredictiveScorerCSPImpl.score(SynchronizedPredictiveScorerCSPImpl.java:68)\n\tat com.ibm.spss.internal.scorer.pool.PooledScorerImpl.score(PooledScorerImpl.java:97)\n\tat com.ibm.spss.blackbox.score.resource.ScoreUtil.score(ScoreUtil.java:153)\n\tat com.ibm.spss.blackbox.score.resource.ScoreResource.scoreWithInputdata(ScoreResource.java:69)\n\tat sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)\n\tat java.lang.reflect.Method.invoke(Method.java:620)\n\tat org.apache.wink.server.internal.handlers.InvokeMethodHandler.handleRequest(InvokeMethodHandler.java:63)\n\tat org.apache.wink.server.handlers.AbstractHandler.handleRequest(AbstractHandler.java:33)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)\n\tat org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)\n\tat org.apache.wink.server.internal.handlers.CreateInvocationParametersHandler.handleRequest(CreateInvocationParametersHandler.java:54)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)\n\tat org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)\n\tat org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleSubResourceMethod(FindResourceMethodHandler.java:188)\n\tat org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:110)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)\n\tat org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)\n\tat org.apache.wink.server.internal.handlers.FindRootResourceHandler.handleRequest(FindRootResourceHandler.java:95)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)\n\tat org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)\n\tat org.apache.wink.server.internal.handlers.HeadMethodHandler.handleRequest(HeadMethodHandler.java:53)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)\n\tat org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)\n\tat org.apache.wink.server.internal.handlers.OptionsMethodHandler.handleRequest(OptionsMethodHandler.java:46)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)\n\tat org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)\n\tat org.apache.wink.server.internal.handlers.SearchResultHandler.handleRequest(SearchResultHandler.java:33)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)\n\tat org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)\n\tat org.apache.wink.server.internal.log.ResourceInvocation.handleRequest(ResourceInvocation.java:92)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)\n\tat org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)\n\tat org.apache.wink.server.internal.log.Requests.handleRequest(Requests.java:76)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)\n\tat org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)\n\tat org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)\n\tat org.apache.wink.server.handlers.AbstractHandlersChain.run(AbstractHandlersChain.java:60)\n\tat org.apache.wink.server.internal.RequestProcessor.handleRequestWithoutFaultBarrier(RequestProcessor.java:207)\n\tat org.apache.wink.server.internal.RequestProcessor.handleRequest(RequestProcessor.java:154)\n\tat org.apache.wink.server.internal.servlet.RestServlet.service(RestServlet.java:124)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:668)\n\tat com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1285)\n\tat com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776)\n\tat com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:473)\n\tat com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1143)\n\tat com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4865)\n\tat com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:297)\n\tat com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:996)\n\tat com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:262)\n\tat com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:955)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)\n\tat java.lang.Thread.run(Thread.java:798)\n"}
Looks like an issue with the URL, Please check the AccessKey and context id!!
Here's my code (the same as in the tutorial except for the app specific parameters):
%AddJar https://github.com/ibm-watson-iot/predictive-analytics-samples/releases/download/0.0.3/IoTSparkAsServiceSample-3.0.0.jar -f
%AddJar https://github.com/sathipal/spark-streaming-mqtt-with-security_2.10-1.3.0/releases/download/0.0.1/spark-streaming-mqtt-security_2.10-1.3.0-0.0.1.jar -f
%AddJar http://central.maven.org/maven2/org/apache/wink/wink-json4j/1.4/wink-json4j-1.4.jar
%AddJar https://repo.eclipse.org/content/repositories/paho-releases/org/eclipse/paho/org.eclipse.paho.client.mqttv3/1.0.2/org.eclipse.paho.client.mqttv3-1.0.2.jar
%AddJar http://central.maven.org/maven2/org/apache/commons/commons-math/2.2/commons-math-2.2.jar
%AddJar http://repo1.maven.org/maven2/args4j/args4j/2.0.12/args4j-2.0.12.jar
import com.ibm.iot.iotspark.IoTSparkAsServiceSample
//Watson IoT Platform related parameters.
IoTSparkAsServiceSample.setConfig("appid","xxxx")
IoTSparkAsServiceSample.setConfig("uri","ssl://<org id>.messaging.internetofthings.ibmcloud.com:8883")
IoTSparkAsServiceSample.setConfig("mqtopic","iot-2/type/+/id/+/evt/accelerometer_events/fmt/+")
IoTSparkAsServiceSample.setConfig("apikey","xxxxxx")
IoTSparkAsServiceSample.setConfig("authtoken","xxxxxxx-")
// Predictive Service related parameters
IoTSparkAsServiceSample.setConfig("window","10")
IoTSparkAsServiceSample.setConfig("cycle","10")
IoTSparkAsServiceSample.setConfig("predictive-service-url","https://palbyp.pmservice.ibmcloud.com/pm/v1/score/BlueCarl?accesskey=xxxxxxxxxxxx")
IoTSparkAsServiceSample.startStreaming(sc, 4)
I've double checked the accesskey and context id (as stated by the error) and all other app specific parameters.
I found a post with a similar problem (link), indicating it's a problem with the message from Apache Spark not matching the input table name of the SPSS model. If so, how do you set the table name in Apache Spark?
Anyone knows how to solve this?
Thanks you in advance.
Answer by Rodney Vin (87) | Aug 17, 2016 at 08:15 PM
@theisnickelsen , I don't know the Spark part what you are using.
From perspective of Predictive Analytics, when you call "https://palbyp.pmservice.ibmcloud.com/pm/v1/score/BlueCarl?accesskey=xxxxxxxxxxxx", you need to send your data in your http request body, and request MIME type should be application/json, like this:
{
"tablename":"DRUG1n.sav", // this is the source node name in your modeler stream
"header":["Age", "Sex", "BP", "Cholesterol", "Na", "K", "Drug"], // column names in your source node
"data":[
[23.0, "F", "HIGH", "HIGH", 0.792535, 0.031258, "drugY"]
]
}
``
@Rodney if I want to call an API of a stream with two inputs (tablenames First.txt and second.txt). How can I do it ?
Answer by Infodation.HaiCao (28) | Jan 22, 2018 at 09:51 AM
I got this error IBM SPSS modeler Text mining Failed to score Hai4, msg=Failed to score:clemrtl_execute, details:java.lang.RuntimeException: Failed to score:clemrtl_execute at com.ibm.spss.internal.PredictiveScorerCSPImpl.score(PredictiveScorerCSPImpl.java:140) at com.ibm.spss.internal.SynchronizedPredictiveScorerCSPImpl.score(SynchronizedPredictiveScorerCSPImpl.java:71) at com.ibm.spss.internal.scorer.pool.PooledScorerImpl.score(PooledScorerImpl.java:100) at com.ibm.spss.blackbox.score.resource.ScoreUtil.score(ScoreUtil.java:203) at com.ibm.spss.blackbox.score.resource.ScoreResource.scoreWithInputdata(ScoreResource.java:69) at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:508) at org.apache.wink.server.internal.handlers.InvokeMethodHandler.handleRequest(InvokeMethodHandler.java:63) at org.apache.wink.server.handlers.AbstractHandler.handleRequest(AbstractHandler.java:33
How to get output from Apache Spark to input in a SPSS model? 0 Answers
SPSS GA Plan 3 Answers
Viewing a run-time plot of predictive vs actual values, against the regression line, in Bluemix 1 Answer
Predictive Analytics in Banking 1 Answer
Como faço para instalar o SPSS Modeler 64bits Trial? Está dando problema de autenticação. 1 Answer