cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Upload PMML to Thingworx Analytics

No ratings

Here is a tutorial to explain the process of uploading a PMML file from an external system to Thingworx Analytics. The tutorial steps are explained in the attached PDF and all referenced files can be found in the attached ZIP.

 

image

Comments

Here is an updated version of the PDF and XML with some additional troubleshooting.

Hello,

 

I am trying to follow the PDF but I am facing few issues. Would you please like to help me? I am using ThingWorx 9.0.0-b9557.

 

1. When I click generate model, I don't see any error and model ID is returned to me. But I don't see any model anywhere. Neither under Analytics builder > Model nor at Analytics Manager > Analytics Model. Same issue is occurring when I am directly using the service in system.

2. When I am clicking on Predict result I am seeing below error:
"Error executing service predictUptake. Message :: TypeError: Cannot read property "rows" from undefined" 

  1. Request Method:
    POST
  2. Status Code:
    500 ( Which mean model is not reachable)


Now I tried to upload the PMML model manually as per attached screen, everything works fine. Can you please help me understand why is this happening?

 

Regards

Shyam

Hello,

 

1) You cannot see a model anywhere

This is normal, a prediction model that is uploaded through the API is not accessible through Analytics Builder, only through the API.

 

2) Predict Result failing

This could be because the result datashape from service RealtimeScore changed between v8.x and v9.0. Please replace your service code for co2.Helper > predictUptake with the attached code and retry. If you read the attached code you will see the changed result datashape - v8.x commented out on line 43 and v9.0 used on line 45.

 

I hope that helps. Best regards, Tanveer.

Thanks That is working now. Now I am facing an issue with another PMML file which is developed in Python R model. I am not able to generate the desired output. The job remain in "waiting" state and behind the scene it is throwing error. I don't understand the reason behind it. Below is the error detail:

1. Error occured in executeJob: null

2. Failed to execute job: {CompressSerializedIO=com.thingworx.types.primitives.BooleanPrimitive@4d5, isAsync=com.thingworx.types.primitives.BooleanPrimitive@4d5, IsReplayJob=com.thingworx.types.primitives.BooleanPrimitive@4d5, resourceServiceProvider=ServerAnalysisProvider, inputParams=com.thingworx.types.primitives.InfoTablePrimitive@4e6047fc, SerializeIODataStructure=com.thingworx.types.primitives.BooleanPrimitive@4cf, InputURI=/Thingworx/FileRepositories/ServerAnalysisProviderFileRepository/98c15d58-324d-49a0-94f0-9e6370af3cb4/IOFiles/ServerAnalysisProvider.IsolationForestAnamolySK.usO3AInputParamsDataShape, resourceName=IsolationForestAnamolySK, source=shyamS, jobCreateTimestamp=com.thingworx.types.primitives.DatetimePrimitive@c7c12d55, jobStartTimestamp=com.thingworx.types.primitives.DatetimePrimitive@c7c12d55, isContinuous=com.thingworx.types.primitives.BooleanPrimitive@4d5, Id=98c15d58-324d-49a0-94f0-9e6370af3cb4, key=98c15d58-324d-49a0-94f0-9e6370af3cb4, timestamp=com.thingworx.types.primitives.DatetimePrimitive@c7c12d36, status=WAITING}

 

Thanks for that. So I understand that you are able to confirm in your system the general principle of import a PMML model, however for your specific PMML file it does not work. Is that correct? If so, please could you send me the following details:

 

- ThingWorx Analytics version

- PMML version

- Method by which you exported the PMML (from Python / R?)

- Copy of the PMML file

- (Optional) Any test data you have matching the PMML model

Hi,

 

Please find my details below:

 

- ThingWorx Analytics version  - 9.0

- PMML version - 4.3

- Method by which you exported the PMML (from Python / R?) - Python Isolation forest model converted to PMML using SKLearn2pmml version 0.55.

- Copy of the PMML file - You got it attached

- (Optional) Any test data you have matching the PMML model - you got it attached

 

Regards

Shyam

Version history
Last update:
‎Feb 08, 2019 05:43 PM
Updated by:
Attachments