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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Create analytics training service with value stream input

RS_9963079
7-Bedrock

Create analytics training service with value stream input

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!

ACCEPTED SOLUTION

Accepted Solutions
cmorfin
19-Tanzanite
(To:RS_9963079)

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

 

View solution in original post

6 REPLIES 6
jgreiner
13-Aquamarine
(To:RS_9963079)

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

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. 

cmorfin
19-Tanzanite
(To:RS_9963079)

@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

For the result.png, I notice that datasetref does not have a datasetURI, format, etc. which I usually manually input when calling the CreateJob service from the training thing directly- do I need to use CreateDatasetWithDatasetRef in the Data Thing in order to get that datasetURI and somehow add that to datasetref?

 

I'm trying to predict MotorRPM based on the Distance variable- my data set is only 2 points at the moment in order to get proof of concept- not sure if the lack of data will affect the training.

 

For the CreateJob, I wasn't sure if the goalField was just the name of the goal variable, or if I needed to create a separate property just for the goal. 

Thanks!!

cmorfin
19-Tanzanite
(To:RS_9963079)

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

 

Thank you so much for the info and the analytics services examples files- exactly what I needed!!!!!!!

Announcements


Top Tags