Skip to main content
1-Visitor
September 25, 2017
Solved

Thingworx Analytics : How do fetch prediction score values and show on any mashup?

  • September 25, 2017
  • 2 replies
  • 2554 views

Hi,

 

I am following this video Analytics manager 7.4: Part 2 of 2. Configure Analysis Event, Real-Time Scoring  and Showing ThingWorx Analytics Manager's results (ThingPredictor) in a Mashup

 

I am attaching three screen shot which gives the graphical sequence of execution to determine predicted score value. Here property "condition" is my target value. And "datacollection" property is where my result of scoring will be persisted.

 

I have written below service code but no luck, I am not seeing any output.

 

var score = me.dataCollection.getRow(0).predictiveModelCollection.getRow(0).predictiveScore;

var tableLength = score.rows.length;

for(var x =0; x<tableLength; x++) {

    var row = score.rows;

    if(row.fieldName == "condition") {

        me.condition_predicted = row.fieldValue;

        x = tableLength;

    }

}

result = me.condition_predicted;

 

​Please do let me know, if I have done any mistake here.

 

Thanks,

Azim

Best answer by ahawaldar-2

Hi ,

My bad there were some issues in my code. After inserting logs I came to know and rectified it.

Thanks,

Azim

2 replies

1-Visitor
September 25, 2017

Below are the screens

1)

screen1.png

2)

screen2.png

3)

screen3.png

4)

screen4.png

20-Turquoise
September 25, 2017

Christophe MorfinNeel SampatJohn Greiner​ I  think this needs to be moved to Machine learning but it looks to be internal only.

13-Aquamarine
September 25, 2017

Hi Azim,

Are there any errors or warnings in your Application Log in ThingWorx?

Thanks,

John

ahawaldar-21-VisitorAuthorAnswer
1-Visitor
September 26, 2017

Hi ,

My bad there were some issues in my code. After inserting logs I came to know and rectified it.

Thanks,

Azim