edge-impulse-api 1.72.15 → 1.72.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/library/sdk/api/rawDataApi.d.ts +22 -1
- package/build/library/sdk/api/rawDataApi.js +151 -1
- package/build/library/sdk/api/rawDataApi.js.map +1 -1
- package/build/library/sdk/model/datasetRatioData.d.ts +1 -1
- package/build/library/sdk/model/datasetRatioDataRatio.d.ts +1 -1
- package/build/library/sdk/model/getDatasetRatioResponse.d.ts +34 -0
- package/build/library/sdk/model/getDatasetRatioResponse.js +39 -0
- package/build/library/sdk/model/getDatasetRatioResponse.js.map +1 -0
- package/build/library/sdk/model/job.d.ts +7 -0
- package/build/library/sdk/model/job.js +5 -0
- package/build/library/sdk/model/job.js.map +1 -1
- package/build/library/sdk/model/jobDetails.d.ts +7 -0
- package/build/library/sdk/model/jobDetails.js +5 -0
- package/build/library/sdk/model/jobDetails.js.map +1 -1
- package/build/library/sdk/model/models.d.ts +1 -0
- package/build/library/sdk/model/models.js +3 -0
- package/build/library/sdk/model/models.js.map +1 -1
- package/build/library/sdk/model/rebalanceDatasetResponse.d.ts +1 -1
- package/package.json +1 -1
|
@@ -27,6 +27,7 @@ import { GetAIActionsProposedChangesResponse } from '../model/getAIActionsPropos
|
|
|
27
27
|
import { GetAllImportedFromResponse } from '../model/getAllImportedFromResponse';
|
|
28
28
|
import { GetDataExplorerFeaturesResponse } from '../model/getDataExplorerFeaturesResponse';
|
|
29
29
|
import { GetDataExplorerSettingsResponse } from '../model/getDataExplorerSettingsResponse';
|
|
30
|
+
import { GetDatasetRatioResponse } from '../model/getDatasetRatioResponse';
|
|
30
31
|
import { GetDiversityDataResponse } from '../model/getDiversityDataResponse';
|
|
31
32
|
import { GetLabelNoiseDataResponse } from '../model/getLabelNoiseDataResponse';
|
|
32
33
|
import { GetSampleMetadataResponse } from '../model/getSampleMetadataResponse';
|
|
@@ -743,6 +744,16 @@ export declare class RawDataApi {
|
|
|
743
744
|
[name: string]: string;
|
|
744
745
|
};
|
|
745
746
|
}): Promise<GetDataExplorerSettingsResponse>;
|
|
747
|
+
/**
|
|
748
|
+
* Retrieve number of samples in train and test set.
|
|
749
|
+
* @summary Get dataset ratio
|
|
750
|
+
* @param projectId Project ID
|
|
751
|
+
*/
|
|
752
|
+
getDatasetRatio(projectId: number, options?: {
|
|
753
|
+
headers: {
|
|
754
|
+
[name: string]: string;
|
|
755
|
+
};
|
|
756
|
+
}): Promise<GetDatasetRatioResponse>;
|
|
746
757
|
/**
|
|
747
758
|
* Obtain metrics that describe the similarity and diversity of a dataset. To calculate these metrics, use the `calculateDataQualityMetrics` endpoint.
|
|
748
759
|
* @summary Get diversity metrics data
|
|
@@ -980,7 +991,7 @@ export declare class RawDataApi {
|
|
|
980
991
|
};
|
|
981
992
|
}): Promise<GenericApiResponse>;
|
|
982
993
|
/**
|
|
983
|
-
* Rebalances the dataset over training / testing categories. This resets the category for all data and splits it 80%/20% between training and testing. This is a deterministic process based on the hash of the name of the data.
|
|
994
|
+
* This API is deprecated, use rebalanceDatasetV2 instead (`/v1/api/{projectId}/classify/v2/{sampleId}`). Rebalances the dataset over training / testing categories. This resets the category for all data and splits it 80%/20% between training and testing. This is a deterministic process based on the hash of the name of the data.
|
|
984
995
|
* @summary Rebalance dataset
|
|
985
996
|
* @param projectId Project ID
|
|
986
997
|
*/
|
|
@@ -989,6 +1000,16 @@ export declare class RawDataApi {
|
|
|
989
1000
|
[name: string]: string;
|
|
990
1001
|
};
|
|
991
1002
|
}): Promise<RebalanceDatasetResponse>;
|
|
1003
|
+
/**
|
|
1004
|
+
* Rebalances the dataset over training / testing categories. This resets the category for all data and splits it 80%/20% between training and testing. This is a deterministic process based on the hash of the name of the data. Returns immediately on small datasets, or starts a job on larger datasets. To get the dataset ratio (as returned by the v1 endpoint), use getDatasetRatio.
|
|
1005
|
+
* @summary Rebalance dataset
|
|
1006
|
+
* @param projectId Project ID
|
|
1007
|
+
*/
|
|
1008
|
+
rebalanceDatasetV2(projectId: number, options?: {
|
|
1009
|
+
headers: {
|
|
1010
|
+
[name: string]: string;
|
|
1011
|
+
};
|
|
1012
|
+
}): Promise<GenericApiResponse | StartJobResponse>;
|
|
992
1013
|
/**
|
|
993
1014
|
* Sets the file name of the sample. This name does not need to be unique, but it\'s highly recommended to do so.
|
|
994
1015
|
* @summary Rename sample
|
|
@@ -2703,6 +2703,81 @@ class RawDataApi {
|
|
|
2703
2703
|
});
|
|
2704
2704
|
});
|
|
2705
2705
|
}
|
|
2706
|
+
/**
|
|
2707
|
+
* Retrieve number of samples in train and test set.
|
|
2708
|
+
* @summary Get dataset ratio
|
|
2709
|
+
* @param projectId Project ID
|
|
2710
|
+
*/
|
|
2711
|
+
async getDatasetRatio(projectId, options = { headers: {} }) {
|
|
2712
|
+
const localVarPath = this.basePath + '/api/{projectId}/raw-data/ratio'
|
|
2713
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
2714
|
+
let localVarQueryParameters = {};
|
|
2715
|
+
let localVarHeaderParams = Object.assign({
|
|
2716
|
+
'User-Agent': 'edgeimpulse-api nodejs'
|
|
2717
|
+
}, this.defaultHeaders);
|
|
2718
|
+
const produces = ['application/json'];
|
|
2719
|
+
// give precedence to 'application/json'
|
|
2720
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2721
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2722
|
+
}
|
|
2723
|
+
else {
|
|
2724
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2725
|
+
}
|
|
2726
|
+
let localVarFormParams = {};
|
|
2727
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
2728
|
+
if (projectId === null || projectId === undefined) {
|
|
2729
|
+
throw new Error('Required parameter projectId was null or undefined when calling getDatasetRatio.');
|
|
2730
|
+
}
|
|
2731
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
2732
|
+
Object.assign(localVarHeaderParams, this.opts.extraHeaders);
|
|
2733
|
+
let localVarUseFormData = false;
|
|
2734
|
+
let localVarRequestOptions = {
|
|
2735
|
+
method: 'GET',
|
|
2736
|
+
qs: localVarQueryParameters,
|
|
2737
|
+
headers: localVarHeaderParams,
|
|
2738
|
+
uri: localVarPath,
|
|
2739
|
+
useQuerystring: this._useQuerystring,
|
|
2740
|
+
agentOptions: { keepAlive: false },
|
|
2741
|
+
json: true,
|
|
2742
|
+
};
|
|
2743
|
+
let authenticationPromise = Promise.resolve();
|
|
2744
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
|
|
2745
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
|
|
2746
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
|
|
2747
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.OAuth2.applyToRequest(localVarRequestOptions));
|
|
2748
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2749
|
+
return authenticationPromise.then(() => {
|
|
2750
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2751
|
+
if (localVarUseFormData) {
|
|
2752
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
2753
|
+
}
|
|
2754
|
+
else {
|
|
2755
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2756
|
+
}
|
|
2757
|
+
}
|
|
2758
|
+
return new Promise((resolve, reject) => {
|
|
2759
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2760
|
+
if (error) {
|
|
2761
|
+
reject(error);
|
|
2762
|
+
}
|
|
2763
|
+
else {
|
|
2764
|
+
body = models_1.ObjectSerializer.deserialize(body, "GetDatasetRatioResponse");
|
|
2765
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
2766
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
2767
|
+
reject(new Error(body.error || errString));
|
|
2768
|
+
}
|
|
2769
|
+
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2770
|
+
resolve(body);
|
|
2771
|
+
}
|
|
2772
|
+
else {
|
|
2773
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
2774
|
+
reject(errString);
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
});
|
|
2778
|
+
});
|
|
2779
|
+
});
|
|
2780
|
+
}
|
|
2706
2781
|
/**
|
|
2707
2782
|
* Obtain metrics that describe the similarity and diversity of a dataset. To calculate these metrics, use the `calculateDataQualityMetrics` endpoint.
|
|
2708
2783
|
* @summary Get diversity metrics data
|
|
@@ -4314,7 +4389,7 @@ class RawDataApi {
|
|
|
4314
4389
|
});
|
|
4315
4390
|
}
|
|
4316
4391
|
/**
|
|
4317
|
-
* Rebalances the dataset over training / testing categories. This resets the category for all data and splits it 80%/20% between training and testing. This is a deterministic process based on the hash of the name of the data.
|
|
4392
|
+
* This API is deprecated, use rebalanceDatasetV2 instead (`/v1/api/{projectId}/classify/v2/{sampleId}`). Rebalances the dataset over training / testing categories. This resets the category for all data and splits it 80%/20% between training and testing. This is a deterministic process based on the hash of the name of the data.
|
|
4318
4393
|
* @summary Rebalance dataset
|
|
4319
4394
|
* @param projectId Project ID
|
|
4320
4395
|
*/
|
|
@@ -4388,6 +4463,81 @@ class RawDataApi {
|
|
|
4388
4463
|
});
|
|
4389
4464
|
});
|
|
4390
4465
|
}
|
|
4466
|
+
/**
|
|
4467
|
+
* Rebalances the dataset over training / testing categories. This resets the category for all data and splits it 80%/20% between training and testing. This is a deterministic process based on the hash of the name of the data. Returns immediately on small datasets, or starts a job on larger datasets. To get the dataset ratio (as returned by the v1 endpoint), use getDatasetRatio.
|
|
4468
|
+
* @summary Rebalance dataset
|
|
4469
|
+
* @param projectId Project ID
|
|
4470
|
+
*/
|
|
4471
|
+
async rebalanceDatasetV2(projectId, options = { headers: {} }) {
|
|
4472
|
+
const localVarPath = this.basePath + '/api/{projectId}/v2/rebalance'
|
|
4473
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
4474
|
+
let localVarQueryParameters = {};
|
|
4475
|
+
let localVarHeaderParams = Object.assign({
|
|
4476
|
+
'User-Agent': 'edgeimpulse-api nodejs'
|
|
4477
|
+
}, this.defaultHeaders);
|
|
4478
|
+
const produces = ['application/json'];
|
|
4479
|
+
// give precedence to 'application/json'
|
|
4480
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
4481
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
4482
|
+
}
|
|
4483
|
+
else {
|
|
4484
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
4485
|
+
}
|
|
4486
|
+
let localVarFormParams = {};
|
|
4487
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
4488
|
+
if (projectId === null || projectId === undefined) {
|
|
4489
|
+
throw new Error('Required parameter projectId was null or undefined when calling rebalanceDatasetV2.');
|
|
4490
|
+
}
|
|
4491
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
4492
|
+
Object.assign(localVarHeaderParams, this.opts.extraHeaders);
|
|
4493
|
+
let localVarUseFormData = false;
|
|
4494
|
+
let localVarRequestOptions = {
|
|
4495
|
+
method: 'POST',
|
|
4496
|
+
qs: localVarQueryParameters,
|
|
4497
|
+
headers: localVarHeaderParams,
|
|
4498
|
+
uri: localVarPath,
|
|
4499
|
+
useQuerystring: this._useQuerystring,
|
|
4500
|
+
agentOptions: { keepAlive: false },
|
|
4501
|
+
json: true,
|
|
4502
|
+
};
|
|
4503
|
+
let authenticationPromise = Promise.resolve();
|
|
4504
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
|
|
4505
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
|
|
4506
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
|
|
4507
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.OAuth2.applyToRequest(localVarRequestOptions));
|
|
4508
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
4509
|
+
return authenticationPromise.then(() => {
|
|
4510
|
+
if (Object.keys(localVarFormParams).length) {
|
|
4511
|
+
if (localVarUseFormData) {
|
|
4512
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
4513
|
+
}
|
|
4514
|
+
else {
|
|
4515
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
4516
|
+
}
|
|
4517
|
+
}
|
|
4518
|
+
return new Promise((resolve, reject) => {
|
|
4519
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
4520
|
+
if (error) {
|
|
4521
|
+
reject(error);
|
|
4522
|
+
}
|
|
4523
|
+
else {
|
|
4524
|
+
body = models_1.ObjectSerializer.deserialize(body, "GenericApiResponse | StartJobResponse");
|
|
4525
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
4526
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
4527
|
+
reject(new Error(body.error || errString));
|
|
4528
|
+
}
|
|
4529
|
+
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
4530
|
+
resolve(body);
|
|
4531
|
+
}
|
|
4532
|
+
else {
|
|
4533
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
4534
|
+
reject(errString);
|
|
4535
|
+
}
|
|
4536
|
+
}
|
|
4537
|
+
});
|
|
4538
|
+
});
|
|
4539
|
+
});
|
|
4540
|
+
}
|
|
4391
4541
|
/**
|
|
4392
4542
|
* Sets the file name of the sample. This name does not need to be unique, but it\'s highly recommended to do so.
|
|
4393
4543
|
* @summary Rename sample
|