4 Replies Latest reply on Sep 25, 2017 11:29 PM by ahawaldar-2 RSS
    ahawaldar-2 Newbie

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

    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[x];

        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