Start a Forecaster training job
curl --request POST \
--url https://api.omnifuel.ai/v1/forecaster \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"dataset": "https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv",
"dataset_format": "csv",
"time_column": "time",
"target_columns": [
"target"
],
"past_covariates": [],
"future_covariates": [],
"static_covariates": [],
"group_columns": [
"group"
],
"holidays": [],
"datetime_attributes": [],
"lags": 30,
"lags_past_covariates": 7,
"lags_future_covariates": [
2
],
"num_leaves": 50,
"learning_rate": 0.05,
"num_iterations": 200,
"test_size": 0.2,
"test_sample_over": "time",
"min_data_in_leaf": 20,
"max_depth": -1,
"max_bin": 255,
"output_chunk_length": 1
}
'import requests
url = "https://api.omnifuel.ai/v1/forecaster"
payload = {
"dataset": "https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv",
"dataset_format": "csv",
"time_column": "time",
"target_columns": ["target"],
"past_covariates": [],
"future_covariates": [],
"static_covariates": [],
"group_columns": ["group"],
"holidays": [],
"datetime_attributes": [],
"lags": 30,
"lags_past_covariates": 7,
"lags_future_covariates": [2],
"num_leaves": 50,
"learning_rate": 0.05,
"num_iterations": 200,
"test_size": 0.2,
"test_sample_over": "time",
"min_data_in_leaf": 20,
"max_depth": -1,
"max_bin": 255,
"output_chunk_length": 1
}
headers = {
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
dataset: 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv',
dataset_format: 'csv',
time_column: 'time',
target_columns: ['target'],
past_covariates: [],
future_covariates: [],
static_covariates: [],
group_columns: ['group'],
holidays: [],
datetime_attributes: [],
lags: 30,
lags_past_covariates: 7,
lags_future_covariates: [2],
num_leaves: 50,
learning_rate: 0.05,
num_iterations: 200,
test_size: 0.2,
test_sample_over: 'time',
min_data_in_leaf: 20,
max_depth: -1,
max_bin: 255,
output_chunk_length: 1
})
};
fetch('https://api.omnifuel.ai/v1/forecaster', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.omnifuel.ai/v1/forecaster",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dataset' => 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv',
'dataset_format' => 'csv',
'time_column' => 'time',
'target_columns' => [
'target'
],
'past_covariates' => [
],
'future_covariates' => [
],
'static_covariates' => [
],
'group_columns' => [
'group'
],
'holidays' => [
],
'datetime_attributes' => [
],
'lags' => 30,
'lags_past_covariates' => 7,
'lags_future_covariates' => [
2
],
'num_leaves' => 50,
'learning_rate' => 0.05,
'num_iterations' => 200,
'test_size' => 0.2,
'test_sample_over' => 'time',
'min_data_in_leaf' => 20,
'max_depth' => -1,
'max_bin' => 255,
'output_chunk_length' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.omnifuel.ai/v1/forecaster"
payload := strings.NewReader("{\n \"dataset\": \"https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv\",\n \"dataset_format\": \"csv\",\n \"time_column\": \"time\",\n \"target_columns\": [\n \"target\"\n ],\n \"past_covariates\": [],\n \"future_covariates\": [],\n \"static_covariates\": [],\n \"group_columns\": [\n \"group\"\n ],\n \"holidays\": [],\n \"datetime_attributes\": [],\n \"lags\": 30,\n \"lags_past_covariates\": 7,\n \"lags_future_covariates\": [\n 2\n ],\n \"num_leaves\": 50,\n \"learning_rate\": 0.05,\n \"num_iterations\": 200,\n \"test_size\": 0.2,\n \"test_sample_over\": \"time\",\n \"min_data_in_leaf\": 20,\n \"max_depth\": -1,\n \"max_bin\": 255,\n \"output_chunk_length\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.omnifuel.ai/v1/forecaster")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset\": \"https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv\",\n \"dataset_format\": \"csv\",\n \"time_column\": \"time\",\n \"target_columns\": [\n \"target\"\n ],\n \"past_covariates\": [],\n \"future_covariates\": [],\n \"static_covariates\": [],\n \"group_columns\": [\n \"group\"\n ],\n \"holidays\": [],\n \"datetime_attributes\": [],\n \"lags\": 30,\n \"lags_past_covariates\": 7,\n \"lags_future_covariates\": [\n 2\n ],\n \"num_leaves\": 50,\n \"learning_rate\": 0.05,\n \"num_iterations\": 200,\n \"test_size\": 0.2,\n \"test_sample_over\": \"time\",\n \"min_data_in_leaf\": 20,\n \"max_depth\": -1,\n \"max_bin\": 255,\n \"output_chunk_length\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omnifuel.ai/v1/forecaster")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset\": \"https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv\",\n \"dataset_format\": \"csv\",\n \"time_column\": \"time\",\n \"target_columns\": [\n \"target\"\n ],\n \"past_covariates\": [],\n \"future_covariates\": [],\n \"static_covariates\": [],\n \"group_columns\": [\n \"group\"\n ],\n \"holidays\": [],\n \"datetime_attributes\": [],\n \"lags\": 30,\n \"lags_past_covariates\": 7,\n \"lags_future_covariates\": [\n 2\n ],\n \"num_leaves\": 50,\n \"learning_rate\": 0.05,\n \"num_iterations\": 200,\n \"test_size\": 0.2,\n \"test_sample_over\": \"time\",\n \"min_data_in_leaf\": 20,\n \"max_depth\": -1,\n \"max_bin\": 255,\n \"output_chunk_length\": 1\n}"
response = http.request(request)
puts response.read_body{
"message": "Training job started successfully",
"id": "abc1234-5678-9101-1121-314151617181"
}{
"message": "Error starting training job",
"error": true
}Forecaster
Train a Forecaster Model
Initiates a Forecaster training job with the specified dataset and model configuration parameters.
POST
/
forecaster
Start a Forecaster training job
curl --request POST \
--url https://api.omnifuel.ai/v1/forecaster \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"dataset": "https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv",
"dataset_format": "csv",
"time_column": "time",
"target_columns": [
"target"
],
"past_covariates": [],
"future_covariates": [],
"static_covariates": [],
"group_columns": [
"group"
],
"holidays": [],
"datetime_attributes": [],
"lags": 30,
"lags_past_covariates": 7,
"lags_future_covariates": [
2
],
"num_leaves": 50,
"learning_rate": 0.05,
"num_iterations": 200,
"test_size": 0.2,
"test_sample_over": "time",
"min_data_in_leaf": 20,
"max_depth": -1,
"max_bin": 255,
"output_chunk_length": 1
}
'import requests
url = "https://api.omnifuel.ai/v1/forecaster"
payload = {
"dataset": "https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv",
"dataset_format": "csv",
"time_column": "time",
"target_columns": ["target"],
"past_covariates": [],
"future_covariates": [],
"static_covariates": [],
"group_columns": ["group"],
"holidays": [],
"datetime_attributes": [],
"lags": 30,
"lags_past_covariates": 7,
"lags_future_covariates": [2],
"num_leaves": 50,
"learning_rate": 0.05,
"num_iterations": 200,
"test_size": 0.2,
"test_sample_over": "time",
"min_data_in_leaf": 20,
"max_depth": -1,
"max_bin": 255,
"output_chunk_length": 1
}
headers = {
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
dataset: 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv',
dataset_format: 'csv',
time_column: 'time',
target_columns: ['target'],
past_covariates: [],
future_covariates: [],
static_covariates: [],
group_columns: ['group'],
holidays: [],
datetime_attributes: [],
lags: 30,
lags_past_covariates: 7,
lags_future_covariates: [2],
num_leaves: 50,
learning_rate: 0.05,
num_iterations: 200,
test_size: 0.2,
test_sample_over: 'time',
min_data_in_leaf: 20,
max_depth: -1,
max_bin: 255,
output_chunk_length: 1
})
};
fetch('https://api.omnifuel.ai/v1/forecaster', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.omnifuel.ai/v1/forecaster",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dataset' => 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv',
'dataset_format' => 'csv',
'time_column' => 'time',
'target_columns' => [
'target'
],
'past_covariates' => [
],
'future_covariates' => [
],
'static_covariates' => [
],
'group_columns' => [
'group'
],
'holidays' => [
],
'datetime_attributes' => [
],
'lags' => 30,
'lags_past_covariates' => 7,
'lags_future_covariates' => [
2
],
'num_leaves' => 50,
'learning_rate' => 0.05,
'num_iterations' => 200,
'test_size' => 0.2,
'test_sample_over' => 'time',
'min_data_in_leaf' => 20,
'max_depth' => -1,
'max_bin' => 255,
'output_chunk_length' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.omnifuel.ai/v1/forecaster"
payload := strings.NewReader("{\n \"dataset\": \"https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv\",\n \"dataset_format\": \"csv\",\n \"time_column\": \"time\",\n \"target_columns\": [\n \"target\"\n ],\n \"past_covariates\": [],\n \"future_covariates\": [],\n \"static_covariates\": [],\n \"group_columns\": [\n \"group\"\n ],\n \"holidays\": [],\n \"datetime_attributes\": [],\n \"lags\": 30,\n \"lags_past_covariates\": 7,\n \"lags_future_covariates\": [\n 2\n ],\n \"num_leaves\": 50,\n \"learning_rate\": 0.05,\n \"num_iterations\": 200,\n \"test_size\": 0.2,\n \"test_sample_over\": \"time\",\n \"min_data_in_leaf\": 20,\n \"max_depth\": -1,\n \"max_bin\": 255,\n \"output_chunk_length\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.omnifuel.ai/v1/forecaster")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset\": \"https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv\",\n \"dataset_format\": \"csv\",\n \"time_column\": \"time\",\n \"target_columns\": [\n \"target\"\n ],\n \"past_covariates\": [],\n \"future_covariates\": [],\n \"static_covariates\": [],\n \"group_columns\": [\n \"group\"\n ],\n \"holidays\": [],\n \"datetime_attributes\": [],\n \"lags\": 30,\n \"lags_past_covariates\": 7,\n \"lags_future_covariates\": [\n 2\n ],\n \"num_leaves\": 50,\n \"learning_rate\": 0.05,\n \"num_iterations\": 200,\n \"test_size\": 0.2,\n \"test_sample_over\": \"time\",\n \"min_data_in_leaf\": 20,\n \"max_depth\": -1,\n \"max_bin\": 255,\n \"output_chunk_length\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omnifuel.ai/v1/forecaster")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset\": \"https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv\",\n \"dataset_format\": \"csv\",\n \"time_column\": \"time\",\n \"target_columns\": [\n \"target\"\n ],\n \"past_covariates\": [],\n \"future_covariates\": [],\n \"static_covariates\": [],\n \"group_columns\": [\n \"group\"\n ],\n \"holidays\": [],\n \"datetime_attributes\": [],\n \"lags\": 30,\n \"lags_past_covariates\": 7,\n \"lags_future_covariates\": [\n 2\n ],\n \"num_leaves\": 50,\n \"learning_rate\": 0.05,\n \"num_iterations\": 200,\n \"test_size\": 0.2,\n \"test_sample_over\": \"time\",\n \"min_data_in_leaf\": 20,\n \"max_depth\": -1,\n \"max_bin\": 255,\n \"output_chunk_length\": 1\n}"
response = http.request(request)
puts response.read_body{
"message": "Training job started successfully",
"id": "abc1234-5678-9101-1121-314151617181"
}{
"message": "Error starting training job",
"error": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
dataset
string<url>
default:https://docs.google.com/spreadsheets/d/e/2PACX-1vQlWg_weIflYDrxnlAVx7pEaQHL2fgCuqjwswG0XdZGkakIFdCoBGgzH7JOy7qyPNFxs5T7YB4pjwPT/pub?output=csv
required
URL of the dataset to be used for training
Available options:
csv, parquet Required range:
x >= 1Required range:
x >= 1Required range:
x >= 1Available options:
time, groups