curl --request POST \
--url https://studio.edgeimpulse.com/v1/api/{projectId}/split-preview \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"trainingSplitRatio": 123,
"testingSplitRatio": 123,
"validationSplitRatio": 123,
"excludeDisabledSamples": false,
"stratifyBy": {
"label": true,
"metadataKeys": [
"<string>"
]
},
"keepTogetherMetadataKeys": [
"<string>"
]
}
'import requests
url = "https://studio.edgeimpulse.com/v1/api/{projectId}/split-preview"
payload = {
"trainingSplitRatio": 123,
"testingSplitRatio": 123,
"validationSplitRatio": 123,
"excludeDisabledSamples": False,
"stratifyBy": {
"label": True,
"metadataKeys": ["<string>"]
},
"keepTogetherMetadataKeys": ["<string>"]
}
headers = {
"x-api-key": "<api-key>",
"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>', 'Content-Type': 'application/json'},
body: JSON.stringify({
trainingSplitRatio: 123,
testingSplitRatio: 123,
validationSplitRatio: 123,
excludeDisabledSamples: false,
stratifyBy: {label: true, metadataKeys: ['<string>']},
keepTogetherMetadataKeys: ['<string>']
})
};
fetch('https://studio.edgeimpulse.com/v1/api/{projectId}/split-preview', 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://studio.edgeimpulse.com/v1/api/{projectId}/split-preview",
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([
'trainingSplitRatio' => 123,
'testingSplitRatio' => 123,
'validationSplitRatio' => 123,
'excludeDisabledSamples' => false,
'stratifyBy' => [
'label' => true,
'metadataKeys' => [
'<string>'
]
],
'keepTogetherMetadataKeys' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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://studio.edgeimpulse.com/v1/api/{projectId}/split-preview"
payload := strings.NewReader("{\n \"trainingSplitRatio\": 123,\n \"testingSplitRatio\": 123,\n \"validationSplitRatio\": 123,\n \"excludeDisabledSamples\": false,\n \"stratifyBy\": {\n \"label\": true,\n \"metadataKeys\": [\n \"<string>\"\n ]\n },\n \"keepTogetherMetadataKeys\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://studio.edgeimpulse.com/v1/api/{projectId}/split-preview")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"trainingSplitRatio\": 123,\n \"testingSplitRatio\": 123,\n \"validationSplitRatio\": 123,\n \"excludeDisabledSamples\": false,\n \"stratifyBy\": {\n \"label\": true,\n \"metadataKeys\": [\n \"<string>\"\n ]\n },\n \"keepTogetherMetadataKeys\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://studio.edgeimpulse.com/v1/api/{projectId}/split-preview")
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["Content-Type"] = 'application/json'
request.body = "{\n \"trainingSplitRatio\": 123,\n \"testingSplitRatio\": 123,\n \"validationSplitRatio\": 123,\n \"excludeDisabledSamples\": false,\n \"stratifyBy\": {\n \"label\": true,\n \"metadataKeys\": [\n \"<string>\"\n ]\n },\n \"keepTogetherMetadataKeys\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"assignmentPreview": {
"title": "<string>",
"keyLabel": "<string>",
"rows": [
{
"stratValue": "<string>",
"sampleCount": 123,
"percentWithinGroup": 123,
"totalLengthMs": 123,
"percentWithinGroupDuration": 123
}
],
"summary": "<string>"
},
"balancePreviews": [
{
"title": "<string>",
"keyLabel": "<string>",
"rows": [
{
"stratValue": "<string>",
"sampleCount": 123,
"percentWithinGroup": 123,
"totalLengthMs": 123,
"percentWithinGroupDuration": 123
}
],
"summary": "<string>"
}
]
},
"error": "<string>"
}Split dataset preview
Returns a preview of how the project’s dataset would be split if the current split options were applied. For each group (composite of label and/or metadata keys, or keep-together group), shows the number and percentage of samples that would be assigned to each split. This does not update the dataset, only provides a summary. Returns immediately on small datasets, or starts a job on larger datasets.
curl --request POST \
--url https://studio.edgeimpulse.com/v1/api/{projectId}/split-preview \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"trainingSplitRatio": 123,
"testingSplitRatio": 123,
"validationSplitRatio": 123,
"excludeDisabledSamples": false,
"stratifyBy": {
"label": true,
"metadataKeys": [
"<string>"
]
},
"keepTogetherMetadataKeys": [
"<string>"
]
}
'import requests
url = "https://studio.edgeimpulse.com/v1/api/{projectId}/split-preview"
payload = {
"trainingSplitRatio": 123,
"testingSplitRatio": 123,
"validationSplitRatio": 123,
"excludeDisabledSamples": False,
"stratifyBy": {
"label": True,
"metadataKeys": ["<string>"]
},
"keepTogetherMetadataKeys": ["<string>"]
}
headers = {
"x-api-key": "<api-key>",
"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>', 'Content-Type': 'application/json'},
body: JSON.stringify({
trainingSplitRatio: 123,
testingSplitRatio: 123,
validationSplitRatio: 123,
excludeDisabledSamples: false,
stratifyBy: {label: true, metadataKeys: ['<string>']},
keepTogetherMetadataKeys: ['<string>']
})
};
fetch('https://studio.edgeimpulse.com/v1/api/{projectId}/split-preview', 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://studio.edgeimpulse.com/v1/api/{projectId}/split-preview",
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([
'trainingSplitRatio' => 123,
'testingSplitRatio' => 123,
'validationSplitRatio' => 123,
'excludeDisabledSamples' => false,
'stratifyBy' => [
'label' => true,
'metadataKeys' => [
'<string>'
]
],
'keepTogetherMetadataKeys' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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://studio.edgeimpulse.com/v1/api/{projectId}/split-preview"
payload := strings.NewReader("{\n \"trainingSplitRatio\": 123,\n \"testingSplitRatio\": 123,\n \"validationSplitRatio\": 123,\n \"excludeDisabledSamples\": false,\n \"stratifyBy\": {\n \"label\": true,\n \"metadataKeys\": [\n \"<string>\"\n ]\n },\n \"keepTogetherMetadataKeys\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://studio.edgeimpulse.com/v1/api/{projectId}/split-preview")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"trainingSplitRatio\": 123,\n \"testingSplitRatio\": 123,\n \"validationSplitRatio\": 123,\n \"excludeDisabledSamples\": false,\n \"stratifyBy\": {\n \"label\": true,\n \"metadataKeys\": [\n \"<string>\"\n ]\n },\n \"keepTogetherMetadataKeys\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://studio.edgeimpulse.com/v1/api/{projectId}/split-preview")
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["Content-Type"] = 'application/json'
request.body = "{\n \"trainingSplitRatio\": 123,\n \"testingSplitRatio\": 123,\n \"validationSplitRatio\": 123,\n \"excludeDisabledSamples\": false,\n \"stratifyBy\": {\n \"label\": true,\n \"metadataKeys\": [\n \"<string>\"\n ]\n },\n \"keepTogetherMetadataKeys\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"assignmentPreview": {
"title": "<string>",
"keyLabel": "<string>",
"rows": [
{
"stratValue": "<string>",
"sampleCount": 123,
"percentWithinGroup": 123,
"totalLengthMs": 123,
"percentWithinGroupDuration": 123
}
],
"summary": "<string>"
},
"balancePreviews": [
{
"title": "<string>",
"keyLabel": "<string>",
"rows": [
{
"stratValue": "<string>",
"sampleCount": 123,
"percentWithinGroup": 123,
"totalLengthMs": 123,
"percentWithinGroupDuration": 123
}
],
"summary": "<string>"
}
]
},
"error": "<string>"
}Authorizations
Path Parameters
Project ID
Body
Proportion of the dataset to use for training.
Proportion of the dataset to use for testing.
Proportion of the dataset to use for validation. This is experimental and may change in the future.
Whether to exclude samples that are marked as disabled.
Optional balancing targets for the split.
Show child attributes
Show child attributes
List of metadata keys whose matching values must stay together in a single split. This is useful for leakage prevention across train, validation, and test.
Was this page helpful?