LogoLogo
Log InSign UpHomepage
  • 👋Welcome
  • Account and Team Setup
    • Sign up
    • Subscription Plans
    • Profile information
    • Account information
    • Roles
    • Users
    • Tags
    • Logs
  • FAQ
  • UNDERSTANDING MACHINE LEARNING
    • What is Graphite Note?
      • Graphite Note Insights Lifecycle
    • Introduction to Machine Learning
      • What is Machine Learning
      • Data Analitycs Maturity
    • Machine Learning concepts
      • Key Drivers
      • Confusion Matrix
      • Supervised vs Unsupervised ML
  • Demo datasets
    • Demo Datasets
      • Ads
      • Churn
      • CO2 Emission
      • Diamonds
      • eCommerce Orders
      • Housing Prices
      • Lead Scoring
      • Mall Customers
      • Marketing Mix
      • Car Sales
      • Store Item Demand
      • Upsell
    • What Dataset do I need for my use case?
      • Predict Cross Selling: Dataset
      • Predict Customer Churn: Dataset
      • Predictive Lead Scoring: Dataset
      • Predict Revenue : Dataset
      • Product Demand Forecast: Dataset
      • Predictive Ads Performance: Dataset
      • Media Mix Modeling (MMM): Dataset
      • Customer Lifetime Value Prediction : Dataset
      • RFM Customer Segmentation : Dataset
    • Dataset examples - from online sources
      • Free datasets for Machine Learning
  • Datasets
    • Introduction
    • Prepare your Data
      • Data Labeling
      • Expanding datasets
      • Merging datasets
      • CSV File creating and formatting
    • Data sources in Graphite Note
      • Import data from CSV file
        • Re-upload or append CSV
        • CSV upload troubleshooting tips
      • MySQL Connector
      • MariaDB Connector
      • PostgreSQL Connector
      • Redshift Connector
      • Big Query Connector
      • MS SQL Connector
      • Oracle Connector
  • Models
    • Introduction
    • Preprocessing Data
    • Machine Learning Models
      • Timeseries Forecast
      • Binary Classification
      • Multiclass Classification
      • Regression
      • General Segmentation
      • RFM Customer Segmentation
      • Customer Lifetime Value
      • Customer Cohort Analysis
      • ABC Pareto Analysis
      • New vs Returning Customers
    • Advanced ML model settings
      • Actionable insights
      • Advanced parameters
      • Model Overview
      • Regressors
      • Model execution logs
    • Predict with ML Models
    • Improve your ML Models
  • Notebooks
    • What is Notebook?
    • My first Notebook
    • Data Visualization
  • REST API
    • API Introduction
    • Dataset API
      • Create
      • Fill
      • Complete
    • Prediction API
      • Request v1
        • Headers
        • Body
      • Request v2
        • Headers
        • Body
      • Response
      • Usage Notes
    • Model Results API
      • Request
        • Headers
        • Body
      • Response
      • Usage Notes
      • Code Examples
    • Model Info API
      • Request
        • Headers
        • Body
      • Response
      • Usage notes
      • Code Examples
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. REST API
  2. Prediction API

Response

Receiving a response

Status Code:

200 OK (on successful retrieval)

You will receive a response containing the prediction results or any relevant information based on the model and data provided. The format and structure of the response will vary depending on the specific model and endpoint used.


Response (Binary Classification, Multiclass Classification, Regression)

The following models have similar JSON structure: Binary Classification, Multiclass Classification, Regression.

{
    "data": {
        "columns": [
            "Total Time Spent on Website",
            "Lead Origin",
            "Lead Source"
        ],
        "data": [
            {
                "Label": "NO",
                "Lead Origin": "API",
                "Lead Source": "bing",
                "Score_NO": 0.935,
                "Score_YES": 0.065,
                "Total Time Spent on Website": "1"
            },
            {
                "Label": "NO",
                "Lead Origin": "Lead Import",
                "Lead Source": "bing",
                "Score_NO": 0.8955,
                "Score_YES": 0.1045,
                "Total Time Spent on Website": "153"
            }
        ]
    }
}

The JSON structure consists of a root object with a key-value pair, where the key is "data" and the value is an object containing two keys: "columns" and "data".

  1. "data": This key maps to an array of data objects. Each data object within the array represents a specific entry or prediction result. In this example, there are two data objects.

    • Each data object contains key-value pairs representing the column names and their corresponding values. For example, the first data object has the values "NO", "API", "bing", 0.935, 0.065, and "1" for the keys "Label", "Lead Origin", "Lead Source", "Score_NO", "Score_YES", and "Total Time Spent on Website", respectively.

    • The second data object follows a similar pattern, with different values for each key.

A "Score_NO": 0.8955 means 89.55% probability that the prediction is "NO."
At the same time, "Score_YES": 0.1045 means 10.45% probability that the prediction is "YES".
  1. "columns": This key maps to an array of column names. In this example, the array contains three column names: "Total Time Spent on Website", "Lead Origin", and "Lead Source". These column names define the fields or attributes associated with each data entry.


Response (Timeseries)

{
    "data": [
        {
            "date": "2023-04-17T00:00:00.000Z",
            "predicted": 40.4385672276
        },
        {
            "date": "2023-04-18T00:00:00.000Z",
            "predicted": 41.1831442568
        },
        {
            "sequenceID": "A"
        }
    ]
}

The JSON structure consists of a root object with a key-value pair, where the key is "data" and the value is an array. The array contains three elements representing different pieces of information. Last element in data array(sequenceID) is directly related to "sequenceID" sent in request, and the number of other elements depends on date difference sent in request.

  1. "date" and "predicted": The first two elements within the "data" array represent specific dates and their corresponding predicted values. Each element is an object with two key-value pairs: "date" and "predicted". The "date" represents a specific date and time in ISO 8601 format, and the "predicted" holds the corresponding predicted value for that date. In the given example, the predicted values for the dates "2023-04-17T00:00:00.000Z" and "2023-04-18T00:00:00.000Z" are 40.4385672276 and 41.1831442568, respectively.

  2. "sequenceID": The third element within the "data" array represents the sequence ID. It is an object with a single key-value pair: "sequenceID" and its corresponding value. In this example, the sequence ID is represented as "A". If your dataset includes multiple time series sequences, you should choose a field that uniquely identifies each sequence (e.g., product ID, store ID, etc.). This will allow Graphite Note to generate independent forecasts for each individual time series. We don't allow fields with too many sequences (unique values) here.

This JSON structure is used to convey the predicted values for different dates in a Timeseries model. Each date is associated with its predicted value, and the sequence ID provides additional context or identification for the timeseries data.

This is a Timeseries period prediction example:

{
    "data": [
        {
            "date": "2020-04-01T00:00:00.000Z",
            "predicted": 46.5706123613
        },
        {
            "date": "2020-04-02T00:00:00.000Z",
            "predicted": 46.810341005300003
        },
        {
            "sequenceID": "n/a"
        }
    ]
}

The response contains a single key-value pair:

  • "data": The key "data" maps to an array of objects that represents the prediction results or relevant information.

Make sure to handle the response appropriately in your code to process the prediction results or handle any potential errors returned by the API. More about structure on next section.

PreviousBodyNextUsage Notes

Last updated 21 days ago

Was this helpful?