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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Thingworx Analytics 8.3.1 Mapping Inputs to an Analysis Event with a Set Lookback Period

jbester
13-Aquamarine

Thingworx Analytics 8.3.1 Mapping Inputs to an Analysis Event with a Set Lookback Period

Hi All,

 

We have put together a similar demo as PTC did at the 2018 LiveWorx conference with predicting the time to failure of a light bulb using ThingWorx Analytics. We have created the time series model and have managed to train the model,  publish the model and test the model in Analytics Manager. 

 

The issue we are facing now is when creating an Analysis Event mapping the input parameters that takes into account the lookback period? I tried creating an infotable property that has the correct amount of rows with the correct fields, but I get an error: "Unable to set value for AnalyticsEventInput". (AnalyticsEventInput is the infotable with the correct number of rows for the lookback period). The job runs, but the input to the Analytics job is as below with only the last row being set to the first row of the infotable property:SinglePropertyMapping Input.png

 

I have also mapped the inputs directly to the related "Number" type properties, but that has also given me issues that all of the rows have the same values.

 

I have gone through a lot of informational sources on Analytics but haven't been able to find one that describes how the input to the analytics event should be for a time series model with a set lookback period. 

 

Any guidance would be appreciated.

 

Kind regards,

Johan Bester

1 ACCEPTED SOLUTION

Accepted Solutions
jbester
13-Aquamarine
(To:jbester)

 

@cmorfin helped us get to a solution to our issue. The issue was an understanding issue on how the lookback values are fed when an analytics event is fired for time series data. The short of it is that for the time series based analytics events you still do a flat mapping (not an infotable property) of a property to the input of the analytics event. When the event is fired the respective property's history is then taken and the time interval, defined in your model and in your temporal field in your json file, is used to automatically (based on timestamp) do the lookback to the relevant number of time intervals as defined.

 

 

View solution in original post

2 REPLIES 2
cmorfin
19-Tanzanite
(To:jbester)

Hi @jbester

 

Interesting indeed.

There is a demo in the help center that does just that but looking closer into it , it does exhibit the similar behaviour as you are seeing, so something is not quite right. That will need a bit more digging offline.

 

However you should also be able to achieve your goal without using the Analytics Manager framework but using the PredictiveThing.RealTimeScore or BatchScore service directly.

That would require some more coding though.

https://community.ptc.com/t5/IoT-Tech-Tips/Analytics-Prediction-Methods-Mashup/m-p/570921 has got an example of calling RealtimeScore or BatchScore with data from an infotable in ConcreteHelper thing, service predictStrength and predictStrencthBatch

 

Hope this helps

Kind regards

Christophe

 

 

jbester
13-Aquamarine
(To:jbester)

 

@cmorfin helped us get to a solution to our issue. The issue was an understanding issue on how the lookback values are fed when an analytics event is fired for time series data. The short of it is that for the time series based analytics events you still do a flat mapping (not an infotable property) of a property to the input of the analytics event. When the event is fired the respective property's history is then taken and the time interval, defined in your model and in your temporal field in your json file, is used to automatically (based on timestamp) do the lookback to the relevant number of time intervals as defined.

 

 

Top Tags