@narrative.io/data-collaboration-sdk-ts 2.57.1 → 2.58.1
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/index.d.ts +68 -39
- package/build/index.js +65 -24
- package/build/jobs/index.d.ts +1 -1
- package/build/jobs/types.d.ts +176 -2
- package/build/nql/Ast.d.ts +1 -1
- package/build/nql/NqlBuilder.js +1 -4
- package/build/nql/types.d.ts +206 -970
- package/build/rosetta/types.d.ts +123 -775
- package/package.json +11 -11
package/build/index.d.ts
CHANGED
|
@@ -1,53 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export * from "./access-rules/";
|
|
2
|
+
export * from "./access-tokens";
|
|
3
|
+
export { resources } from "./access-tokens/types";
|
|
4
|
+
export type { App } from "./apps";
|
|
5
|
+
export * from "./attributes";
|
|
6
|
+
export * from "./authentication";
|
|
7
|
+
export * from "./base-api";
|
|
8
|
+
export * from "./company-info";
|
|
9
|
+
export * from "./connections";
|
|
10
|
+
export * from "./contracts";
|
|
11
|
+
export * from "./data-planes";
|
|
12
|
+
export * from "./data-planes/types";
|
|
13
|
+
export * from "./data-streams";
|
|
14
|
+
export * from "./datasets";
|
|
15
|
+
export * from "./datasets/types";
|
|
16
|
+
export * from "./encryption-materials";
|
|
17
|
+
export * from "./encryption-materials/types";
|
|
18
|
+
export * from "./forecast";
|
|
19
|
+
export * from "./health";
|
|
20
|
+
export * from "./health/types";
|
|
21
|
+
export * from "./installations";
|
|
22
|
+
export * from "./jobs";
|
|
23
|
+
export { default as JsonBigNumber } from "./json-big-number";
|
|
24
|
+
export * from "./mappings";
|
|
25
|
+
export * from "./mappings/types";
|
|
26
|
+
export * from "./model-training";
|
|
27
|
+
export * from "./models";
|
|
28
|
+
export * from "./nql";
|
|
29
|
+
export { compileStatement, parseStatement } from "./nql";
|
|
30
|
+
export { convertNqlObjectToForecastBody } from "./nql/DataRulesConverter";
|
|
31
|
+
export { buildNql, getNqlObject } from "./nql/NQLParser";
|
|
32
|
+
export type { AstNodeMetadata, AstNodeType, ForecastBody } from "./nql/types";
|
|
33
|
+
export * from "./ping";
|
|
34
|
+
export * from "./ping/types";
|
|
35
|
+
export * from "./products";
|
|
36
|
+
export * from "./queries";
|
|
37
|
+
export * from "./resources";
|
|
38
|
+
export * from "./rosetta/types";
|
|
39
|
+
export * from "./rosetta-stone";
|
|
40
|
+
export * from "./rosetta-stone/types";
|
|
41
|
+
export * from "./subscriptions";
|
|
42
|
+
export * from "./types";
|
|
43
|
+
export * from "./uploads";
|
|
44
|
+
export * from "./uploads/types";
|
|
45
|
+
export { applyMixins } from "./utils";
|
|
46
|
+
export * from "./views";
|
|
47
|
+
export * from "./whoami";
|
|
48
|
+
export * from "./whoami/types";
|
|
49
|
+
import { AccessRulesApi } from "./access-rules/";
|
|
50
|
+
import { AccessTokensApi } from "./access-tokens";
|
|
51
|
+
import { AppsApi } from "./apps";
|
|
6
52
|
import { AttributeApi, AttributeApiV2 } from "./attributes";
|
|
7
|
-
import
|
|
8
|
-
import { type ApiToken, AuthenticationApi, type LoggedInUser, type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse, type StytchToken, type UserRole } from "./authentication";
|
|
53
|
+
import { AuthenticationApi } from "./authentication";
|
|
9
54
|
import { BaseApi } from "./base-api";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
55
|
+
import { CompanyInfoApi } from "./company-info";
|
|
56
|
+
import { ConnectionsApi } from "./connections";
|
|
57
|
+
import { ContractsApi } from "./contracts";
|
|
13
58
|
import { DataPlaneApi } from "./data-planes";
|
|
14
|
-
import
|
|
15
|
-
import { type AttributeSet, type ColumnSet, type ColumnWithFilterAndExport, type DataRules, type DataStream, DataStreamsApi } from "./data-streams";
|
|
59
|
+
import { DataStreamsApi } from "./data-streams";
|
|
16
60
|
import { DatasetApi } from "./datasets";
|
|
17
|
-
import type { AdvancedStatistics, AdvancedStatisticsMetadata, BasicStatistics, ColumnStatistics, ColumnSummary, Columns, Configuration, CreateDatasetRefreshScheduleRequest, CreateDatasetRequest, Dataset, DatasetStatus, DatasetTableSummary, DatasetTableSummaryAPIResponse, DatasetWriteMode, FilePerSnapshotResponse, Histogram, IngestDatasetFileRequest, RetentionPolicy, Schema, SchemaArrayItems, SchemaArrayItemsArray, SchemaArrayItemsObject, SchemaArrayItemsPrimitive, SchemaArrayProperty, SchemaFileConfig, SchemaFileConfigType, SchemaObjectProperty, SchemaPrimitiveProperty, SchemaProperties, SchemaPropertiesType, SchemaProperty, SnapshotRange, UpdateDatasetRefreshScheduleRequest, UpdateDatasetRequest, Value } from "./datasets/types";
|
|
18
61
|
import { EncryptionMaterialApi } from "./encryption-materials";
|
|
19
|
-
import
|
|
20
|
-
import { type CostForecastRequest, type CostForecastResponse, type CostForecastResult, ForecastApi, type ForecastRequest, type ForecastResponse, type ForecastResult, type ForecastResultFailure, type JobState } from "./forecast";
|
|
62
|
+
import { ForecastApi } from "./forecast";
|
|
21
63
|
import { HealthCheckApi } from "./health";
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
28
|
-
import { ModelTrainingApi, type ModelTrainingConfig, type OutputModel, type TrainModelRequest, type TrainModelResponse } from "./model-training";
|
|
29
|
-
import { type CreateModelRequest, type Model, type ModelCollaborators, ModelsApi, type UpdateModelRequest } from "./models";
|
|
30
|
-
import { type CompiledNql, type CreateMaterializedView, type Deduplication, type Explain, type Expression, type Nql, NqlApi, type NqlAst, type NqlBooleanExpression, type NqlCompileResult, type NqlExpression, type NqlField, type NqlFilterBinaryExpression, type NqlFilterExpression, type NqlFilterUnaryExpression, type NqlQueryInput, type NqlResult, type NqlWhere, type Raw, type Select, type Statement, type Table, compileStatement, parseStatement } from "./nql";
|
|
31
|
-
import { convertNqlObjectToForecastBody } from "./nql/DataRulesConverter";
|
|
32
|
-
import { buildNql, getNqlObject } from "./nql/NQLParser";
|
|
33
|
-
import type { AstNodeMetadata, AstNodeType, ForecastBody } from "./nql/types";
|
|
64
|
+
import { InstallationsApi } from "./installations";
|
|
65
|
+
import { JobsApi } from "./jobs";
|
|
66
|
+
import { MappingsApi } from "./mappings";
|
|
67
|
+
import { ModelTrainingApi } from "./model-training";
|
|
68
|
+
import { ModelsApi } from "./models";
|
|
69
|
+
import { NqlApi } from "./nql";
|
|
34
70
|
import { PingApi } from "./ping";
|
|
35
|
-
import
|
|
36
|
-
import {
|
|
37
|
-
import { type CreateNqlQueryRequest, type NqlOwnedQueryResponse, type NqlQueryAst, type NqlQueryCollaborators, type NqlQueryMetadata, type NqlQueryOwner, type NqlQueryResponse, type NqlSharedQueryResponse, QueriesApi, type UpdateNqlQueryRequest } from "./queries";
|
|
38
|
-
import { type BucketCreationRequest, type Resource, ResourceApi, type UpdateAccessTypeRequest } from "./resources";
|
|
71
|
+
import { QueriesApi } from "./queries";
|
|
72
|
+
import { ResourceApi } from "./resources";
|
|
39
73
|
import { RosettaStoneApi } from "./rosetta-stone";
|
|
40
|
-
import
|
|
41
|
-
import { type ConversationAssistantMessage, type ConversationAssistantMessageWithFunctionCall, type ConversationAssistantMessageWithoutFunctionCall, type ConversationFunctionMessage, type ConversationIOMessage, type ConversationMessage, type ConversationMessageFunctionCall, type ConversationMessageName, type ConversationMessageRole, type ConversationMessages, type ConversationSystemMessage, type ConversationUserMessage, type RosettaRequestMessage, type RosettaResponseMessage, isConversationAssistantMessage, isConversationAssistantMessageWithFunctionCall, isConversationAssistantMessageWithoutFunctionCall, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageFunctionCall, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isRosettaRequestMessage, isType } from "./rosetta/types";
|
|
42
|
-
import { type DataStreamSubscriptionDetails, type MarketplaceSubscriptionDetails, type Subscription, type SubscriptionBudget, type SubscriptionDetails, type SubscriptionOutput, type SubscriptionStatus, type SubscriptionType, SubscriptionsApi } from "./subscriptions";
|
|
43
|
-
import type { ApiRecords, ApiRecordsV2, CollaboratorList, CollaboratorsConfig, Config, Environment, GeneralCollaborator, GeneralCollaboratorType, MonetaryAmount, NonAuthenticatedCollaborator, QueryAccess, QueryCollaborator, SpecificCollaboratorType, ViewAccess, ViewCollaborator } from "./types";
|
|
74
|
+
import { SubscriptionsApi } from "./subscriptions";
|
|
44
75
|
import { UploadsApi } from "./uploads";
|
|
45
|
-
import
|
|
46
|
-
import { type CreateViewRequest, type OwnedView, type SharedView, type UpdateViewRequest, type View, type ViewOwner, ViewsApi } from "./views";
|
|
76
|
+
import { ViewsApi } from "./views";
|
|
47
77
|
import { WhoAmIApi } from "./whoami";
|
|
48
|
-
import type { User } from "./whoami/types";
|
|
49
78
|
declare class NarrativeApi extends BaseApi {
|
|
50
79
|
}
|
|
51
80
|
interface NarrativeApi extends BaseApi, HealthCheckApi, AccessTokensApi, DataPlaneApi, DatasetApi, RosettaStoneApi, AttributeApi, AttributeApiV2, PingApi, CompanyInfoApi, InstallationsApi, ConnectionsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, MappingsApi, AccessRulesApi, AppsApi, SubscriptionsApi, JobsApi, QueriesApi, ViewsApi, ModelsApi, ModelTrainingApi, EncryptionMaterialApi, WhoAmIApi {
|
|
52
81
|
}
|
|
53
|
-
export { NarrativeApi
|
|
82
|
+
export { NarrativeApi };
|
package/build/index.js
CHANGED
|
@@ -1,38 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// This approach maintains EXACT same exports as before
|
|
2
|
+
export * from "./access-rules/";
|
|
3
|
+
export * from "./access-tokens";
|
|
4
|
+
export { resources } from "./access-tokens/types";
|
|
5
|
+
export * from "./attributes";
|
|
6
|
+
export * from "./authentication";
|
|
7
|
+
export * from "./base-api";
|
|
8
|
+
export * from "./company-info";
|
|
9
|
+
export * from "./connections";
|
|
10
|
+
export * from "./contracts";
|
|
11
|
+
export * from "./data-planes";
|
|
12
|
+
export * from "./data-planes/types";
|
|
13
|
+
export * from "./data-streams";
|
|
14
|
+
export * from "./datasets";
|
|
15
|
+
export * from "./datasets/types";
|
|
16
|
+
export * from "./encryption-materials";
|
|
17
|
+
export * from "./encryption-materials/types";
|
|
18
|
+
export * from "./forecast";
|
|
19
|
+
export * from "./health";
|
|
20
|
+
export * from "./health/types";
|
|
21
|
+
export * from "./installations";
|
|
22
|
+
export * from "./jobs";
|
|
23
|
+
// Special imports that might be from default exports or need special handling
|
|
24
|
+
export { default as JsonBigNumber } from "./json-big-number";
|
|
25
|
+
export * from "./mappings";
|
|
26
|
+
export * from "./mappings/types";
|
|
27
|
+
export * from "./model-training";
|
|
28
|
+
export * from "./models";
|
|
29
|
+
export * from "./nql";
|
|
30
|
+
export { compileStatement, parseStatement } from "./nql";
|
|
31
|
+
export { convertNqlObjectToForecastBody } from "./nql/DataRulesConverter";
|
|
32
|
+
export { buildNql, getNqlObject } from "./nql/NQLParser";
|
|
33
|
+
export * from "./ping";
|
|
34
|
+
export * from "./ping/types";
|
|
35
|
+
export * from "./products";
|
|
36
|
+
export * from "./queries";
|
|
37
|
+
export * from "./resources";
|
|
38
|
+
export * from "./rosetta/types";
|
|
39
|
+
export * from "./rosetta-stone";
|
|
40
|
+
export * from "./rosetta-stone/types";
|
|
41
|
+
export * from "./subscriptions";
|
|
42
|
+
export * from "./types";
|
|
43
|
+
export * from "./uploads";
|
|
44
|
+
export * from "./uploads/types";
|
|
45
|
+
export { applyMixins } from "./utils";
|
|
46
|
+
export * from "./views";
|
|
47
|
+
export * from "./whoami";
|
|
48
|
+
export * from "./whoami/types";
|
|
49
|
+
import { AccessRulesApi } from "./access-rules/";
|
|
50
|
+
import { AccessTokensApi } from "./access-tokens";
|
|
4
51
|
import { AppsApi } from "./apps";
|
|
5
52
|
import { AttributeApi, AttributeApiV2 } from "./attributes";
|
|
6
|
-
import { AuthenticationApi
|
|
53
|
+
import { AuthenticationApi } from "./authentication";
|
|
54
|
+
// Handle the NarrativeApi class with mixins
|
|
7
55
|
import { BaseApi } from "./base-api";
|
|
8
56
|
import { CompanyInfoApi } from "./company-info";
|
|
9
57
|
import { ConnectionsApi } from "./connections";
|
|
10
|
-
import { ContractsApi
|
|
58
|
+
import { ContractsApi } from "./contracts";
|
|
11
59
|
import { DataPlaneApi } from "./data-planes";
|
|
12
|
-
import { DataStreamsApi
|
|
60
|
+
import { DataStreamsApi } from "./data-streams";
|
|
13
61
|
import { DatasetApi } from "./datasets";
|
|
14
62
|
import { EncryptionMaterialApi } from "./encryption-materials";
|
|
15
|
-
import { ForecastApi
|
|
63
|
+
import { ForecastApi } from "./forecast";
|
|
16
64
|
import { HealthCheckApi } from "./health";
|
|
17
|
-
import { InstallationsApi
|
|
18
|
-
import { JobsApi
|
|
19
|
-
import JsonBigNumber from "./json-big-number";
|
|
65
|
+
import { InstallationsApi } from "./installations";
|
|
66
|
+
import { JobsApi } from "./jobs";
|
|
20
67
|
import { MappingsApi } from "./mappings";
|
|
21
|
-
import { ModelTrainingApi
|
|
22
|
-
import { ModelsApi
|
|
23
|
-
import { NqlApi
|
|
24
|
-
import { convertNqlObjectToForecastBody } from "./nql/DataRulesConverter";
|
|
25
|
-
import { buildNql, getNqlObject } from "./nql/NQLParser";
|
|
68
|
+
import { ModelTrainingApi } from "./model-training";
|
|
69
|
+
import { ModelsApi } from "./models";
|
|
70
|
+
import { NqlApi } from "./nql";
|
|
26
71
|
import { PingApi } from "./ping";
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { ResourceApi, } from "./resources";
|
|
72
|
+
import { QueriesApi } from "./queries";
|
|
73
|
+
import { ResourceApi } from "./resources";
|
|
30
74
|
import { RosettaStoneApi } from "./rosetta-stone";
|
|
31
|
-
import {
|
|
32
|
-
import { SubscriptionsApi, } from "./subscriptions";
|
|
75
|
+
import { SubscriptionsApi } from "./subscriptions";
|
|
33
76
|
import { UploadsApi } from "./uploads";
|
|
34
77
|
import { applyMixins } from "./utils";
|
|
35
|
-
import { ViewsApi
|
|
78
|
+
import { ViewsApi } from "./views";
|
|
36
79
|
import { WhoAmIApi } from "./whoami";
|
|
37
80
|
class NarrativeApi extends BaseApi {
|
|
38
81
|
}
|
|
@@ -68,6 +111,4 @@ applyMixins(NarrativeApi, [
|
|
|
68
111
|
EncryptionMaterialApi,
|
|
69
112
|
WhoAmIApi,
|
|
70
113
|
]);
|
|
71
|
-
export {
|
|
72
|
-
// biome-ignore lint/style/useExportType: We need to export the class
|
|
73
|
-
NarrativeApi, AttributeApi, AttributeApiV2, AccessTokensApi, DataPlaneApi, HealthCheckApi, DatasetApi, EncryptionMaterialApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, ConnectionsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, AppsApi, MappingsApi, AccessRulesApi, SubscriptionsApi, JobsApi, QueriesApi, ViewsApi, ModelsApi, ModelTrainingApi, WhoAmIApi, getNqlObject, buildNql, convertNqlObjectToForecastBody, isConversationAssistantMessage, isConversationFunctionMessage, isConversationInputMessage, isConversationMessage, isConversationMessageName, isConversationMessageRole, isConversationMessages, isConversationSystemMessage, isConversationUserMessage, isType, isConversationMessageFunctionCall, isConversationAssistantMessageWithFunctionCall, isRosettaRequestMessage, isConversationAssistantMessageWithoutFunctionCall, resources, compileStatement, parseStatement, JsonBigNumber, };
|
|
114
|
+
export { NarrativeApi };
|
package/build/jobs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseApi } from "../base-api";
|
|
2
2
|
import type { ApiRecords } from "../types";
|
|
3
|
-
import type { ColumnDetails, DatasetsCalculateColumnStatsJob, DatasetsDeleteTableJob, DatasetsDeliverDataJob, DatasetsSampleJob, DeleteInput, DeliverInput, ExplainInput, ExplainJob, ExplainOutput, ForecastInput, ForecastJob, Job, JobRequestSource, JobRequestSourceApiUser, JobRequestSourceProcess, MaterializedViewInput, MaterializedViewJob, MaterializedViewOutput,
|
|
3
|
+
import type { ColumnDetails, DatasetsCalculateColumnStatsJob, DatasetsDeleteTableJob, DatasetsDeliverDataJob, DatasetsSampleJob, DeleteInput, DeliverInput, ExplainInput, ExplainJob, ExplainOutput, ForecastInput, ForecastJob, Job, JobRequestSource, JobRequestSourceApiUser, JobRequestSourceProcess, MaterializedViewInput, MaterializedViewJob, MaterializedViewOutput, ModelsDeliverModelInput, ModelsDeliverModelJob, ModelTrainingRunInput, ModelTrainingRunJob, SampleInput, StatsInput } from "./types";
|
|
4
4
|
interface GetJobsParameters extends Record<string, string | number | boolean | undefined> {
|
|
5
5
|
dataset_id?: number;
|
|
6
6
|
per_page?: number;
|
package/build/jobs/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ForecastResult, JobState } from "src/forecast";
|
|
2
2
|
import type { DataStreamPurchaseDetails, ForecastDimensions, MarketplaceForecastDetails } from "src/forecast/types";
|
|
3
3
|
import type { NqlBudget } from "src/nql/types";
|
|
4
|
-
export type JobType = "forecast" | "nql-forecast" | "materialize-view" | "datasets_calculate_column_stats" | "datasets_delete_table" | "datasets_deliver_data" | "datasets_sample" | "models_deliver_model" | "model_training_run";
|
|
4
|
+
export type JobType = "forecast" | "nql-forecast" | "materialize-view" | "datasets_calculate_column_stats" | "datasets_delete_table" | "datasets_deliver_data" | "datasets_sample" | "models_deliver_model" | "models_train_classifier" | "model_training_run";
|
|
5
5
|
export interface JobRequestSource {
|
|
6
6
|
type: string;
|
|
7
7
|
company_id: number;
|
|
@@ -157,5 +157,179 @@ export interface UnknownJob extends BaseJob {
|
|
|
157
157
|
input: unknown;
|
|
158
158
|
result?: unknown;
|
|
159
159
|
}
|
|
160
|
-
export
|
|
160
|
+
export interface ModelsTrainClassifierJob extends BaseJob {
|
|
161
|
+
type: "models_train_classifier";
|
|
162
|
+
result: ModelsTrainClassifierResults;
|
|
163
|
+
}
|
|
164
|
+
export type Job = ForecastJob | ExplainJob | MaterializedViewJob | DatasetsDeleteTableJob | DatasetsDeliverDataJob | DatasetsSampleJob | DatasetsCalculateColumnStatsJob | ModelTrainingRunJob | ModelsDeliverModelJob | ModelsTrainClassifierJob | UnknownJob;
|
|
165
|
+
export interface ModelsTrainClassifierTrainingSummary {
|
|
166
|
+
total_features: number;
|
|
167
|
+
feature_types: Record<"text" | "categorical" | "embedding" | "numeric", number>;
|
|
168
|
+
test_accuracy: number;
|
|
169
|
+
num_classes: number;
|
|
170
|
+
class_names: Record<string, string>;
|
|
171
|
+
error?: unknown;
|
|
172
|
+
}
|
|
173
|
+
export interface ModelsTrainClassifierRegistryInfo {
|
|
174
|
+
model_stored: boolean;
|
|
175
|
+
model_name: string;
|
|
176
|
+
model_version: string;
|
|
177
|
+
registry_database: string;
|
|
178
|
+
registry_schema: string;
|
|
179
|
+
model_task: string;
|
|
180
|
+
}
|
|
181
|
+
export interface ModelsTrainClassifierMinimalMetrics {
|
|
182
|
+
num_classes: number;
|
|
183
|
+
class_names: Record<string, string>;
|
|
184
|
+
accuracy: number;
|
|
185
|
+
f1_macro: number;
|
|
186
|
+
precision_macro: number;
|
|
187
|
+
recall_macro: number;
|
|
188
|
+
}
|
|
189
|
+
export interface ModelsTrainClassifierConfig {
|
|
190
|
+
name: string;
|
|
191
|
+
version: string;
|
|
192
|
+
[key: string]: unknown;
|
|
193
|
+
}
|
|
194
|
+
export type ModelsTrainClassifierResults = {
|
|
195
|
+
status: "success" | "error";
|
|
196
|
+
registry_info?: ModelsTrainClassifierRegistryInfo;
|
|
197
|
+
num_categories: number;
|
|
198
|
+
rows_processed: number;
|
|
199
|
+
rows_dropped: number;
|
|
200
|
+
metrics: {
|
|
201
|
+
minimal: ModelsTrainClassifierMinimalMetrics;
|
|
202
|
+
detailed: DetailedAnalytics;
|
|
203
|
+
};
|
|
204
|
+
debug_info?: unknown;
|
|
205
|
+
config: ModelsTrainClassifierConfig;
|
|
206
|
+
training_summary: ModelsTrainClassifierTrainingSummary;
|
|
207
|
+
};
|
|
208
|
+
export type Metric<V = unknown, M extends Record<string, unknown> = Record<string, unknown>> = {
|
|
209
|
+
value: V;
|
|
210
|
+
metadata: M;
|
|
211
|
+
};
|
|
212
|
+
export interface AveragePredictionEntropy {
|
|
213
|
+
correct_predictions: number;
|
|
214
|
+
incorrect_predictions: number;
|
|
215
|
+
entropy_difference: number;
|
|
216
|
+
}
|
|
217
|
+
export interface PerClassMetricsLabeledPost {
|
|
218
|
+
class: string;
|
|
219
|
+
f1_score: number;
|
|
220
|
+
precision: number;
|
|
221
|
+
recall: number;
|
|
222
|
+
support: number;
|
|
223
|
+
avg_confidence_when_correct: number;
|
|
224
|
+
total_instances: number;
|
|
225
|
+
correct_predictions: number;
|
|
226
|
+
}
|
|
227
|
+
export interface EntropyStats {
|
|
228
|
+
min: number;
|
|
229
|
+
max: number;
|
|
230
|
+
mean: number;
|
|
231
|
+
std: number;
|
|
232
|
+
median: number;
|
|
233
|
+
perplexity_mean: number;
|
|
234
|
+
perplexity_median: number;
|
|
235
|
+
normalized_perplexity_mean: number;
|
|
236
|
+
normalized_perplexity_median: number;
|
|
237
|
+
}
|
|
238
|
+
export interface EntropyPrioritizationHistogram {
|
|
239
|
+
min: number;
|
|
240
|
+
max: number;
|
|
241
|
+
count: number;
|
|
242
|
+
inclusive_left: number;
|
|
243
|
+
inclusive_right: number;
|
|
244
|
+
}
|
|
245
|
+
export interface TopEntropyRecord {
|
|
246
|
+
entropy: number;
|
|
247
|
+
top5_predicted_classes: [string, number][];
|
|
248
|
+
ID_COLUMN: string;
|
|
249
|
+
LABEL_COLUMN: string;
|
|
250
|
+
[key: string]: unknown;
|
|
251
|
+
}
|
|
252
|
+
export interface GlobalMetrics {
|
|
253
|
+
num_documents_corpus_pre: Metric<number, never>;
|
|
254
|
+
num_documents_labeled_pre: Metric<number, never>;
|
|
255
|
+
percent_labeled_corpus_pre: Metric<number, never>;
|
|
256
|
+
label_distribution_labeled_pre: Metric<Record<string, number>, never>;
|
|
257
|
+
class_imbalance_labeled_pre: Metric<number, never>;
|
|
258
|
+
missing_values_corpus_pre: Metric<number, never>;
|
|
259
|
+
duplicate_count_corpus_pre: Metric<number, never>;
|
|
260
|
+
accuracy_labeled_post: Metric<number, never>;
|
|
261
|
+
precision_macro_labeled_post: Metric<number, never>;
|
|
262
|
+
recall_macro_labeled_post: Metric<number, never>;
|
|
263
|
+
f1_macro_labeled_post: Metric<number, never>;
|
|
264
|
+
confusion_matrix_labeled_post: Metric<number[][], never>;
|
|
265
|
+
top_n_accuracy_labeled_post: Metric<Record<string, number>, never>;
|
|
266
|
+
auc_roc_labeled_post: Metric<number, never>;
|
|
267
|
+
avg_prediction_entropy_labeled_post: Metric<AveragePredictionEntropy, never>;
|
|
268
|
+
per_class_metrics_labeled_post: Metric<PerClassMetricsLabeledPost[], never>;
|
|
269
|
+
entropy_stats: Metric<EntropyStats, never>;
|
|
270
|
+
entropy_prioritization_histogram: Metric<EntropyPrioritizationHistogram[], never>;
|
|
271
|
+
top_entropy_records: Metric<TopEntropyRecord[], never>;
|
|
272
|
+
}
|
|
273
|
+
export type TopTermsValue = Record<string, number>;
|
|
274
|
+
export interface FeatureError {
|
|
275
|
+
feature: string;
|
|
276
|
+
prevalence_diff: number;
|
|
277
|
+
incorrect_prevalence: number;
|
|
278
|
+
correct_prevalence: number;
|
|
279
|
+
ratio: number;
|
|
280
|
+
}
|
|
281
|
+
export interface ErrorConcentration {
|
|
282
|
+
feature: string;
|
|
283
|
+
records_with_feature: number;
|
|
284
|
+
errors_with_feature: number;
|
|
285
|
+
error_rate: number;
|
|
286
|
+
overall_error_rate: number;
|
|
287
|
+
error_lift: number;
|
|
288
|
+
}
|
|
289
|
+
export interface ErrorPredictionImportance {
|
|
290
|
+
feature: string;
|
|
291
|
+
correlation: number;
|
|
292
|
+
p_value: number;
|
|
293
|
+
abs_correlation: number;
|
|
294
|
+
}
|
|
295
|
+
export interface DynamicTextFeatureMetrics {
|
|
296
|
+
[key: `${string}_avg_doc_length_corpus_pre`]: Metric<number>;
|
|
297
|
+
[key: `${string}_avg_doc_length_labeled_pre`]: Metric<number>;
|
|
298
|
+
[key: `${string}_ngram_vocab_size_corpus_pre`]: Metric<number>;
|
|
299
|
+
[key: `${string}_ngram_vocab_size_labeled_pre`]: Metric<number>;
|
|
300
|
+
[key: `${string}_ngram_top_terms_corpus_pre`]: Metric<TopTermsValue>;
|
|
301
|
+
[key: `${string}_ngram_top_terms_labeled_pre`]: Metric<TopTermsValue>;
|
|
302
|
+
[key: `${string}_ngram_diversity_corpus_pre`]: Metric<number>;
|
|
303
|
+
[key: `${string}_ngram_stopword_percentage_corpus_pre`]: Metric<number>;
|
|
304
|
+
[key: `${string}_ngram_entropy_corpus_pre`]: Metric<number>;
|
|
305
|
+
[key: `${string}_ngram_oov_rate_corpus_pre`]: Metric<number>;
|
|
306
|
+
[key: `${string}_ngram_sparsity_labeled_pre`]: Metric<number>;
|
|
307
|
+
[key: `${string}_ngram_diversity_labeled_pre`]: Metric<number>;
|
|
308
|
+
[key: `${string}_ngram_stopword_percentage_labeled_pre`]: Metric<number>;
|
|
309
|
+
[key: `${string}_ngram_entropy_labeled_pre`]: Metric<number>;
|
|
310
|
+
[key: `${string}_ngram_sparsity_labeled_post`]: Metric<number>;
|
|
311
|
+
[key: `${string}_ngram_top_oov_tokens`]: Metric<string>;
|
|
312
|
+
[key: `${string}_features_prevalent_in_errors`]: Metric<FeatureError[], {
|
|
313
|
+
description: string;
|
|
314
|
+
total_correct: number;
|
|
315
|
+
total_incorrect: number;
|
|
316
|
+
analysis_type: string;
|
|
317
|
+
}>;
|
|
318
|
+
[key: `${string}_feature_error_concentration`]: Metric<ErrorConcentration[], {
|
|
319
|
+
description: string;
|
|
320
|
+
metric_type: string;
|
|
321
|
+
}>;
|
|
322
|
+
[key: `${string}_error_prediction_importance`]: Metric<ErrorPredictionImportance[], {
|
|
323
|
+
description: string;
|
|
324
|
+
metric_type: string;
|
|
325
|
+
}>;
|
|
326
|
+
[key: `${string}_ttr_corpus_pre`]: Metric<number>;
|
|
327
|
+
[key: `${string}_ttr_labeled_pre`]: Metric<number>;
|
|
328
|
+
[key: `${string}_ttr_per_class_labeled_pre`]: Metric<Record<string, number>>;
|
|
329
|
+
}
|
|
330
|
+
export type DetailedAnalytics = {
|
|
331
|
+
global: GlobalMetrics;
|
|
332
|
+
} & {
|
|
333
|
+
[dynamicKey: string]: DynamicTextFeatureMetrics;
|
|
334
|
+
};
|
|
161
335
|
export {};
|
package/build/nql/Ast.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const NqlAstTypes: {
|
|
|
8
8
|
binary_op: NqlBinaryOp;
|
|
9
9
|
case: NqlCase;
|
|
10
10
|
function: NqlFunction;
|
|
11
|
-
literal: NqlLit
|
|
11
|
+
literal: NqlLit;
|
|
12
12
|
string_literal: NqlLit<NqlStringType>;
|
|
13
13
|
long_literal: NqlLit<NqlLongType>;
|
|
14
14
|
double_literal: NqlLit<NqlDoubleType>;
|
package/build/nql/NqlBuilder.js
CHANGED
|
@@ -355,9 +355,6 @@ function compilePostfixUnaryOperator(op, operand, as, dsMap) {
|
|
|
355
355
|
function compileRawRef(nql, as) {
|
|
356
356
|
return aliased(nql, as);
|
|
357
357
|
}
|
|
358
|
-
function compileUnaryMinus(operand, as, dsMap) {
|
|
359
|
-
return aliased(`-(${compileExpression(operand, dsMap)})`, as);
|
|
360
|
-
}
|
|
361
358
|
export function compilePlaceholder(n) {
|
|
362
359
|
switch (n.expectedType) {
|
|
363
360
|
case "literal":
|
|
@@ -394,6 +391,6 @@ function isArray(ns) {
|
|
|
394
391
|
return Array.isArray(ns);
|
|
395
392
|
}
|
|
396
393
|
// typescript trick to help with checking exhaustivity of swith statements
|
|
397
|
-
function unreachable(
|
|
394
|
+
function unreachable(_x) {
|
|
398
395
|
throw new Error("unreachable");
|
|
399
396
|
}
|