Predictive Analytics

29 Sep 20161 minute to read

URL

  • JAVASCRIPT
  • http://js.syncfusion.com/demos/ejservices/api/PredictiveAnalytics/PostAnalyticsAction

    Parameter

    Parameter Data type Description
    data
    JSON Input data table in the JSON format.
    pmmlFile
    String PMML file name with extension.
    List of PMML files shipped within the EJ services are as follows:
    * Groceries.pmml * Glass.pmml * Bfeed.pmml * Audit.pmml * Cars.pmml * Wine.pmml * BreastCancer.pmml * Imports.pmml * Iris.pmml * Tips.pmml * Ozone.pmml * Titanic.pmml
    name(Model name)
    String Model name.
    List of model names supported within the EJ services are as follows:
    * AssociationRules * Clustering * CoxRegression * GeneralRegression * GradientBoosting * MultinomialRegression * NaiveBayes * NeuralNetworks * RandomForest * Regression * SupportVectorMachine * TreeModel

    NOTE

    Here, the PMML files are already available within the hosted ‘EJServices’. In order to call the web API with the given URL, we need to give HTTP POST request with parameters - input data, PMML file name already available in the services and name of the model used in the PMML file.

    HTTP Response

    Response Code

  • JAVASCRIPT
  • 200

    Headers

  • JAVASCRIPT
  • contentType: "application/json; charset=utf-8"

    Result

    Below are the sample results for respective model category.

    Result Model Category
    "[{
    "transactionID":1,
    "items":"{citrus fruit,semi-finished bread,margarine,ready soups}",
    "Recommendation":"[whole milk,rolls/buns,other vegetables,yogurt]",
    "Exclusive_Recommendation":"[whole milk,rolls/buns,other vegetables,yogurt]",
    "Rule_Association":"[]"
    }]"
    Association Rules
    "[{
    "RI":-0.16,
    "Na":12.68,
    "Mg":3.67,
    "Al":1.16,
    "Si":73.11,
    "K":0.61,
    "Ca":8.7,
    "Ba":0,
    "Fe":0,
    "type":"WinF",
    "Predicted_Cluster":"5"
    }]"
    Clustering
    "[{
    "total_bill":16.99,
    "tip":1.01,
    "sex":"Female",
    "smoker":"No",
    "day":"Sun",
    "time":"Dinner",
    "size":2,
    "Predicted_TipAmount":2.6535990649137218
    }]"
    Regression
    "[{
    "pclass":"1st",
    "survived":"survived",
    "sex":"female",
    "age":29,
    "sibsp":0,
    "parch":0,
    "Predicted_survived":"survived",
    "PassengerDiedProbability":0.184615384615385,
    "PassengerSurvivedProbability":0.815384615384615
    }]"
    Classification