LogoLogo
Log InSign UpHomepage
  • 👋Welcome
  • Account and Team Setup
    • Sign up
    • Subscription Plans
    • Profile information
    • Account information
    • Roles
    • Users
    • Tags
  • 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
    • Predict with ML Models
    • Overview and Model Health Check
    • Advanced parameters in ML Models
    • Actionable insights in 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
  3. Request v1

Body

JSON request structures for various models

The request body should be passed using the -d option in the cURL command. Replace [data] with the actual JSON-formatted content you want to send for prediction. The structure and required fields depend on the specific model’s configuration. (See the next section for details.)

The v1 request body uses a structured format built from nested arrays of objects. Each object represents a feature (column) and contains two keys:

  • "alias": the name of the input column as defined during model training

  • "selectedValue": the value you are submitting for prediction

This format is often used when data is being prepared manually or when values are mapped from UI elements.


v1 Example - Binary Classification / Multiclass Classification / Regression)

{
  "data": {
    "predict_values": [
      [
        { "alias": "Lead Source", "selectedValue": "bing" },
        { "alias": "Lead Origin", "selectedValue": "API" },
        { "alias": "Converted", "selectedValue": "YES" }
      ],
      [
        { "alias": "Lead Source", "selectedValue": "Google" },
        { "alias": "Lead Origin", "selectedValue": "Landing Page Submission" },
        { "alias": "Converted", "selectedValue": "YES" }
      ],
      [
        { "alias": "Lead Source", "selectedValue": "Olark Chat" },
        { "alias": "Lead Origin", "selectedValue": "API" },
        { "alias": "Converted", "selectedValue": "YES" }
      ]
    ]
  }
}

v1 Example (Timeseries)

{
  "data": {
    "predict_values": {
      "startDate": "2023-04-17",
      "endDate": "2023-04-18",
      "sequenceID": "A"
    }
  }
}

For time series forecasting, the structure differs from classification and regression models.

  • startDate and endDate: define the prediction period

  • sequenceID: identifies the specific time series to forecast (e.g., a product, store, or region)

JSON structure represents a data object with a key "data" mapping to an object called "predict_values". The "predict_values" object contains three key-value pairs. The required keys are "startDate", "endDate", and "sequenceID", and their corresponding values are "2025-04-17", "2025-04-18", and "A" respectively.

PreviousHeadersNextRequest v2

Last updated 1 day ago

Was this helpful?