@memberjunction/predictive-studio 0.0.1 → 5.44.0
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/README.md +101 -28
- package/dist/actions/base-predictive-studio.action.d.ts +63 -0
- package/dist/actions/base-predictive-studio.action.d.ts.map +1 -0
- package/dist/actions/base-predictive-studio.action.js +125 -0
- package/dist/actions/base-predictive-studio.action.js.map +1 -0
- package/dist/actions/index.d.ts +38 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +49 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/model-scoring-action-generator.d.ts +108 -0
- package/dist/actions/model-scoring-action-generator.d.ts.map +1 -0
- package/dist/actions/model-scoring-action-generator.js +316 -0
- package/dist/actions/model-scoring-action-generator.js.map +1 -0
- package/dist/actions/promote-model.action.d.ts +102 -0
- package/dist/actions/promote-model.action.d.ts.map +1 -0
- package/dist/actions/promote-model.action.js +132 -0
- package/dist/actions/promote-model.action.js.map +1 -0
- package/dist/actions/promote-model.gate.d.ts +77 -0
- package/dist/actions/promote-model.gate.d.ts.map +1 -0
- package/dist/actions/promote-model.gate.js +205 -0
- package/dist/actions/promote-model.gate.js.map +1 -0
- package/dist/actions/run-experiment.action.d.ts +60 -0
- package/dist/actions/run-experiment.action.d.ts.map +1 -0
- package/dist/actions/run-experiment.action.js +134 -0
- package/dist/actions/run-experiment.action.js.map +1 -0
- package/dist/actions/run-experiment.deps.d.ts +47 -0
- package/dist/actions/run-experiment.deps.d.ts.map +1 -0
- package/dist/actions/run-experiment.deps.js +71 -0
- package/dist/actions/run-experiment.deps.js.map +1 -0
- package/dist/actions/schedule-model-scoring.action.d.ts +71 -0
- package/dist/actions/schedule-model-scoring.action.d.ts.map +1 -0
- package/dist/actions/schedule-model-scoring.action.js +148 -0
- package/dist/actions/schedule-model-scoring.action.js.map +1 -0
- package/dist/actions/score-record-set.action.d.ts +133 -0
- package/dist/actions/score-record-set.action.d.ts.map +1 -0
- package/dist/actions/score-record-set.action.js +136 -0
- package/dist/actions/score-record-set.action.js.map +1 -0
- package/dist/actions/score-record-set.runner.d.ts +192 -0
- package/dist/actions/score-record-set.runner.d.ts.map +1 -0
- package/dist/actions/score-record-set.runner.js +416 -0
- package/dist/actions/score-record-set.runner.js.map +1 -0
- package/dist/actions/train-model.action.d.ts +57 -0
- package/dist/actions/train-model.action.d.ts.map +1 -0
- package/dist/actions/train-model.action.js +111 -0
- package/dist/actions/train-model.action.js.map +1 -0
- package/dist/agent/index.d.ts +14 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +14 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/model-dev-orchestrator-agent.d.ts +42 -0
- package/dist/agent/model-dev-orchestrator-agent.d.ts.map +1 -0
- package/dist/agent/model-dev-orchestrator-agent.js +76 -0
- package/dist/agent/model-dev-orchestrator-agent.js.map +1 -0
- package/dist/agent/modeling-plan-to-pipeline.d.ts +49 -0
- package/dist/agent/modeling-plan-to-pipeline.d.ts.map +1 -0
- package/dist/agent/modeling-plan-to-pipeline.js +101 -0
- package/dist/agent/modeling-plan-to-pipeline.js.map +1 -0
- package/dist/agent/pipeline-builder-agent.d.ts +58 -0
- package/dist/agent/pipeline-builder-agent.d.ts.map +1 -0
- package/dist/agent/pipeline-builder-agent.js +101 -0
- package/dist/agent/pipeline-builder-agent.js.map +1 -0
- package/dist/agent/pipeline-builder.d.ts +67 -0
- package/dist/agent/pipeline-builder.d.ts.map +1 -0
- package/dist/agent/pipeline-builder.js +114 -0
- package/dist/agent/pipeline-builder.js.map +1 -0
- package/dist/experiment/concurrency.d.ts +41 -0
- package/dist/experiment/concurrency.d.ts.map +1 -0
- package/dist/experiment/concurrency.js +54 -0
- package/dist/experiment/concurrency.js.map +1 -0
- package/dist/experiment/experiment-orchestrator.d.ts +136 -0
- package/dist/experiment/experiment-orchestrator.d.ts.map +1 -0
- package/dist/experiment/experiment-orchestrator.js +408 -0
- package/dist/experiment/experiment-orchestrator.js.map +1 -0
- package/dist/experiment/index.d.ts +17 -0
- package/dist/experiment/index.d.ts.map +1 -0
- package/dist/experiment/index.js +17 -0
- package/dist/experiment/index.js.map +1 -0
- package/dist/experiment/leaderboard.d.ts +50 -0
- package/dist/experiment/leaderboard.d.ts.map +1 -0
- package/dist/experiment/leaderboard.js +91 -0
- package/dist/experiment/leaderboard.js.map +1 -0
- package/dist/experiment/seams.d.ts +95 -0
- package/dist/experiment/seams.d.ts.map +1 -0
- package/dist/experiment/seams.js +126 -0
- package/dist/experiment/seams.js.map +1 -0
- package/dist/experiment/types.d.ts +228 -0
- package/dist/experiment/types.d.ts.map +1 -0
- package/dist/experiment/types.js +19 -0
- package/dist/experiment/types.js.map +1 -0
- package/dist/experiment/wave-strategist.d.ts +31 -0
- package/dist/experiment/wave-strategist.d.ts.map +1 -0
- package/dist/experiment/wave-strategist.js +50 -0
- package/dist/experiment/wave-strategist.js.map +1 -0
- package/dist/feature-assembly/as-of.d.ts +74 -0
- package/dist/feature-assembly/as-of.d.ts.map +1 -0
- package/dist/feature-assembly/as-of.js +136 -0
- package/dist/feature-assembly/as-of.js.map +1 -0
- package/dist/feature-assembly/data-access.d.ts +114 -0
- package/dist/feature-assembly/data-access.d.ts.map +1 -0
- package/dist/feature-assembly/data-access.js +68 -0
- package/dist/feature-assembly/data-access.js.map +1 -0
- package/dist/feature-assembly/feature-assembly-executor.d.ts +273 -0
- package/dist/feature-assembly/feature-assembly-executor.d.ts.map +1 -0
- package/dist/feature-assembly/feature-assembly-executor.js +521 -0
- package/dist/feature-assembly/feature-assembly-executor.js.map +1 -0
- package/dist/feature-assembly/index.d.ts +13 -0
- package/dist/feature-assembly/index.d.ts.map +1 -0
- package/dist/feature-assembly/index.js +13 -0
- package/dist/feature-assembly/index.js.map +1 -0
- package/dist/feature-assembly/leakage-guard.d.ts +86 -0
- package/dist/feature-assembly/leakage-guard.d.ts.map +1 -0
- package/dist/feature-assembly/leakage-guard.js +111 -0
- package/dist/feature-assembly/leakage-guard.js.map +1 -0
- package/dist/feature-assembly/vision-llm.d.ts +125 -0
- package/dist/feature-assembly/vision-llm.d.ts.map +1 -0
- package/dist/feature-assembly/vision-llm.js +211 -0
- package/dist/feature-assembly/vision-llm.js.map +1 -0
- package/dist/feature-pipelines/feature-pipeline-engine.d.ts +159 -0
- package/dist/feature-pipelines/feature-pipeline-engine.d.ts.map +1 -0
- package/dist/feature-pipelines/feature-pipeline-engine.js +298 -0
- package/dist/feature-pipelines/feature-pipeline-engine.js.map +1 -0
- package/dist/feature-pipelines/index.d.ts +13 -0
- package/dist/feature-pipelines/index.d.ts.map +1 -0
- package/dist/feature-pipelines/index.js +13 -0
- package/dist/feature-pipelines/index.js.map +1 -0
- package/dist/feature-pipelines/types.d.ts +72 -0
- package/dist/feature-pipelines/types.d.ts.map +1 -0
- package/dist/feature-pipelines/types.js +17 -0
- package/dist/feature-pipelines/types.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +80 -0
- package/dist/index.js.map +1 -0
- package/dist/maintenance/index.d.ts +19 -0
- package/dist/maintenance/index.d.ts.map +1 -0
- package/dist/maintenance/index.js +19 -0
- package/dist/maintenance/index.js.map +1 -0
- package/dist/maintenance/maintenance-engine.d.ts +152 -0
- package/dist/maintenance/maintenance-engine.d.ts.map +1 -0
- package/dist/maintenance/maintenance-engine.js +412 -0
- package/dist/maintenance/maintenance-engine.js.map +1 -0
- package/dist/maintenance/metrics.d.ts +37 -0
- package/dist/maintenance/metrics.d.ts.map +1 -0
- package/dist/maintenance/metrics.js +85 -0
- package/dist/maintenance/metrics.js.map +1 -0
- package/dist/maintenance/seams.d.ts +85 -0
- package/dist/maintenance/seams.d.ts.map +1 -0
- package/dist/maintenance/seams.js +166 -0
- package/dist/maintenance/seams.js.map +1 -0
- package/dist/maintenance/types.d.ts +318 -0
- package/dist/maintenance/types.d.ts.map +1 -0
- package/dist/maintenance/types.js +27 -0
- package/dist/maintenance/types.js.map +1 -0
- package/dist/operations/__tests__/helpers.d.ts +30 -0
- package/dist/operations/__tests__/helpers.d.ts.map +1 -0
- package/dist/operations/__tests__/helpers.js +44 -0
- package/dist/operations/__tests__/helpers.js.map +1 -0
- package/dist/operations/control-experiment-session.operation.d.ts +33 -0
- package/dist/operations/control-experiment-session.operation.d.ts.map +1 -0
- package/dist/operations/control-experiment-session.operation.js +71 -0
- package/dist/operations/control-experiment-session.operation.js.map +1 -0
- package/dist/operations/create-scoring-process.operation.d.ts +30 -0
- package/dist/operations/create-scoring-process.operation.d.ts.map +1 -0
- package/dist/operations/create-scoring-process.operation.js +65 -0
- package/dist/operations/create-scoring-process.operation.js.map +1 -0
- package/dist/operations/delegation.d.ts +113 -0
- package/dist/operations/delegation.d.ts.map +1 -0
- package/dist/operations/delegation.js +139 -0
- package/dist/operations/delegation.js.map +1 -0
- package/dist/operations/index.d.ts +40 -0
- package/dist/operations/index.d.ts.map +1 -0
- package/dist/operations/index.js +55 -0
- package/dist/operations/index.js.map +1 -0
- package/dist/operations/promote-model.operation.d.ts +57 -0
- package/dist/operations/promote-model.operation.d.ts.map +1 -0
- package/dist/operations/promote-model.operation.js +113 -0
- package/dist/operations/promote-model.operation.js.map +1 -0
- package/dist/operations/run-feature-pipeline.operation.d.ts +56 -0
- package/dist/operations/run-feature-pipeline.operation.d.ts.map +1 -0
- package/dist/operations/run-feature-pipeline.operation.js +94 -0
- package/dist/operations/run-feature-pipeline.operation.js.map +1 -0
- package/dist/operations/score-record-set.operation.d.ts +47 -0
- package/dist/operations/score-record-set.operation.d.ts.map +1 -0
- package/dist/operations/score-record-set.operation.js +113 -0
- package/dist/operations/score-record-set.operation.js.map +1 -0
- package/dist/operations/start-experiment-session.operation.d.ts +66 -0
- package/dist/operations/start-experiment-session.operation.d.ts.map +1 -0
- package/dist/operations/start-experiment-session.operation.js +132 -0
- package/dist/operations/start-experiment-session.operation.js.map +1 -0
- package/dist/operations/train-model.operation.d.ts +50 -0
- package/dist/operations/train-model.operation.d.ts.map +1 -0
- package/dist/operations/train-model.operation.js +114 -0
- package/dist/operations/train-model.operation.js.map +1 -0
- package/dist/scheduling/index.d.ts +13 -0
- package/dist/scheduling/index.d.ts.map +1 -0
- package/dist/scheduling/index.js +13 -0
- package/dist/scheduling/index.js.map +1 -0
- package/dist/scheduling/scheduled-model-scoring.d.ts +169 -0
- package/dist/scheduling/scheduled-model-scoring.d.ts.map +1 -0
- package/dist/scheduling/scheduled-model-scoring.js +189 -0
- package/dist/scheduling/scheduled-model-scoring.js.map +1 -0
- package/dist/scoring/artifact-loader.d.ts +65 -0
- package/dist/scoring/artifact-loader.d.ts.map +1 -0
- package/dist/scoring/artifact-loader.js +97 -0
- package/dist/scoring/artifact-loader.js.map +1 -0
- package/dist/scoring/index.d.ts +26 -0
- package/dist/scoring/index.d.ts.map +1 -0
- package/dist/scoring/index.js +26 -0
- package/dist/scoring/index.js.map +1 -0
- package/dist/scoring/ml-model-inference-processor.d.ts +154 -0
- package/dist/scoring/ml-model-inference-processor.d.ts.map +1 -0
- package/dist/scoring/ml-model-inference-processor.js +320 -0
- package/dist/scoring/ml-model-inference-processor.js.map +1 -0
- package/dist/scoring/ml-model-score-enricher.d.ts +80 -0
- package/dist/scoring/ml-model-score-enricher.d.ts.map +1 -0
- package/dist/scoring/ml-model-score-enricher.js +139 -0
- package/dist/scoring/ml-model-score-enricher.js.map +1 -0
- package/dist/scoring/register.d.ts +81 -0
- package/dist/scoring/register.d.ts.map +1 -0
- package/dist/scoring/register.js +105 -0
- package/dist/scoring/register.js.map +1 -0
- package/dist/scoring/scoring-binding.d.ts +72 -0
- package/dist/scoring/scoring-binding.d.ts.map +1 -0
- package/dist/scoring/scoring-binding.js +76 -0
- package/dist/scoring/scoring-binding.js.map +1 -0
- package/dist/scoring/scoring-process-shared.d.ts +105 -0
- package/dist/scoring/scoring-process-shared.d.ts.map +1 -0
- package/dist/scoring/scoring-process-shared.js +141 -0
- package/dist/scoring/scoring-process-shared.js.map +1 -0
- package/dist/scoring/scoring-process.d.ts +128 -0
- package/dist/scoring/scoring-process.d.ts.map +1 -0
- package/dist/scoring/scoring-process.js +146 -0
- package/dist/scoring/scoring-process.js.map +1 -0
- package/dist/scoring/seams.d.ts +40 -0
- package/dist/scoring/seams.d.ts.map +1 -0
- package/dist/scoring/seams.js +66 -0
- package/dist/scoring/seams.js.map +1 -0
- package/dist/scoring/startup-register.d.ts +49 -0
- package/dist/scoring/startup-register.d.ts.map +1 -0
- package/dist/scoring/startup-register.js +72 -0
- package/dist/scoring/startup-register.js.map +1 -0
- package/dist/scoring/types.d.ts +134 -0
- package/dist/scoring/types.d.ts.map +1 -0
- package/dist/scoring/types.js +26 -0
- package/dist/scoring/types.js.map +1 -0
- package/dist/training/artifact-store.d.ts +124 -0
- package/dist/training/artifact-store.d.ts.map +1 -0
- package/dist/training/artifact-store.js +163 -0
- package/dist/training/artifact-store.js.map +1 -0
- package/dist/training/index.d.ts +13 -0
- package/dist/training/index.d.ts.map +1 -0
- package/dist/training/index.js +13 -0
- package/dist/training/index.js.map +1 -0
- package/dist/training/seams.d.ts +57 -0
- package/dist/training/seams.d.ts.map +1 -0
- package/dist/training/seams.js +103 -0
- package/dist/training/seams.js.map +1 -0
- package/dist/training/training-engine.d.ts +96 -0
- package/dist/training/training-engine.d.ts.map +1 -0
- package/dist/training/training-engine.js +300 -0
- package/dist/training/training-engine.js.map +1 -0
- package/dist/training/types.d.ts +159 -0
- package/dist/training/types.d.ts.map +1 -0
- package/dist/training/types.js +16 -0
- package/dist/training/types.js.map +1 -0
- package/package.json +44 -7
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module training/types
|
|
3
|
+
*
|
|
4
|
+
* Dependency-injection seams and input/output shapes for the
|
|
5
|
+
* {@link TrainingEngine} (plan §3 / §4.3 / §4.4 / §8.2 / §11). Every external
|
|
6
|
+
* dependency the engine touches — entity creation, record loading, the Python
|
|
7
|
+
* sidecar, and artifact storage — is expressed as a narrow interface here so the
|
|
8
|
+
* orchestrator is unit-testable with no live database and no live sidecar.
|
|
9
|
+
*
|
|
10
|
+
* The production implementations of these seams (`MetadataEntityFactory`,
|
|
11
|
+
* `RunViewRecordLoader`, `MJSidecarTrainer`, `MJFilesArtifactStore`) are thin
|
|
12
|
+
* adapters around `Metadata.GetEntityObject`, `RunView`, `MLSidecar`, and
|
|
13
|
+
* `MJ: Files`; the tests inject in-memory fakes implementing the same contracts.
|
|
14
|
+
*/
|
|
15
|
+
import type { BaseEntity, UserInfo, IMetadataProvider } from '@memberjunction/core';
|
|
16
|
+
import type { TrainRequest, TrainResponse, ProblemType, MatrixData } from '@memberjunction/predictive-studio-core';
|
|
17
|
+
import type { MJMLTrainingPipelineEntity, MJMLModelEntity, MJMLTrainingRunEntity } from '@memberjunction/core-entities';
|
|
18
|
+
/**
|
|
19
|
+
* Factory seam for creating strongly-typed entity objects. Wraps
|
|
20
|
+
* `Metadata.GetEntityObject` in production; tests inject a fake returning
|
|
21
|
+
* in-memory entity stand-ins.
|
|
22
|
+
*/
|
|
23
|
+
export interface IEntityFactory {
|
|
24
|
+
/**
|
|
25
|
+
* Create a new, unsaved entity object for the named entity. Mirrors
|
|
26
|
+
* `Metadata.GetEntityObject<T>(entityName, contextUser)`.
|
|
27
|
+
*
|
|
28
|
+
* @param entityName MJ entity name (e.g. `MJ: ML Models`)
|
|
29
|
+
* @param contextUser request user — required on the server for isolation/audit
|
|
30
|
+
*/
|
|
31
|
+
getEntityObject<T extends BaseEntity>(entityName: string, contextUser?: UserInfo): Promise<T>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Read seam for loading existing records (the training pipeline definition and
|
|
35
|
+
* the next-version lookup). Wraps `RunView` in production; tests inject canned
|
|
36
|
+
* rows. Never throws for logical read failures (mirrors `RunView`).
|
|
37
|
+
*/
|
|
38
|
+
export interface IRecordLoader {
|
|
39
|
+
/**
|
|
40
|
+
* Load a single ML Training Pipeline by id, fully typed for mutation-free
|
|
41
|
+
* reads. Returns `null` when not found.
|
|
42
|
+
*
|
|
43
|
+
* @param pipelineId pipeline primary-key value
|
|
44
|
+
* @param contextUser request user
|
|
45
|
+
* @param provider optional provider for multi-provider correctness
|
|
46
|
+
*/
|
|
47
|
+
loadPipeline(pipelineId: string, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<MJMLTrainingPipelineEntity | null>;
|
|
48
|
+
/**
|
|
49
|
+
* Compute the next monotonic model version under a pipeline — `max(Version)+1`,
|
|
50
|
+
* or `1` when the pipeline has no prior models. Implemented as a narrow,
|
|
51
|
+
* read-only count/scan over `MJ: ML Models`.
|
|
52
|
+
*
|
|
53
|
+
* @param pipelineId pipeline primary-key value
|
|
54
|
+
* @param contextUser request user
|
|
55
|
+
* @param provider optional provider for multi-provider correctness
|
|
56
|
+
*/
|
|
57
|
+
nextModelVersion(pipelineId: string, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<number>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Sidecar seam — the `/train` call. Wraps {@link MLSidecar} from
|
|
61
|
+
* `@memberjunction/predictive-studio-sidecar` in production; tests inject a fake
|
|
62
|
+
* that returns a canned {@link TrainResponse} and captures the request so the
|
|
63
|
+
* test can assert the matrix/preprocessing/holdout shape sent to the sidecar.
|
|
64
|
+
*/
|
|
65
|
+
export interface ISidecarTrainer {
|
|
66
|
+
/**
|
|
67
|
+
* Train a model from an assembled feature matrix. The implementation is
|
|
68
|
+
* responsible for sidecar lifecycle (start/connect); the engine only calls
|
|
69
|
+
* this method.
|
|
70
|
+
*
|
|
71
|
+
* The engine carves the **locked holdout** (plan §8.2) in TypeScript before
|
|
72
|
+
* calling this — `req.data` contains ONLY the training portion (the rows the
|
|
73
|
+
* model may train and tune on). The locked-holdout rows travel separately in
|
|
74
|
+
* the optional second argument so the sidecar scores them **exactly once** and
|
|
75
|
+
* returns `holdout_metrics`; they never enter `req.data`. Keeping the holdout
|
|
76
|
+
* out of the public {@link TrainRequest} shape preserves that contract while
|
|
77
|
+
* making the carve auditable and deterministic on the orchestrator side.
|
|
78
|
+
*
|
|
79
|
+
* @param req the fully-built train request (training matrix + schema + preprocessing + validation)
|
|
80
|
+
* @param lockedHoldout the carved-off holdout matrix to score exactly once (optional)
|
|
81
|
+
*/
|
|
82
|
+
train(req: TrainRequest, lockedHoldout?: MatrixData): Promise<TrainResponse>;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Artifact-storage seam (plan §11). The serialized model artifact is persisted
|
|
86
|
+
* out-of-row and referenced by file id on the `MJ: ML Models` row
|
|
87
|
+
* (`ArtifactFileID`). The production implementation writes a `MJ: Files` record;
|
|
88
|
+
* tests use an in-memory map.
|
|
89
|
+
*/
|
|
90
|
+
export interface IArtifactStore {
|
|
91
|
+
/**
|
|
92
|
+
* Persist the serialized artifact bytes under a name and return the storage
|
|
93
|
+
* file id to record on the model.
|
|
94
|
+
*
|
|
95
|
+
* @param bytes the serialized model artifact
|
|
96
|
+
* @param name a human-readable artifact name (e.g. `model-<pipeline>-v<version>.bin`)
|
|
97
|
+
* @param contextUser request user — required on the server for isolation/audit
|
|
98
|
+
* @returns the file id to store in `MLModel.ArtifactFileID`
|
|
99
|
+
*/
|
|
100
|
+
save(bytes: Uint8Array, name: string, contextUser?: UserInfo): Promise<string>;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Input to {@link TrainingEngine.trainModel}. A standalone/manual train is the
|
|
104
|
+
* default; pass `experimentSessionIterationId` to hang the run off a generic
|
|
105
|
+
* Experiment Session Iteration (plan §4.4) during an agent-driven search.
|
|
106
|
+
*/
|
|
107
|
+
export interface TrainModelInput {
|
|
108
|
+
/** Id of the `MJ: ML Training Pipelines` row to train. */
|
|
109
|
+
pipelineId: string;
|
|
110
|
+
/**
|
|
111
|
+
* Optional `MJ: Experiment Session Iterations` id this run belongs to. NULL /
|
|
112
|
+
* omitted for a one-off standalone train outside a session.
|
|
113
|
+
*/
|
|
114
|
+
experimentSessionIterationId?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Optional per-record label-event dates (keyed by record primary key),
|
|
117
|
+
* required when the pipeline's `AsOfStrategy.Mode` is `offset` (plan §6.3).
|
|
118
|
+
*/
|
|
119
|
+
labelEventDates?: Record<string, Date>;
|
|
120
|
+
/** Optional primary-key field on the target entity (defaults to `ID`). */
|
|
121
|
+
primaryKeyField?: string;
|
|
122
|
+
/** Optional cap on training rows pulled from the target entity. */
|
|
123
|
+
maxRows?: number;
|
|
124
|
+
/** Sidecar version string recorded in model lineage (provenance). */
|
|
125
|
+
sidecarVersion?: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The injected dependency bundle passed to {@link TrainingEngine.trainModel}.
|
|
129
|
+
* Bundling the seams (rather than constructor-injecting them) keeps the engine
|
|
130
|
+
* stateless and lets a caller vary implementations per call (e.g. a different
|
|
131
|
+
* artifact store per tenant).
|
|
132
|
+
*/
|
|
133
|
+
export interface TrainingDeps {
|
|
134
|
+
/** Entity-creation seam. */
|
|
135
|
+
entityFactory: IEntityFactory;
|
|
136
|
+
/** Record-loading seam (pipeline + next-version). */
|
|
137
|
+
recordLoader: IRecordLoader;
|
|
138
|
+
/** Sidecar `/train` seam. */
|
|
139
|
+
sidecar: ISidecarTrainer;
|
|
140
|
+
/** Artifact-storage seam. */
|
|
141
|
+
artifactStore: IArtifactStore;
|
|
142
|
+
/** Request user — threaded through every entity op for isolation/audit. */
|
|
143
|
+
contextUser?: UserInfo;
|
|
144
|
+
/** Optional provider for multi-provider correctness. */
|
|
145
|
+
provider?: IMetadataProvider;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Result of a successful (or recorded-failed) training orchestration — the
|
|
149
|
+
* produced model and the run that produced it.
|
|
150
|
+
*/
|
|
151
|
+
export interface TrainModelResult {
|
|
152
|
+
/** The immutable `MJ: ML Models` row produced (Draft status). */
|
|
153
|
+
model: MJMLModelEntity;
|
|
154
|
+
/** The `MJ: ML Training Runs` row recording this attempt. */
|
|
155
|
+
run: MJMLTrainingRunEntity;
|
|
156
|
+
}
|
|
157
|
+
/** Re-export for downstream training consumers without reaching into core. */
|
|
158
|
+
export type { ProblemType };
|
|
159
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/training/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,UAAU,EACX,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EACV,0BAA0B,EAC1B,eAAe,EACf,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AAEvC;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,eAAe,CAAC,CAAC,SAAS,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC/F;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;OAOG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAC;IAEnI;;;;;;;;OAQG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7G;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,GAAG,EAAE,YAAY,EAAE,aAAa,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC9E;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;;OAQG;IACH,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAChF;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACvC,0EAA0E;IAC1E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,aAAa,EAAE,cAAc,CAAC;IAC9B,qDAAqD;IACrD,YAAY,EAAE,aAAa,CAAC;IAC5B,6BAA6B;IAC7B,OAAO,EAAE,eAAe,CAAC;IACzB,6BAA6B;IAC7B,aAAa,EAAE,cAAc,CAAC;IAC9B,2EAA2E;IAC3E,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iEAAiE;IACjE,KAAK,EAAE,eAAe,CAAC;IACvB,6DAA6D;IAC7D,GAAG,EAAE,qBAAqB,CAAC;CAC5B;AAED,8EAA8E;AAC9E,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module training/types
|
|
3
|
+
*
|
|
4
|
+
* Dependency-injection seams and input/output shapes for the
|
|
5
|
+
* {@link TrainingEngine} (plan §3 / §4.3 / §4.4 / §8.2 / §11). Every external
|
|
6
|
+
* dependency the engine touches — entity creation, record loading, the Python
|
|
7
|
+
* sidecar, and artifact storage — is expressed as a narrow interface here so the
|
|
8
|
+
* orchestrator is unit-testable with no live database and no live sidecar.
|
|
9
|
+
*
|
|
10
|
+
* The production implementations of these seams (`MetadataEntityFactory`,
|
|
11
|
+
* `RunViewRecordLoader`, `MJSidecarTrainer`, `MJFilesArtifactStore`) are thin
|
|
12
|
+
* adapters around `Metadata.GetEntityObject`, `RunView`, `MLSidecar`, and
|
|
13
|
+
* `MJ: Files`; the tests inject in-memory fakes implementing the same contracts.
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/training/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/predictive-studio",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "5.44.0",
|
|
5
|
+
"description": "MemberJunction: Predictive Studio server-side engine (feature assembly, training, inference, experiment orchestration)",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"/dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"start": "ts-node-dev src/index.ts",
|
|
13
|
+
"build": "tsc && tsc-alias -f",
|
|
14
|
+
"test": "vitest run",
|
|
15
|
+
"test:watch": "vitest",
|
|
16
|
+
"test:coverage": "vitest run --coverage",
|
|
17
|
+
"test:integration": "vitest run --config vitest.integration.config.ts"
|
|
18
|
+
},
|
|
19
|
+
"author": "MemberJunction.com",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@memberjunction/actions": "5.44.0",
|
|
23
|
+
"@memberjunction/actions-base": "5.44.0",
|
|
24
|
+
"@memberjunction/ai": "5.44.0",
|
|
25
|
+
"@memberjunction/ai-agents": "5.44.0",
|
|
26
|
+
"@memberjunction/ai-core-plus": "5.44.0",
|
|
27
|
+
"@memberjunction/core": "5.44.0",
|
|
28
|
+
"@memberjunction/core-entities": "5.44.0",
|
|
29
|
+
"@memberjunction/global": "5.44.0",
|
|
30
|
+
"@memberjunction/predictive-studio-core": "5.44.0",
|
|
31
|
+
"@memberjunction/predictive-studio-sidecar": "5.44.0",
|
|
32
|
+
"@memberjunction/record-set-processor": "5.44.0",
|
|
33
|
+
"@memberjunction/record-set-processor-base": "5.44.0",
|
|
34
|
+
"rxjs": "^7.8.2"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "24.10.11",
|
|
38
|
+
"ts-node-dev": "^2.0.0",
|
|
39
|
+
"typescript": "^5.9.3",
|
|
40
|
+
"tsc-alias": "^1.8.10",
|
|
41
|
+
"vitest": "^4.0.18"
|
|
42
|
+
},
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "https://github.com/MemberJunction/MJ"
|
|
46
|
+
}
|
|
10
47
|
}
|