Generate Splits
curl --request POST \
--url https://api.example.com/api/playground/sessions/{session_id}/splits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_column": "<string>",
"target_label_column": "target_label",
"split_column": "split",
"include_train": true,
"include_val": true,
"include_test": true,
"train_ratio": 0.7,
"val_ratio": 0.15,
"test_ratio": 0.15,
"random_state": 42
}
'import requests
url = "https://api.example.com/api/playground/sessions/{session_id}/splits"
payload = {
"target_column": "<string>",
"target_label_column": "target_label",
"split_column": "split",
"include_train": True,
"include_val": True,
"include_test": True,
"train_ratio": 0.7,
"val_ratio": 0.15,
"test_ratio": 0.15,
"random_state": 42
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
target_column: '<string>',
target_label_column: 'target_label',
split_column: 'split',
include_train: true,
include_val: true,
include_test: true,
train_ratio: 0.7,
val_ratio: 0.15,
test_ratio: 0.15,
random_state: 42
})
};
fetch('https://api.example.com/api/playground/sessions/{session_id}/splits', 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.example.com/api/playground/sessions/{session_id}/splits",
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([
'target_column' => '<string>',
'target_label_column' => 'target_label',
'split_column' => 'split',
'include_train' => true,
'include_val' => true,
'include_test' => true,
'train_ratio' => 0.7,
'val_ratio' => 0.15,
'test_ratio' => 0.15,
'random_state' => 42
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.example.com/api/playground/sessions/{session_id}/splits"
payload := strings.NewReader("{\n \"target_column\": \"<string>\",\n \"target_label_column\": \"target_label\",\n \"split_column\": \"split\",\n \"include_train\": true,\n \"include_val\": true,\n \"include_test\": true,\n \"train_ratio\": 0.7,\n \"val_ratio\": 0.15,\n \"test_ratio\": 0.15,\n \"random_state\": 42\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/playground/sessions/{session_id}/splits")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_column\": \"<string>\",\n \"target_label_column\": \"target_label\",\n \"split_column\": \"split\",\n \"include_train\": true,\n \"include_val\": true,\n \"include_test\": true,\n \"train_ratio\": 0.7,\n \"val_ratio\": 0.15,\n \"test_ratio\": 0.15,\n \"random_state\": 42\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/playground/sessions/{session_id}/splits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_column\": \"<string>\",\n \"target_label_column\": \"target_label\",\n \"split_column\": \"split\",\n \"include_train\": true,\n \"include_val\": true,\n \"include_test\": true,\n \"train_ratio\": 0.7,\n \"val_ratio\": 0.15,\n \"test_ratio\": 0.15,\n \"random_state\": 42\n}"
response = http.request(request)
puts response.read_body{
"session_id": "<string>",
"row_count": 123,
"target_column": "<string>",
"target_label_column": "<string>",
"split_column": "<string>",
"splits": [
"<string>"
],
"split_counts": {},
"split_ratios": {},
"overall_target_distribution": {},
"target_distribution_by_split": {},
"split_balance": {},
"balance_quality": "<string>",
"balance_score": 123,
"balance_feedback": "<string>",
"stratified": true,
"worst_split": "<string>",
"worst_split_tvd": 123,
"worst_split_gap": 123,
"warning": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}playground
Generate Splits
Generate balanced train/val/test splits for a playground session.
POST
/
api
/
playground
/
sessions
/
{session_id}
/
splits
Generate Splits
curl --request POST \
--url https://api.example.com/api/playground/sessions/{session_id}/splits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_column": "<string>",
"target_label_column": "target_label",
"split_column": "split",
"include_train": true,
"include_val": true,
"include_test": true,
"train_ratio": 0.7,
"val_ratio": 0.15,
"test_ratio": 0.15,
"random_state": 42
}
'import requests
url = "https://api.example.com/api/playground/sessions/{session_id}/splits"
payload = {
"target_column": "<string>",
"target_label_column": "target_label",
"split_column": "split",
"include_train": True,
"include_val": True,
"include_test": True,
"train_ratio": 0.7,
"val_ratio": 0.15,
"test_ratio": 0.15,
"random_state": 42
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
target_column: '<string>',
target_label_column: 'target_label',
split_column: 'split',
include_train: true,
include_val: true,
include_test: true,
train_ratio: 0.7,
val_ratio: 0.15,
test_ratio: 0.15,
random_state: 42
})
};
fetch('https://api.example.com/api/playground/sessions/{session_id}/splits', 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.example.com/api/playground/sessions/{session_id}/splits",
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([
'target_column' => '<string>',
'target_label_column' => 'target_label',
'split_column' => 'split',
'include_train' => true,
'include_val' => true,
'include_test' => true,
'train_ratio' => 0.7,
'val_ratio' => 0.15,
'test_ratio' => 0.15,
'random_state' => 42
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.example.com/api/playground/sessions/{session_id}/splits"
payload := strings.NewReader("{\n \"target_column\": \"<string>\",\n \"target_label_column\": \"target_label\",\n \"split_column\": \"split\",\n \"include_train\": true,\n \"include_val\": true,\n \"include_test\": true,\n \"train_ratio\": 0.7,\n \"val_ratio\": 0.15,\n \"test_ratio\": 0.15,\n \"random_state\": 42\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/playground/sessions/{session_id}/splits")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_column\": \"<string>\",\n \"target_label_column\": \"target_label\",\n \"split_column\": \"split\",\n \"include_train\": true,\n \"include_val\": true,\n \"include_test\": true,\n \"train_ratio\": 0.7,\n \"val_ratio\": 0.15,\n \"test_ratio\": 0.15,\n \"random_state\": 42\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/playground/sessions/{session_id}/splits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_column\": \"<string>\",\n \"target_label_column\": \"target_label\",\n \"split_column\": \"split\",\n \"include_train\": true,\n \"include_val\": true,\n \"include_test\": true,\n \"train_ratio\": 0.7,\n \"val_ratio\": 0.15,\n \"test_ratio\": 0.15,\n \"random_state\": 42\n}"
response = http.request(request)
puts response.read_body{
"session_id": "<string>",
"row_count": 123,
"target_column": "<string>",
"target_label_column": "<string>",
"split_column": "<string>",
"splits": [
"<string>"
],
"split_counts": {},
"split_ratios": {},
"overall_target_distribution": {},
"target_distribution_by_split": {},
"split_balance": {},
"balance_quality": "<string>",
"balance_score": 123,
"balance_feedback": "<string>",
"stratified": true,
"worst_split": "<string>",
"worst_split_tvd": 123,
"worst_split_gap": 123,
"warning": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Path Parameters
Cookies
Body
application/json
Minimum string length:
1Minimum string length:
1Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I

