2 Replies Latest reply on Sep 26, 2017 11:36 PM by ahawaldar-2 RSS
    ahawaldar-2 Explorer

    How do I send values for data property of thing created Using ThingPredictor and Model in Thingworx?

    Hi,

     

    I created a thing using CreateOrUpdateThingTemplateForModel service of TW.AnalysisServices.ModelManagementServicesAPI resource. After mapping properties in thingworx analytics manager I see few properties like goalName,causalTechnique,data,dataCollection,importantFieldCount,key . Now I am able to test the prediction scoring feature by setting values in "data" property manually. These values are being sent to thingworx analytics manager and I see the predicted values in dataCollection property.


    My question is how do I set the values in data property so that these values are sent to thingworx analytics manager. Is there any service to do so?


    I manually created a service as below but no luck as these values were not sent to thingworx analytics manager. Please help me to understand this. Appreciate your help.


    var params = { 

      infoTableName : "InfoTable", 

      dataShapeName : "ThingPredictor.bearing_data_Condition_417.InputParamsdataDataShape" 

    }; 

    var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);

    var newEntry = new Object();

    newEntry._B1 = 131.73;

    newEntry._B2 = 167.94;

    newEntry._B3 = 350.01;

    newEntry._B4 = 561.75;

    newEntry._B5 = 267.51;

    newEntry._B6 = 349.78;

    newEntry._B7 = 130.8;

    newEntry._B8 = 29.01;

    newEntry._condition = 0;

    newEntry.key = 0;

    logger.warn("Created info table");

    result.AddRow(newEntry);

     

    // setting the property data

    me.data = result;