Skip to main content
14-Alexandrite
September 27, 2018

Prescriptions Mashup for Thingworx Analytics

  • September 27, 2018
  • 3 replies
  • 15625 views

I have created a mashup which allows you to easily use and test the Prescriptions functionality in Thingworx Analytics (TWA). This is where you choose 1 or more fields for optimization, and TWA tells you how to adjust those fields to get an optimal outcome.

 

The functionality is based on a public sample dataset for concrete mixtures, full details are included in the attached documentation.

 

image

3 replies

1-Visitor
May 27, 2019

Can you help to explain the id fielfs amd lever fields in the function prescribeStrength() and how they are populated

tsaifee-214-AlexandriteAuthor
14-Alexandrite
May 27, 2019

Hi, I think the Lever fields are important but the Id fields are probably not (you could test the results with excluding the Id fields, i.e. removing parameter identifierFields: idFields from the call to RealtimeScore).

 

The Lever fields are populated due to an infotable called leverSelection which is passed in as an input from the mashup when the service is called. These are the fields which the user has selected in the list using multi-select. So for example if you highlight fields Age and FineAggregate, then these become the levers and Thingworx Analytics (TWA) will optimise these values to maximise (as per the call to RealtimeScore) the goal field which is CompressiveStrength. TWA will return the optimal settings for Age and FineAggregate (in this example), which are displayed on the mashup. If I remember correctly, theoretically the values shown for Age and FineAggregate aren't necessarily the optimal values but in practise usually they should be.

14-Alexandrite
June 24, 2019

Hi,

 

Thank you very much for this demo, since I have found no other source for prescriptive analytics helpful like this.

 

I tried to duplicate all the entities you created and use it in my project, but at the end I get this message below when I run the "PredictStrength" service:

" Error executing service PredictStrength. Message :: Error returned from service [500]: Failed to score: Unable to retrieve results at results:/models/nq2019_NQ2019Model_46eba09a-2e88-4b1d-8994-48f0d7a1820a. Received response: {"code":404,"message":"Could not retrieve result [nq2019_NQ2019Model_46eba09a-2e88-4b1d-8994-48f0d7a1820a]"} - See Script Error Log for more details."

 

Can you help me on this? Thanks in advance.

 

 

tsaifee-214-AlexandriteAuthor
14-Alexandrite
June 24, 2019

Thanks. Am I correct in understanding that you are able to make the provided demo work, but when you try and port the code to your application/entities then it fails? If that's the case, please could you export your entities and attach them here so I can test them?

14-Alexandrite
June 24, 2019

Yes, you are correct. Your demo worked. But I tried both predictStrenght and prescribeStrength but got same error. TWX files and the model is attached. Goal is T1401.

5-Regular Member
February 22, 2021

Hi tsaifee-2,

 

This is an excellent example for reference. I tried to port it into ThingWorx 9.1 but found errors. I believe I may need to revise the scripts in somewhere. Attached please find the syndromes. 

 

Can you please help to check? Thanks!

15-Moonstone
February 22, 2021

Hi,

 

Just make sure, you have "ServerName-AnalyticsServer_PrescriptiveThing" connected in your system or you don't have any other things created under "PrescriptiveMicroserver" template.

 

Regards

Shyam

5-Regular Member
February 22, 2021

Hi Shyam,

 

I simply followed the manual attached to the project and did not create any extra thing.

 

The project works well in ThingWorx 8.5.7 but does not in ThingWorx 9.0+. I am wondering whether anything has been changed in ThingWorx 9.1. Thanks.

 

Regards,

Jianping