Digital Developer Conference: a FREE half-day online conference focused on AI & Cloud – North America: Nov 2 – India: Nov 9 – Europe: Nov 14 – Asia Nov 23 Register now

Close outline
  • United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.195

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

Is the ReST query, provided in Predictive Modeling, to return predictive analytics with score result, correct?

2000000VST gravatar image
Question by Amit M Mangalvedkar  (1199) | Jun 25, 2015 at 04:29 AM spssibmcloudpredictive-modeling

I have been trying to make use of the ReST query example provided in the Predictive Modeling service API. However, although the following 2 ReST queries seem to work

  1. Retrieving a list of all currently deployed models

  2. Downloading a copy of a specific deployed model file

This one
1. Scoring with a deployed predictive model

throws the following error

 "message": "Failed to score Drug1n, msg=ERROR: Missing required input table [scoreInput], details:java.lang.RuntimeException: ERROR: Missing required input table [scoreInput]\n\tat com.ibm.spss.internal.PredictiveScorerCSPImpl$InputIterator.setInputData(PredictiveScorerCSPImpl.java:276)\n\tat com.ibm.spss.internal.PredictiveScorerCSPImpl.score(PredictiveScorerCSPImpl.java:120)\n\tat com.ibm.spss.internal.SynchronizedPredictiveScorerCSPImpl.score(SynchronizedPredictiveScorerCSPImpl.java:68)\n\tat

I have used the exact same POST request (https://ibmpmsrvus2.pmservice.ibmcloud.com:8443/pm/v1/score/Drug1n?accesskey=MASKED=) with the specified JSON request

 {
     "tablename": "DRUG1n.sav",
     "header": [
         "Age",
         "Sex",
         "BP",
         "Cholesterol",
         "Na",
         "K",
         "Drug"
     ],
     "data": [
         [
             43,
             "M",
             "LOW",
             "NORMAL",
             0.526102,
             0.027164,
             "drugY"
         ]
     ]
 }

as provided in the documentation.
Is the JSON request right? Or is there any other parameter to be entered?

Thanks and Regards
Amit M Mangalvedkar

People who like this

  0
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

2 answers

  • Sort: 
120000QUDN gravatar image
Accepted answer

Answer by JDThorson (141) | Jun 25, 2015 at 07:32 AM

You would not normally pass the 'target' of the prediction in the scoring input so the 'Drug' attribute as passed is not necessary. Please check your 'tablename' to make sure it matches that of the source node on the scoring branch 'marked' in the Modeler stream you have deployed. The error states that the source node (input tablename) is 'scoreInput' and you have specified 'Drug1n.save' in your JSON.

Comment
Amit M Mangalvedkar

People who like this

  1   Show 1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
2000000VST gravatar image Amit M Mangalvedkar (1199)   Jun 25, 2015 at 08:03 AM 0
Share

@JDThorson
Thanks a lot for the quick reply. That helped and I was able to get a positive response. I feel that the documentation needs to be slightly modified.

Thanks and Regards
Amit M Mangalvedkar

120000QUDN gravatar image

Answer by JDThorson (141) | Jun 25, 2015 at 08:02 AM

I will check for the typo in the documentation. The tablename should be 'scoreInput' as mentioned in the error returned.

In the NodeJS sample code this is specified as follows, reads close enough to JSON to help...

     var input = {
         tablename: 'scoreInput',
         header: [ 'Age',    'Sex', 'BP', 'Cholesterol', 'Na', 'K' ],
         data: [[ p.Age, p.Sex, p.BP, p.Cholesterol, p.Na, p.K ]]
     };
Comment

People who like this

  0   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

Follow this question

61 people are following this question.

Answers

Answers & comments

Related questions

Watson Machine Learning - Can't deploy model generated by SPSS Modeler 18 1 Answer

How to use IBM SPSS Modeler in Bluemix? 3 Answers

Watson Machine Learning - Missing input table: trainingInput 3 Answers

Dynamic Input Data (Batch Job API) 0 Answers

Multiple input tables for REST query 2 Answers

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • Data and AI
  • DataPower
  • Decision Optimization
  • DevOps Build
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • Hyper Protect
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PartnerWorld Developer Support
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges