Skip to main content
1-Visitor
June 22, 2021
Solved

Create analytics training service with value stream input

  • June 22, 2021
  • 1 reply
  • 3798 views

Hi, 

I have created a service that will:

  • Convert a value stream into an infotable (via QueryPropertyHistory)
  • Use CreateInfoTableFromDataShape (referencing AnalyticsDatasetRef and AnalyticsDatasetMetadata) to create another reference infotable that will append data from the original value stream infotable
  • Use the CreateJob() service from the Analytics_Server_Training_Thing to output a model ID using the reference infotable

I am able to output a model ID but when I run it through the GetJobInfo() service under the Training Thing it shows that my model fails.

Has anyone attempted to create a service that calls the Analytics_Server_Training_Thing, and if so, is there a key step I'm missing or any tips? Do I need to implement the CreateDatasetWithDatasetRef service from the Analytics Data Thing in order to get a dataURI? 

Thanks!

Best answer by cmorfin

Hi @RS_9963079 

 

Indeed one of the problem is that you do not have enough data, this is what the message tells us for the failed training job. It complains that all the goal value are identical, in fact here we have only one.

You need to add more data, I think a dozen can be enough and make sure the goal value differs between them.

 

Also regarding how to use the service, you can possibly check the following posts:

Analytics Services Examples  

or

How to work with ordinal and categorical data in ThingWorx Analytics ?

 

They provide sample and entities with services already created so you should be able to get inspiration from them.

 

Hope this helps

Kind regards

Christophe

 

1 reply

13-Aquamarine
June 22, 2021

Hi,

 

Can you share what error message you are getting in your ApplicationLog.log and ScriptLog.log when the error occurs?  Are there any errors returned when you query GetJobInfo() service on the jobID?  Knowing what errors are occurring will help us better understand the issue.

 

Warm Regards,

 

John

1-Visitor
June 22, 2021

Can you tell me how I can access the Application and Script logs? I'm new to ThingWorx and have not been able to locate them. 

I've attached the errors I receive when executing the service and when running getJobInfo.

When I click on datasetRef in the getJobInfo() service it appears as if no data has been stored there, but if I print

var result = datasetRef in my service and set the output to INFOTABLE, I am able to see my data. 

19-Tanzanite
June 22, 2021

@RS_9963079 

 

You wrote that  you can see the data when you use

var result = datasetRef

Could you please post the data you are see ?

Also could you post the call of the CreateJob service with the input parameters, especially the goal.

 

Thanks

Christophe