@memberjunction/predictive-studio 6.2.0 → 6.3.0-edge.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 +16 -11
- package/dist/actions/base-predictive-studio.action.d.ts +7 -0
- package/dist/actions/base-predictive-studio.action.d.ts.map +1 -1
- package/dist/actions/base-predictive-studio.action.js +22 -0
- package/dist/actions/base-predictive-studio.action.js.map +1 -1
- package/dist/actions/driver-classes.d.ts +2 -0
- package/dist/actions/driver-classes.d.ts.map +1 -1
- package/dist/actions/driver-classes.js +2 -0
- package/dist/actions/driver-classes.js.map +1 -1
- package/dist/actions/evaluate-drift.action.d.ts +100 -0
- package/dist/actions/evaluate-drift.action.d.ts.map +1 -0
- package/dist/actions/evaluate-drift.action.js +512 -0
- package/dist/actions/evaluate-drift.action.js.map +1 -0
- package/dist/actions/index.d.ts +3 -0
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +7 -0
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/migrate-pipelines.action.d.ts +19 -0
- package/dist/actions/migrate-pipelines.action.d.ts.map +1 -0
- package/dist/actions/migrate-pipelines.action.js +51 -0
- package/dist/actions/migrate-pipelines.action.js.map +1 -0
- package/dist/actions/promote-model.action.d.ts +12 -1
- package/dist/actions/promote-model.action.d.ts.map +1 -1
- package/dist/actions/promote-model.action.js +7 -2
- package/dist/actions/promote-model.action.js.map +1 -1
- package/dist/actions/promote-model.gate.d.ts +31 -2
- package/dist/actions/promote-model.gate.d.ts.map +1 -1
- package/dist/actions/promote-model.gate.js +84 -5
- package/dist/actions/promote-model.gate.js.map +1 -1
- package/dist/actions/run-experiment.action.d.ts.map +1 -1
- package/dist/actions/run-experiment.action.js +5 -4
- package/dist/actions/run-experiment.action.js.map +1 -1
- package/dist/actions/schedule-model-scoring.action.js +2 -2
- package/dist/actions/schedule-model-scoring.action.js.map +1 -1
- package/dist/actions/score-record-set.action.js +1 -1
- package/dist/actions/score-record-set.action.js.map +1 -1
- package/dist/actions/score-record-set.runner.d.ts +2 -2
- package/dist/actions/score-record-set.runner.js +3 -3
- package/dist/actions/score-record-set.runner.js.map +1 -1
- package/dist/actions/train-model.action.d.ts +28 -25
- package/dist/actions/train-model.action.d.ts.map +1 -1
- package/dist/actions/train-model.action.js +50 -39
- package/dist/actions/train-model.action.js.map +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/modeling-plan-to-pipeline.d.ts +0 -2
- package/dist/agent/modeling-plan-to-pipeline.d.ts.map +1 -1
- package/dist/agent/modeling-plan-to-pipeline.js +30 -39
- package/dist/agent/modeling-plan-to-pipeline.js.map +1 -1
- package/dist/agent/pipeline-builder-agent.d.ts +47 -18
- package/dist/agent/pipeline-builder-agent.d.ts.map +1 -1
- package/dist/agent/pipeline-builder-agent.js +161 -92
- package/dist/agent/pipeline-builder-agent.js.map +1 -1
- package/dist/agent/pipeline-builder.d.ts +178 -56
- package/dist/agent/pipeline-builder.d.ts.map +1 -1
- package/dist/agent/pipeline-builder.js +333 -234
- package/dist/agent/pipeline-builder.js.map +1 -1
- package/dist/experiment/budget.d.ts +61 -0
- package/dist/experiment/budget.d.ts.map +1 -0
- package/dist/experiment/budget.js +72 -0
- package/dist/experiment/budget.js.map +1 -0
- package/dist/experiment/experiment-orchestrator.d.ts +43 -7
- package/dist/experiment/experiment-orchestrator.d.ts.map +1 -1
- package/dist/experiment/experiment-orchestrator.js +130 -33
- package/dist/experiment/experiment-orchestrator.js.map +1 -1
- package/dist/experiment/index.d.ts +2 -0
- package/dist/experiment/index.d.ts.map +1 -1
- package/dist/experiment/index.js +2 -0
- package/dist/experiment/index.js.map +1 -1
- package/dist/experiment/leaderboard.d.ts +15 -15
- package/dist/experiment/leaderboard.d.ts.map +1 -1
- package/dist/experiment/leaderboard.js +44 -18
- package/dist/experiment/leaderboard.js.map +1 -1
- package/dist/experiment/scores.d.ts +32 -0
- package/dist/experiment/scores.d.ts.map +1 -0
- package/dist/experiment/scores.js +62 -0
- package/dist/experiment/scores.js.map +1 -0
- package/dist/experiment/seams.d.ts +23 -20
- package/dist/experiment/seams.d.ts.map +1 -1
- package/dist/experiment/seams.js +54 -56
- package/dist/experiment/seams.js.map +1 -1
- package/dist/experiment/types.d.ts +55 -10
- package/dist/experiment/types.d.ts.map +1 -1
- package/dist/experiment/types.js.map +1 -1
- package/dist/feature-assembly/as-of/as-of-assembler.d.ts +412 -0
- package/dist/feature-assembly/as-of/as-of-assembler.d.ts.map +1 -0
- package/dist/feature-assembly/as-of/as-of-assembler.js +1239 -0
- package/dist/feature-assembly/as-of/as-of-assembler.js.map +1 -0
- package/dist/feature-assembly/as-of/feature-resolution.d.ts +84 -0
- package/dist/feature-assembly/as-of/feature-resolution.d.ts.map +1 -0
- package/dist/feature-assembly/as-of/feature-resolution.js +229 -0
- package/dist/feature-assembly/as-of/feature-resolution.js.map +1 -0
- package/dist/feature-assembly/as-of/index.d.ts +15 -0
- package/dist/feature-assembly/as-of/index.d.ts.map +1 -0
- package/dist/feature-assembly/as-of/index.js +15 -0
- package/dist/feature-assembly/as-of/index.js.map +1 -0
- package/dist/feature-assembly/as-of/read-by-keys.d.ts +30 -0
- package/dist/feature-assembly/as-of/read-by-keys.d.ts.map +1 -0
- package/dist/feature-assembly/as-of/read-by-keys.js +51 -0
- package/dist/feature-assembly/as-of/read-by-keys.js.map +1 -0
- package/dist/feature-assembly/as-of/record-history.d.ts +256 -0
- package/dist/feature-assembly/as-of/record-history.d.ts.map +1 -0
- package/dist/feature-assembly/as-of/record-history.js +505 -0
- package/dist/feature-assembly/as-of/record-history.js.map +1 -0
- package/dist/feature-assembly/as-of/refusal.d.ts +19 -0
- package/dist/feature-assembly/as-of/refusal.d.ts.map +1 -0
- package/dist/feature-assembly/as-of/refusal.js +13 -0
- package/dist/feature-assembly/as-of/refusal.js.map +1 -0
- package/dist/feature-assembly/as-of/series-features.d.ts +65 -0
- package/dist/feature-assembly/as-of/series-features.d.ts.map +1 -0
- package/dist/feature-assembly/as-of/series-features.js +97 -0
- package/dist/feature-assembly/as-of/series-features.js.map +1 -0
- package/dist/feature-assembly/as-of/windowed-aggregate.d.ts +36 -0
- package/dist/feature-assembly/as-of/windowed-aggregate.d.ts.map +1 -0
- package/dist/feature-assembly/as-of/windowed-aggregate.js +99 -0
- package/dist/feature-assembly/as-of/windowed-aggregate.js.map +1 -0
- package/dist/feature-assembly/as-of.d.ts +1 -9
- package/dist/feature-assembly/as-of.d.ts.map +1 -1
- package/dist/feature-assembly/as-of.js +2 -19
- package/dist/feature-assembly/as-of.js.map +1 -1
- package/dist/feature-assembly/assembly-metadata.d.ts +34 -0
- package/dist/feature-assembly/assembly-metadata.d.ts.map +1 -0
- package/dist/feature-assembly/assembly-metadata.js +26 -0
- package/dist/feature-assembly/assembly-metadata.js.map +1 -0
- package/dist/feature-assembly/data-access.d.ts +21 -2
- package/dist/feature-assembly/data-access.d.ts.map +1 -1
- package/dist/feature-assembly/data-access.js +14 -0
- package/dist/feature-assembly/data-access.js.map +1 -1
- package/dist/feature-assembly/feature-assembly-executor.d.ts.map +1 -1
- package/dist/feature-assembly/feature-assembly-executor.js +5 -2
- package/dist/feature-assembly/feature-assembly-executor.js.map +1 -1
- package/dist/feature-assembly/index.d.ts +3 -0
- package/dist/feature-assembly/index.d.ts.map +1 -1
- package/dist/feature-assembly/index.js +3 -0
- package/dist/feature-assembly/index.js.map +1 -1
- package/dist/feature-assembly/leakage-guard.d.ts +1 -1
- package/dist/feature-assembly/leakage-guard.js +1 -1
- package/dist/feature-assembly/read-policy.d.ts +27 -0
- package/dist/feature-assembly/read-policy.d.ts.map +1 -0
- package/dist/feature-assembly/read-policy.js +63 -0
- package/dist/feature-assembly/read-policy.js.map +1 -0
- package/dist/feature-pipelines/feature-pipeline-engine.d.ts.map +1 -1
- package/dist/feature-pipelines/feature-pipeline-engine.js +3 -1
- package/dist/feature-pipelines/feature-pipeline-engine.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/dist/maintenance/index.d.ts +1 -0
- package/dist/maintenance/index.d.ts.map +1 -1
- package/dist/maintenance/index.js +1 -0
- package/dist/maintenance/index.js.map +1 -1
- package/dist/maintenance/maintenance-engine.d.ts +16 -19
- package/dist/maintenance/maintenance-engine.d.ts.map +1 -1
- package/dist/maintenance/maintenance-engine.js +53 -53
- package/dist/maintenance/maintenance-engine.js.map +1 -1
- package/dist/maintenance/metrics.d.ts +19 -15
- package/dist/maintenance/metrics.d.ts.map +1 -1
- package/dist/maintenance/metrics.js +29 -24
- package/dist/maintenance/metrics.js.map +1 -1
- package/dist/maintenance/psi-drift-detector.d.ts +246 -0
- package/dist/maintenance/psi-drift-detector.d.ts.map +1 -0
- package/dist/maintenance/psi-drift-detector.js +1002 -0
- package/dist/maintenance/psi-drift-detector.js.map +1 -0
- package/dist/maintenance/types.d.ts +11 -2
- package/dist/maintenance/types.d.ts.map +1 -1
- package/dist/maintenance/types.js.map +1 -1
- package/dist/migration/index.d.ts +8 -0
- package/dist/migration/index.d.ts.map +1 -0
- package/dist/migration/index.js +8 -0
- package/dist/migration/index.js.map +1 -0
- package/dist/migration/legacy-pipeline-migration.d.ts +138 -0
- package/dist/migration/legacy-pipeline-migration.d.ts.map +1 -0
- package/dist/migration/legacy-pipeline-migration.js +273 -0
- package/dist/migration/legacy-pipeline-migration.js.map +1 -0
- package/dist/operations/delegation.d.ts +58 -46
- package/dist/operations/delegation.d.ts.map +1 -1
- package/dist/operations/delegation.js +90 -77
- package/dist/operations/delegation.js.map +1 -1
- package/dist/operations/promote-model.operation.d.ts +2 -2
- package/dist/operations/promote-model.operation.d.ts.map +1 -1
- package/dist/operations/promote-model.operation.js +6 -2
- package/dist/operations/promote-model.operation.js.map +1 -1
- package/dist/operations/refusals.d.ts +5 -0
- package/dist/operations/refusals.d.ts.map +1 -1
- package/dist/operations/refusals.js +26 -1
- package/dist/operations/refusals.js.map +1 -1
- package/dist/operations/start-experiment-session.operation.js +3 -3
- package/dist/operations/train-model.mapping.d.ts +91 -0
- package/dist/operations/train-model.mapping.d.ts.map +1 -0
- package/dist/operations/train-model.mapping.js +145 -0
- package/dist/operations/train-model.mapping.js.map +1 -0
- package/dist/operations/train-model.operation.d.ts +14 -9
- package/dist/operations/train-model.operation.d.ts.map +1 -1
- package/dist/operations/train-model.operation.js +30 -51
- package/dist/operations/train-model.operation.js.map +1 -1
- package/dist/prediction-unit/decision-date-advance.d.ts +46 -0
- package/dist/prediction-unit/decision-date-advance.d.ts.map +1 -0
- package/dist/prediction-unit/decision-date-advance.js +79 -0
- package/dist/prediction-unit/decision-date-advance.js.map +1 -0
- package/dist/prediction-unit/index.d.ts +12 -0
- package/dist/prediction-unit/index.d.ts.map +1 -0
- package/dist/prediction-unit/index.js +12 -0
- package/dist/prediction-unit/index.js.map +1 -0
- package/dist/prediction-unit/target-validation.d.ts +21 -0
- package/dist/prediction-unit/target-validation.d.ts.map +1 -0
- package/dist/prediction-unit/target-validation.js +54 -0
- package/dist/prediction-unit/target-validation.js.map +1 -0
- package/dist/prediction-unit/unit-row-reader.d.ts +108 -0
- package/dist/prediction-unit/unit-row-reader.d.ts.map +1 -0
- package/dist/prediction-unit/unit-row-reader.js +348 -0
- package/dist/prediction-unit/unit-row-reader.js.map +1 -0
- package/dist/prediction-unit/unit-store.d.ts +28 -0
- package/dist/prediction-unit/unit-store.d.ts.map +1 -0
- package/dist/prediction-unit/unit-store.js +41 -0
- package/dist/prediction-unit/unit-store.js.map +1 -0
- package/dist/prediction-unit/unit-versioning.d.ts +43 -0
- package/dist/prediction-unit/unit-versioning.d.ts.map +1 -0
- package/dist/prediction-unit/unit-versioning.js +71 -0
- package/dist/prediction-unit/unit-versioning.js.map +1 -0
- package/dist/protocol/index.d.ts +9 -0
- package/dist/protocol/index.d.ts.map +1 -0
- package/dist/protocol/index.js +9 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/protocol-defaults.d.ts +37 -0
- package/dist/protocol/protocol-defaults.d.ts.map +1 -0
- package/dist/protocol/protocol-defaults.js +59 -0
- package/dist/protocol/protocol-defaults.js.map +1 -0
- package/dist/protocol/protocol-versioning.d.ts +46 -0
- package/dist/protocol/protocol-versioning.d.ts.map +1 -0
- package/dist/protocol/protocol-versioning.js +48 -0
- package/dist/protocol/protocol-versioning.js.map +1 -0
- package/dist/protocol/search-guard.d.ts +45 -0
- package/dist/protocol/search-guard.d.ts.map +1 -0
- package/dist/protocol/search-guard.js +50 -0
- package/dist/protocol/search-guard.js.map +1 -0
- package/dist/scoring/artifact-loader.d.ts +5 -32
- package/dist/scoring/artifact-loader.d.ts.map +1 -1
- package/dist/scoring/artifact-loader.js +4 -59
- package/dist/scoring/artifact-loader.js.map +1 -1
- package/dist/scoring/auto-train.d.ts +25 -5
- package/dist/scoring/auto-train.d.ts.map +1 -1
- package/dist/scoring/auto-train.js +48 -31
- package/dist/scoring/auto-train.js.map +1 -1
- package/dist/scoring/index.d.ts +3 -0
- package/dist/scoring/index.d.ts.map +1 -1
- package/dist/scoring/index.js +3 -0
- package/dist/scoring/index.js.map +1 -1
- package/dist/scoring/ml-model-inference-processor.d.ts +137 -10
- package/dist/scoring/ml-model-inference-processor.d.ts.map +1 -1
- package/dist/scoring/ml-model-inference-processor.js +383 -40
- package/dist/scoring/ml-model-inference-processor.js.map +1 -1
- package/dist/scoring/model-readiness.d.ts +45 -0
- package/dist/scoring/model-readiness.d.ts.map +1 -1
- package/dist/scoring/model-readiness.js +49 -0
- package/dist/scoring/model-readiness.js.map +1 -1
- package/dist/scoring/register.d.ts +8 -3
- package/dist/scoring/register.d.ts.map +1 -1
- package/dist/scoring/register.js +28 -4
- package/dist/scoring/register.js.map +1 -1
- package/dist/scoring/seams.d.ts +18 -2
- package/dist/scoring/seams.d.ts.map +1 -1
- package/dist/scoring/seams.js +35 -10
- package/dist/scoring/seams.js.map +1 -1
- package/dist/scoring/shadow-scoring.d.ts +245 -0
- package/dist/scoring/shadow-scoring.d.ts.map +1 -0
- package/dist/scoring/shadow-scoring.js +510 -0
- package/dist/scoring/shadow-scoring.js.map +1 -0
- package/dist/scoring/startup-register.d.ts +3 -3
- package/dist/scoring/startup-register.d.ts.map +1 -1
- package/dist/scoring/startup-register.js +10 -4
- package/dist/scoring/startup-register.js.map +1 -1
- package/dist/scoring/storage-provider-artifact-loader.d.ts +14 -0
- package/dist/scoring/storage-provider-artifact-loader.d.ts.map +1 -0
- package/dist/scoring/storage-provider-artifact-loader.js +47 -0
- package/dist/scoring/storage-provider-artifact-loader.js.map +1 -0
- package/dist/scoring/training-keys.d.ts +27 -0
- package/dist/scoring/training-keys.d.ts.map +1 -0
- package/dist/scoring/training-keys.js +54 -0
- package/dist/scoring/training-keys.js.map +1 -0
- package/dist/scoring/types.d.ts +72 -7
- package/dist/scoring/types.d.ts.map +1 -1
- package/dist/scoring/types.js +4 -0
- package/dist/scoring/types.js.map +1 -1
- package/dist/sidecar-provider.d.ts +2 -2
- package/dist/sidecar-provider.js +3 -3
- package/dist/snapshot/code-version.d.ts +16 -0
- package/dist/snapshot/code-version.d.ts.map +1 -0
- package/dist/snapshot/code-version.js +39 -0
- package/dist/snapshot/code-version.js.map +1 -0
- package/dist/snapshot/holdout-carver.d.ts +110 -0
- package/dist/snapshot/holdout-carver.d.ts.map +1 -0
- package/dist/snapshot/holdout-carver.js +171 -0
- package/dist/snapshot/holdout-carver.js.map +1 -0
- package/dist/snapshot/index.d.ts +17 -0
- package/dist/snapshot/index.d.ts.map +1 -0
- package/dist/snapshot/index.js +17 -0
- package/dist/snapshot/index.js.map +1 -0
- package/dist/snapshot/snapshot-builder.d.ts +152 -0
- package/dist/snapshot/snapshot-builder.d.ts.map +1 -0
- package/dist/snapshot/snapshot-builder.js +286 -0
- package/dist/snapshot/snapshot-builder.js.map +1 -0
- package/dist/snapshot/snapshot-file-store.d.ts +161 -0
- package/dist/snapshot/snapshot-file-store.d.ts.map +1 -0
- package/dist/snapshot/snapshot-file-store.js +204 -0
- package/dist/snapshot/snapshot-file-store.js.map +1 -0
- package/dist/snapshot/snapshot-hash.d.ts +6 -0
- package/dist/snapshot/snapshot-hash.d.ts.map +1 -0
- package/dist/snapshot/snapshot-hash.js +16 -0
- package/dist/snapshot/snapshot-hash.js.map +1 -0
- package/dist/snapshot/snapshot-manifest.d.ts +43 -0
- package/dist/snapshot/snapshot-manifest.d.ts.map +1 -0
- package/dist/snapshot/snapshot-manifest.js +43 -0
- package/dist/snapshot/snapshot-manifest.js.map +1 -0
- package/dist/snapshot/snapshot-retrainer.d.ts +107 -0
- package/dist/snapshot/snapshot-retrainer.d.ts.map +1 -0
- package/dist/snapshot/snapshot-retrainer.js +194 -0
- package/dist/snapshot/snapshot-retrainer.js.map +1 -0
- package/dist/snapshot/snapshot-serialization.d.ts +99 -0
- package/dist/snapshot/snapshot-serialization.d.ts.map +1 -0
- package/dist/snapshot/snapshot-serialization.js +191 -0
- package/dist/snapshot/snapshot-serialization.js.map +1 -0
- package/dist/snapshot/training-snapshot-store.d.ts +38 -0
- package/dist/snapshot/training-snapshot-store.d.ts.map +1 -0
- package/dist/snapshot/training-snapshot-store.js +41 -0
- package/dist/snapshot/training-snapshot-store.js.map +1 -0
- package/dist/storage/ps-storage-provider.d.ts +108 -0
- package/dist/storage/ps-storage-provider.d.ts.map +1 -0
- package/dist/storage/ps-storage-provider.js +154 -0
- package/dist/storage/ps-storage-provider.js.map +1 -0
- package/dist/training/artifact-store.d.ts +12 -103
- package/dist/training/artifact-store.d.ts.map +1 -1
- package/dist/training/artifact-store.js +13 -137
- package/dist/training/artifact-store.js.map +1 -1
- package/dist/training/compute-cost.d.ts +23 -0
- package/dist/training/compute-cost.d.ts.map +1 -0
- package/dist/training/compute-cost.js +36 -0
- package/dist/training/compute-cost.js.map +1 -0
- package/dist/training/evaluation-protocol-store.d.ts +53 -0
- package/dist/training/evaluation-protocol-store.d.ts.map +1 -0
- package/dist/training/evaluation-protocol-store.js +54 -0
- package/dist/training/evaluation-protocol-store.js.map +1 -0
- package/dist/training/index.d.ts +9 -1
- package/dist/training/index.d.ts.map +1 -1
- package/dist/training/index.js +9 -1
- package/dist/training/index.js.map +1 -1
- package/dist/training/locked-holdout.d.ts +19 -4
- package/dist/training/locked-holdout.d.ts.map +1 -1
- package/dist/training/locked-holdout.js +29 -5
- package/dist/training/locked-holdout.js.map +1 -1
- package/dist/training/seams.d.ts +34 -8
- package/dist/training/seams.d.ts.map +1 -1
- package/dist/training/seams.js +74 -18
- package/dist/training/seams.js.map +1 -1
- package/dist/training/storage-provider-artifact-store.d.ts +49 -0
- package/dist/training/storage-provider-artifact-store.d.ts.map +1 -0
- package/dist/training/storage-provider-artifact-store.js +147 -0
- package/dist/training/storage-provider-artifact-store.js.map +1 -0
- package/dist/training/trainer-model-lineage.d.ts +32 -0
- package/dist/training/trainer-model-lineage.d.ts.map +1 -0
- package/dist/training/trainer-model-lineage.js +62 -0
- package/dist/training/trainer-model-lineage.js.map +1 -0
- package/dist/training/trainer-request.d.ts +50 -0
- package/dist/training/trainer-request.d.ts.map +1 -0
- package/dist/training/trainer-request.js +65 -0
- package/dist/training/trainer-request.js.map +1 -0
- package/dist/training/trainer-result.d.ts +30 -0
- package/dist/training/trainer-result.d.ts.map +1 -0
- package/dist/training/trainer-result.js +40 -0
- package/dist/training/trainer-result.js.map +1 -0
- package/dist/training/training-engine.d.ts +417 -64
- package/dist/training/training-engine.d.ts.map +1 -1
- package/dist/training/training-engine.js +869 -178
- package/dist/training/training-engine.js.map +1 -1
- package/dist/training/training-refusal.d.ts +15 -0
- package/dist/training/training-refusal.d.ts.map +1 -0
- package/dist/training/training-refusal.js +62 -0
- package/dist/training/training-refusal.js.map +1 -0
- package/dist/training/types.d.ts +133 -41
- package/dist/training/types.d.ts.map +1 -1
- package/dist/training/types.js +4 -4
- package/dist/training/unit-model-lineage.d.ts +72 -0
- package/dist/training/unit-model-lineage.d.ts.map +1 -0
- package/dist/training/unit-model-lineage.js +288 -0
- package/dist/training/unit-model-lineage.js.map +1 -0
- package/package.json +16 -13
- package/dist/operations/__tests__/helpers.d.ts +0 -30
- package/dist/operations/__tests__/helpers.d.ts.map +0 -1
- package/dist/operations/__tests__/helpers.js +0 -44
- package/dist/operations/__tests__/helpers.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-row-reader.js","sourceRoot":"","sources":["../../src/prediction-unit/unit-row-reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAkB,aAAa,EAAE,cAAc,EAA6K,MAAM,wCAAwC,CAAC;AAE1R,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AA8CjE,MAAM,OAAO,uBAAuB;IAClC,+HAA+H;IACxH,MAAM,CAAC,cAAc,CAAC,KAAgB,EAAE,IAAc;QAC3D,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QACvD,IAAI,aAAa,CAAC,oBAAoB,CAAC,IAAI,CAAC;YAAE,OAAO,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACrF,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5E,IAAI,OAAO,KAAK,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,IAAI,KAAK,YAAY,IAAI;YAAE,OAAO,IAAI,CAAC;QACvC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAChC,MAAM,CAAC,GAAG,MAAM,CAAC,CA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AE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;QACzE,CAAC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module prediction-unit/unit-store
|
|
3
|
+
*
|
|
4
|
+
* Loading unit versions for training, and writing a unit onto a pipeline (the legacy TargetEntityID/TargetVariable/
|
|
5
|
+
* ProblemType columns are derived from the unit and checked by the pipeline's ValidateAsync).
|
|
6
|
+
*/
|
|
7
|
+
import { type IMetadataProvider, type UserInfo } from '@memberjunction/core';
|
|
8
|
+
import type { MJMLTrainingPipelineEntity, MJMLPredictionUnitEntity } from '@memberjunction/core-entities';
|
|
9
|
+
import { type PredictionUnitSpec } from '@memberjunction/predictive-studio-core';
|
|
10
|
+
import type { IAssemblyMetadata } from '../feature-assembly/assembly-metadata.js';
|
|
11
|
+
/** Reads unit versions by ID and by lineage. */
|
|
12
|
+
export interface IPredictionUnitStore {
|
|
13
|
+
Load(unitId: string): Promise<MJMLPredictionUnitEntity | null>;
|
|
14
|
+
LatestVersion(lineageRootId: string): Promise<MJMLPredictionUnitEntity | null>;
|
|
15
|
+
}
|
|
16
|
+
/** Reads unit versions through the request's provider (never the global one, so each request reads its own connection). */
|
|
17
|
+
export declare class RunViewPredictionUnitStore implements IPredictionUnitStore {
|
|
18
|
+
private readonly contextUser?;
|
|
19
|
+
private readonly runView;
|
|
20
|
+
constructor(provider: IMetadataProvider, contextUser?: UserInfo);
|
|
21
|
+
/** The unit version with this ID, or null. */
|
|
22
|
+
Load(unitId: string): Promise<MJMLPredictionUnitEntity | null>;
|
|
23
|
+
/** The highest Version of a lineage, or null. */
|
|
24
|
+
LatestVersion(lineageRootId: string): Promise<MJMLPredictionUnitEntity | null>;
|
|
25
|
+
/** Point a pipeline at a unit version and derive its legacy target columns. */
|
|
26
|
+
static ApplyUnitToPipeline(pipeline: MJMLTrainingPipelineEntity, unitId: string, spec: PredictionUnitSpec, metadata: IAssemblyMetadata): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=unit-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-store.d.ts","sourceRoot":"","sources":["../../src/prediction-unit/unit-store.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAW,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEtF,OAAO,KAAK,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAiC,KAAK,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAChH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,gDAAgD;AAChD,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC;IAC/D,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC;CAChF;AAED,2HAA2H;AAC3H,qBAAa,0BAA2B,YAAW,oBAAoB;IAE5B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IADtE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;gBACtB,QAAQ,EAAE,iBAAiB,EAAmB,WAAW,CAAC,EAAE,QAAQ;IAIhF,8CAA8C;IACjC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC;IAM3E,iDAAiD;IACpC,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC;IAM3F,+EAA+E;WACjE,mBAAmB,CAAC,QAAQ,EAAE,0BAA0B,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI;CAQrJ"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module prediction-unit/unit-store
|
|
3
|
+
*
|
|
4
|
+
* Loading unit versions for training, and writing a unit onto a pipeline (the legacy TargetEntityID/TargetVariable/
|
|
5
|
+
* ProblemType columns are derived from the unit and checked by the pipeline's ValidateAsync).
|
|
6
|
+
*/
|
|
7
|
+
import { RunView } from '@memberjunction/core';
|
|
8
|
+
import { EscapeSQLString } from '@memberjunction/global';
|
|
9
|
+
import { PredictionUnit, TaskTypeRules } from '@memberjunction/predictive-studio-core';
|
|
10
|
+
/** Reads unit versions through the request's provider (never the global one, so each request reads its own connection). */
|
|
11
|
+
export class RunViewPredictionUnitStore {
|
|
12
|
+
constructor(provider, contextUser) {
|
|
13
|
+
this.contextUser = contextUser;
|
|
14
|
+
this.runView = RunView.FromMetadataProvider(provider);
|
|
15
|
+
}
|
|
16
|
+
/** The unit version with this ID, or null. */
|
|
17
|
+
async Load(unitId) {
|
|
18
|
+
const r = await this.runView.RunView({ EntityName: 'MJ: ML Prediction Units', ExtraFilter: `ID='${EscapeSQLString(unitId)}'`, ResultType: 'entity_object' }, this.contextUser);
|
|
19
|
+
if (!r.Success)
|
|
20
|
+
throw new Error(`Loading Prediction Unit ${unitId} failed: ${r.ErrorMessage}`);
|
|
21
|
+
return r.Results[0] || null;
|
|
22
|
+
}
|
|
23
|
+
/** The highest Version of a lineage, or null. */
|
|
24
|
+
async LatestVersion(lineageRootId) {
|
|
25
|
+
const r = await this.runView.RunView({ EntityName: 'MJ: ML Prediction Units', ExtraFilter: `LineageRootID='${EscapeSQLString(lineageRootId)}'`, OrderBy: 'Version DESC', MaxRows: 1, ResultType: 'entity_object' }, this.contextUser);
|
|
26
|
+
if (!r.Success)
|
|
27
|
+
throw new Error(`Loading the latest version of ${lineageRootId} failed: ${r.ErrorMessage}`);
|
|
28
|
+
return r.Results[0] || null;
|
|
29
|
+
}
|
|
30
|
+
/** Point a pipeline at a unit version and derive its legacy target columns. */
|
|
31
|
+
static ApplyUnitToPipeline(pipeline, unitId, spec, metadata) {
|
|
32
|
+
const rowEntity = metadata.Entity(PredictionUnit.UnitRowEntityName(spec.rows));
|
|
33
|
+
if (!rowEntity)
|
|
34
|
+
throw new Error(`Prediction Unit row entity "${PredictionUnit.UnitRowEntityName(spec.rows)}" is not registered`);
|
|
35
|
+
pipeline.PredictionUnitID = unitId;
|
|
36
|
+
pipeline.TargetEntityID = rowEntity.ID;
|
|
37
|
+
pipeline.TargetVariable = PredictionUnit.DescribeLabelRule(spec);
|
|
38
|
+
pipeline.ProblemType = TaskTypeRules.LegacyProblemTypeForTask(spec.label.outcome);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=unit-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-store.js","sourceRoot":"","sources":["../../src/prediction-unit/unit-store.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAyC,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,aAAa,EAA2B,MAAM,wCAAwC,CAAC;AAShH,2HAA2H;AAC3H,MAAM,OAAO,0BAA0B;IAErC,YAAY,QAA2B,EAAmB,WAAsB;QAAtB,gBAAW,GAAX,WAAW,CAAW;QAC9E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC;IAED,8CAA8C;IACvC,KAAK,CAAC,IAAI,CAAC,MAAc;QAC9B,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAA2B,EAAE,UAAU,EAAE,yBAAyB,EAAE,WAAW,EAAE,OAAO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,GAAG,SAAS,CAAC,EAAE,CAAC;QACvC,QAAQ,CAAC,cAAc,GAAG,cAAc,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjE,QAAQ,CAAC,WAAW,GAAG,aAAa,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACpF,CAAC;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module prediction-unit/unit-versioning
|
|
3
|
+
*
|
|
4
|
+
* Creating unit versions. Version 1 is its own lineage root; every later version copies the latest version,
|
|
5
|
+
* applies the changes, takes Version = latest + 1 and LabelVersion = previous + 1 exactly when the outcome definition
|
|
6
|
+
* changed. A saved version is never updated (the server subclass refuses it).
|
|
7
|
+
*/
|
|
8
|
+
import type { UserInfo } from '@memberjunction/core';
|
|
9
|
+
import type { MJMLPredictionUnitEntity } from '@memberjunction/core-entities';
|
|
10
|
+
import { type Actor, type UnitDraft, type UnitVersionWrite } from '@memberjunction/predictive-studio-core';
|
|
11
|
+
import type { IEntityFactory } from '../training/types.js';
|
|
12
|
+
/** Creating unit versions: build each version's draft and row identity, write it with Core's row writer, save it. */
|
|
13
|
+
export declare class PredictionUnitVersioning {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the outcome definition (rule, window, gap, task) changed, decided the way the server decides it: both drafts
|
|
16
|
+
* are parsed as stored rows and compared with `PredictionUnit.LabelDefinitionChanged`, so key order or members the
|
|
17
|
+
* parser drops never make a meaning-identical edit look like a change.
|
|
18
|
+
*/
|
|
19
|
+
private static labelDefinitionChanged;
|
|
20
|
+
/** A draft read back through the row parser; the identity columns are fixed because the comparison never reads them. */
|
|
21
|
+
private static parseDraft;
|
|
22
|
+
/**
|
|
23
|
+
* Pure: the draft and row identity of the next version — `changes` over the previous draft, Version = latest + 1 under
|
|
24
|
+
* the same lineage root, the label version bumped exactly when the outcome definition changed, the ID left to the
|
|
25
|
+
* database. Throws when the previous or the changed draft does not parse.
|
|
26
|
+
*/
|
|
27
|
+
static BuildNextVersion(lineage: {
|
|
28
|
+
readonly lineageRootId: string;
|
|
29
|
+
readonly latestVersion: number;
|
|
30
|
+
readonly previousLabelVersion: number;
|
|
31
|
+
readonly previous: UnitDraft;
|
|
32
|
+
}, changes: Partial<UnitDraft>, actor: Actor): UnitVersionWrite;
|
|
33
|
+
/** Writes a version into a new row through Core's one row writer and saves it. */
|
|
34
|
+
private static writeVersion;
|
|
35
|
+
private static saveOrThrow;
|
|
36
|
+
/** Save version 1 of a new lineage: the row is its own lineage root. */
|
|
37
|
+
static CreatePredictionUnitV1(draft: UnitDraft, actor: Actor, entityFactory: IEntityFactory, contextUser?: UserInfo): Promise<MJMLPredictionUnitEntity>;
|
|
38
|
+
/** Read a saved version back into a draft in canonical form (the parser's output), through the same parser that validated it. */
|
|
39
|
+
static DraftFromUnitRow(row: MJMLPredictionUnitEntity): UnitDraft;
|
|
40
|
+
/** Save the version after `latest` in its lineage, with `changes` applied over the latest version's content. */
|
|
41
|
+
static CreateNextPredictionUnitVersion(latest: MJMLPredictionUnitEntity, changes: Partial<UnitDraft>, actor: Actor, entityFactory: IEntityFactory, contextUser?: UserInfo): Promise<MJMLPredictionUnitEntity>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=unit-versioning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-versioning.d.ts","sourceRoot":"","sources":["../../src/prediction-unit/unit-versioning.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAgC,KAAK,KAAK,EAA2B,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAClK,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,qHAAqH;AACrH,qBAAa,wBAAwB;IACnC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAOrC,wHAAwH;IACxH,OAAO,CAAC,MAAM,CAAC,UAAU;IASzB;;;;OAIG;WACW,gBAAgB,CAC5B,OAAO,EAAE;QAAE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;KAAE,EAChJ,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,EAC3B,KAAK,EAAE,KAAK,GACX,gBAAgB;IASnB,kFAAkF;mBAC7D,YAAY;mBAKZ,WAAW;IAKhC,wEAAwE;WACpD,sBAAsB,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAOpK,iIAAiI;WACnH,gBAAgB,CAAC,GAAG,EAAE,wBAAwB,GAAG,SAAS;IAWxE,gHAAgH;WAC5F,+BAA+B,CACjD,MAAM,EAAE,wBAAwB,EAChC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,EAC3B,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,cAAc,EAC7B,WAAW,CAAC,EAAE,QAAQ,GACrB,OAAO,CAAC,wBAAwB,CAAC;CASrC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { PredictionUnit, ProtocolRows } from '@memberjunction/predictive-studio-core';
|
|
2
|
+
/** Creating unit versions: build each version's draft and row identity, write it with Core's row writer, save it. */
|
|
3
|
+
export class PredictionUnitVersioning {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the outcome definition (rule, window, gap, task) changed, decided the way the server decides it: both drafts
|
|
6
|
+
* are parsed as stored rows and compared with `PredictionUnit.LabelDefinitionChanged`, so key order or members the
|
|
7
|
+
* parser drops never make a meaning-identical edit look like a change.
|
|
8
|
+
*/
|
|
9
|
+
static labelDefinitionChanged(previous, next, lineageRootId, actor) {
|
|
10
|
+
return PredictionUnit.LabelDefinitionChanged(PredictionUnitVersioning.parseDraft(previous, lineageRootId, actor), PredictionUnitVersioning.parseDraft(next, lineageRootId, actor));
|
|
11
|
+
}
|
|
12
|
+
/** A draft read back through the row parser; the identity columns are fixed because the comparison never reads them. */
|
|
13
|
+
static parseDraft(d, lineageRootId, actor) {
|
|
14
|
+
const parsed = PredictionUnit.ParsePredictionUnitRow({
|
|
15
|
+
ID: lineageRootId, LineageRootID: lineageRootId, Version: 1, LabelVersion: 1, AuthoredBy: JSON.stringify(actor),
|
|
16
|
+
...ProtocolRows.UnitDraftColumns(d),
|
|
17
|
+
});
|
|
18
|
+
if (parsed.Ok === false)
|
|
19
|
+
throw new Error(`Prediction Unit "${d.Name}" does not parse: ${parsed.Errors.join('; ')}`);
|
|
20
|
+
return parsed.Value;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Pure: the draft and row identity of the next version — `changes` over the previous draft, Version = latest + 1 under
|
|
24
|
+
* the same lineage root, the label version bumped exactly when the outcome definition changed, the ID left to the
|
|
25
|
+
* database. Throws when the previous or the changed draft does not parse.
|
|
26
|
+
*/
|
|
27
|
+
static BuildNextVersion(lineage, changes, actor) {
|
|
28
|
+
const next = { ...lineage.previous, ...changes };
|
|
29
|
+
const changed = PredictionUnitVersioning.labelDefinitionChanged(lineage.previous, next, lineage.lineageRootId, actor);
|
|
30
|
+
return {
|
|
31
|
+
Draft: next,
|
|
32
|
+
Meta: { ID: null, LineageRootID: lineage.lineageRootId, Version: lineage.latestVersion + 1, LabelVersion: lineage.previousLabelVersion + (changed ? 1 : 0), AuthoredBy: actor },
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Writes a version into a new row through Core's one row writer and saves it. */
|
|
36
|
+
static async writeVersion(entity, version, what) {
|
|
37
|
+
ProtocolRows.ApplyPredictionUnitDraftToRow(entity, version.Draft, version.Meta);
|
|
38
|
+
return PredictionUnitVersioning.saveOrThrow(entity, what);
|
|
39
|
+
}
|
|
40
|
+
static async saveOrThrow(entity, what) {
|
|
41
|
+
if (!(await entity.Save()))
|
|
42
|
+
throw new Error(`Saving ${what} failed: ${entity.LatestResult?.CompleteMessage || 'unknown error'}`);
|
|
43
|
+
return entity;
|
|
44
|
+
}
|
|
45
|
+
/** Save version 1 of a new lineage: the row is its own lineage root. */
|
|
46
|
+
static async CreatePredictionUnitV1(draft, actor, entityFactory, contextUser) {
|
|
47
|
+
const id = ProtocolRows.NewVersionRowID();
|
|
48
|
+
const entity = await entityFactory.getEntityObject('MJ: ML Prediction Units', contextUser);
|
|
49
|
+
const v1 = { Draft: draft, Meta: { ID: id, LineageRootID: id, Version: 1, LabelVersion: 1, AuthoredBy: actor } };
|
|
50
|
+
return PredictionUnitVersioning.writeVersion(entity, v1, `Prediction Unit "${draft.Name}" v1`);
|
|
51
|
+
}
|
|
52
|
+
/** Read a saved version back into a draft in canonical form (the parser's output), through the same parser that validated it. */
|
|
53
|
+
static DraftFromUnitRow(row) {
|
|
54
|
+
const parsed = PredictionUnit.ParsePredictionUnitRow(row);
|
|
55
|
+
if (parsed.Ok === false)
|
|
56
|
+
throw new Error(`Prediction Unit ${row.ID} does not parse: ${parsed.Errors.join('; ')}`);
|
|
57
|
+
const s = parsed.Value;
|
|
58
|
+
return {
|
|
59
|
+
Name: s.name, Description: row.Description, UnitRows: s.rows, LabelRule: s.label.rule, LabelWindowDays: s.label.windowDays,
|
|
60
|
+
LabelGapDays: s.label.gapDays, TaskType: s.label.outcome, Censoring: s.censoring, ChangeHistoryPolicy: s.history,
|
|
61
|
+
GroupKey: s.groupKey, TemporalSpec: s.temporal, DecisionSpec: s.decision, IncumbentHeuristic: s.incumbent,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** Save the version after `latest` in its lineage, with `changes` applied over the latest version's content. */
|
|
65
|
+
static async CreateNextPredictionUnitVersion(latest, changes, actor, entityFactory, contextUser) {
|
|
66
|
+
const next = PredictionUnitVersioning.BuildNextVersion({ lineageRootId: latest.LineageRootID, latestVersion: latest.Version, previousLabelVersion: latest.LabelVersion, previous: PredictionUnitVersioning.DraftFromUnitRow(latest) }, changes, actor);
|
|
67
|
+
const entity = await entityFactory.getEntityObject('MJ: ML Prediction Units', contextUser);
|
|
68
|
+
return PredictionUnitVersioning.writeVersion(entity, next, `Prediction Unit "${next.Draft.Name}" v${next.Meta.Version}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=unit-versioning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-versioning.js","sourceRoot":"","sources":["../../src/prediction-unit/unit-versioning.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,YAAY,EAA8E,MAAM,wCAAwC,CAAC;AAGlK,qHAAqH;AACrH,MAAM,OAAO,wBAAwB;IACnC;;;;OAIG;IACK,MAAM,CAAC,sBAAsB,CAAC,QAAmB,EAAE,IAAe,EAAE,aAAqB,EAAE,KAAY;QAC7G,OAAO,cAAc,CAAC,sBAAsB,CAC1C,wBAAwB,CAAC,UAAU,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,CAAC,EACnE,wBAAwB,CAAC,UAAU,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,CAAC,CAChE,CAAC;IACJ,CAAC;IAED,wHAAwH;IAChH,MAAM,CAAC,UAAU,CAAC,CAAY,EAAE,aAAqB,EAAE,KAAY;QACzE,MAAM,MAAM,GAAG,cAAc,CAAC,sBAAsB,CAAC;YACnD,EAAE,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;YAC/G,GAAG,YAAY,CA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dout.
|
|
5
|
+
*/
|
|
6
|
+
export * from './protocol-versioning.js';
|
|
7
|
+
export * from './search-guard.js';
|
|
8
|
+
export * from './protocol-defaults.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module protocol
|
|
3
|
+
*
|
|
4
|
+
* Evaluation Protocol version rows, the search guard that binds a training search to one, and a unit's default holdout.
|
|
5
|
+
*/
|
|
6
|
+
export * from './protocol-versioning.js';
|
|
7
|
+
export * from './search-guard.js';
|
|
8
|
+
export * from './protocol-defaults.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module protocol/protocol-defaults
|
|
3
|
+
*
|
|
4
|
+
* The one owner of a Prediction Unit's default locked holdout and the default protocol seed. The agent builder binds a
|
|
5
|
+
* default protocol with it, and the truth-suite fixtures choose their year-cutoff holdout with it, so the two never
|
|
6
|
+
* derive the default differently.
|
|
7
|
+
*/
|
|
8
|
+
import { type HoldoutSplit, type PredictionUnitSpec } from '@memberjunction/predictive-studio-core';
|
|
9
|
+
import { type UnitReadDeps } from '../prediction-unit/unit-row-reader.js';
|
|
10
|
+
/** What reading the unit's rows needs when the default holdout is carved on their decision dates. */
|
|
11
|
+
export type ProtocolDefaultsReadDeps = Pick<UnitReadDeps, 'DataAccess' | 'Metadata' | 'Now'>;
|
|
12
|
+
/** A unit's default holdout and the defaults behind it. */
|
|
13
|
+
export declare class ProtocolDefaults {
|
|
14
|
+
/** Rolling origins of a forecast's default holdout: the fewest the protocol rules accept. */
|
|
15
|
+
static readonly ROLLING_ORIGINS = 5;
|
|
16
|
+
/** Periods every rolling origin trains on at least (one year of monthly periods). */
|
|
17
|
+
static readonly MIN_TRAIN_PERIODS = 12;
|
|
18
|
+
/** The share of rows a seeded row-hash holdout puts in the holdout. */
|
|
19
|
+
static readonly SEEDED_RANDOM_FRACTION = 0.25;
|
|
20
|
+
/** The protocol seed a default protocol is created with (the truth-suite fixtures' measured runs use it too). */
|
|
21
|
+
static readonly DEFAULT_SEED = 0;
|
|
22
|
+
/**
|
|
23
|
+
* The default holdout of a unit that needs no row read: the last rolling origins for a forecast, a seeded row hash
|
|
24
|
+
* when every row shares one fixed decision date; null when the holdout is carved on the rows' decision dates.
|
|
25
|
+
*/
|
|
26
|
+
static HoldoutWithoutRows(unit: PredictionUnitSpec): HoldoutSplit | null;
|
|
27
|
+
/** The date-carved holdout on the decision date at the year cutoff over the given decision dates (`yyyy-mm-dd`). */
|
|
28
|
+
static DateCarvedHoldout(decisionDates: readonly string[]): HoldoutSplit;
|
|
29
|
+
/**
|
|
30
|
+
* A unit's default holdout: {@link HoldoutWithoutRows} when it needs no rows, else the year cutoff over the unit's
|
|
31
|
+
* resolved decision dates, read the way training reads them.
|
|
32
|
+
*
|
|
33
|
+
* @throws Error naming the refusal when the unit's rows cannot be read
|
|
34
|
+
*/
|
|
35
|
+
static DefaultHoldoutFor(unit: PredictionUnitSpec, deps: ProtocolDefaultsReadDeps): Promise<HoldoutSplit>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=protocol-defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol-defaults.d.ts","sourceRoot":"","sources":["../../src/protocol/protocol-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAA2B,KAAK,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEhG,qGAAqG;AACrG,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,YAAY,EAAE,YAAY,GAAG,UAAU,GAAG,KAAK,CAAC,CAAC;AAE7F,2DAA2D;AAC3D,qBAAa,gBAAgB;IAC3B,6FAA6F;IAC7F,gBAAuB,eAAe,KAAK;IAC3C,qFAAqF;IACrF,gBAAuB,iBAAiB,MAAM;IAC9C,uEAAuE;IACvE,gBAAuB,sBAAsB,QAAQ;IACrD,iHAAiH;IACjH,gBAAuB,YAAY,KAAK;IAExC;;;OAGG;WACW,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,GAAG,YAAY,GAAG,IAAI;IAa/E,oHAAoH;WACtG,iBAAiB,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY;IAO/E;;;;;OAKG;WACiB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC;CAOvH"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module protocol/protocol-defaults
|
|
3
|
+
*
|
|
4
|
+
* The one owner of a Prediction Unit's default locked holdout and the default protocol seed. The agent builder binds a
|
|
5
|
+
* default protocol with it, and the truth-suite fixtures choose their year-cutoff holdout with it, so the two never
|
|
6
|
+
* derive the default differently.
|
|
7
|
+
*/
|
|
8
|
+
import { DEFAULT_YEAR_CUTOFF_SHARE, HoldoutCarve, } from '@memberjunction/predictive-studio-core';
|
|
9
|
+
import { PredictionUnitRowReader } from '../prediction-unit/unit-row-reader.js';
|
|
10
|
+
/** A unit's default holdout and the defaults behind it. */
|
|
11
|
+
export class ProtocolDefaults {
|
|
12
|
+
/** Rolling origins of a forecast's default holdout: the fewest the protocol rules accept. */
|
|
13
|
+
static { this.ROLLING_ORIGINS = 5; }
|
|
14
|
+
/** Periods every rolling origin trains on at least (one year of monthly periods). */
|
|
15
|
+
static { this.MIN_TRAIN_PERIODS = 12; }
|
|
16
|
+
/** The share of rows a seeded row-hash holdout puts in the holdout. */
|
|
17
|
+
static { this.SEEDED_RANDOM_FRACTION = 0.25; }
|
|
18
|
+
/** The protocol seed a default protocol is created with (the truth-suite fixtures' measured runs use it too). */
|
|
19
|
+
static { this.DEFAULT_SEED = 0; }
|
|
20
|
+
/**
|
|
21
|
+
* The default holdout of a unit that needs no row read: the last rolling origins for a forecast, a seeded row hash
|
|
22
|
+
* when every row shares one fixed decision date; null when the holdout is carved on the rows' decision dates.
|
|
23
|
+
*/
|
|
24
|
+
static HoldoutWithoutRows(unit) {
|
|
25
|
+
if (unit.label.outcome.kind === 'forecast') {
|
|
26
|
+
return {
|
|
27
|
+
kind: 'rolling-origin', origins: ProtocolDefaults.ROLLING_ORIGINS, horizonPeriods: unit.temporal?.horizonPeriods || 1,
|
|
28
|
+
gapPeriods: 0, minTrainPeriods: ProtocolDefaults.MIN_TRAIN_PERIODS, window: 'expanding',
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (unit.rows.kind === 'grain' && unit.rows.decisionDate.kind === 'fixed') {
|
|
32
|
+
return { kind: 'seeded-random', fraction: ProtocolDefaults.SEEDED_RANDOM_FRACTION };
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
/** The date-carved holdout on the decision date at the year cutoff over the given decision dates (`yyyy-mm-dd`). */
|
|
37
|
+
static DateCarvedHoldout(decisionDates) {
|
|
38
|
+
return {
|
|
39
|
+
kind: 'date-carved', dateColumn: 'DecisionDate', cutoff: HoldoutCarve.YearCutoff(decisionDates, DEFAULT_YEAR_CUTOFF_SHARE),
|
|
40
|
+
holdoutEnd: null, newEntityReport: null,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A unit's default holdout: {@link HoldoutWithoutRows} when it needs no rows, else the year cutoff over the unit's
|
|
45
|
+
* resolved decision dates, read the way training reads them.
|
|
46
|
+
*
|
|
47
|
+
* @throws Error naming the refusal when the unit's rows cannot be read
|
|
48
|
+
*/
|
|
49
|
+
static async DefaultHoldoutFor(unit, deps) {
|
|
50
|
+
const fixed = ProtocolDefaults.HoldoutWithoutRows(unit);
|
|
51
|
+
if (fixed !== null)
|
|
52
|
+
return fixed;
|
|
53
|
+
const read = await new PredictionUnitRowReader().Read(unit, { ...deps, Read: { mode: 'complete' } });
|
|
54
|
+
if (read.Status !== 'read')
|
|
55
|
+
throw new Error(`Prediction Unit "${unit.name}" rows could not be read to choose the holdout cutoff: ${JSON.stringify(read.Refusal)}`);
|
|
56
|
+
return ProtocolDefaults.DateCarvedHoldout(read.Rows.map((r) => r.DecisionDate.toISOString().slice(0, 10)));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=protocol-defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol-defaults.js","sourceRoot":"","sources":["../../src/protocol/protocol-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,yBAAyB,EACzB,YAAY,GAGb,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAqB,MAAM,oCAAoC,CAAC;AAKhG,2DAA2D;AAC3D,MAAM,OAAO,gBAAgB;IAC3B,6FAA6F;aACtE,oBAAe,GAAG,CAAC,CAAC;IAC3C,qFAAqF;aAC9D,sBAAiB,GAAG,EAAE,CAAC;IAC9C,uEAAuE;aAChD,2BAAsB,GAAG,IAAI,CAAC;IACrD,iHAAiH;aAC1F,iBAAY,GAAG,CAAC,CAAC;IAExC;;;OAGG;IACI,MAAM,CAAC,kBAAkB,CAAC,IAAwB;QACvD,IAAI,IAAI,CAAC,KAAK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M;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,CAAC,IAAI,0DAA0D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACnK,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7G,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module protocol/protocol-versioning
|
|
3
|
+
*
|
|
4
|
+
* Evaluation Protocol version rows, written the way Prediction Unit versions are: version 1 is its own lineage root
|
|
5
|
+
* with a client-supplied ID; every later version copies the latest version, applies the changes and takes
|
|
6
|
+
* Version = latest + 1 under the same lineage root, with its ID left to the database. A saved version is never
|
|
7
|
+
* updated (the server subclass refuses it). The guard-field author rule (the previous version's
|
|
8
|
+
* `GuardFieldsEditableBy`) is enforced by the server entity from the `AuthoredBy` written here.
|
|
9
|
+
*/
|
|
10
|
+
import type { UserInfo } from '@memberjunction/core';
|
|
11
|
+
import type { MJMLEvaluationProtocolEntity } from '@memberjunction/core-entities';
|
|
12
|
+
import { type Actor, type EvaluationProtocolDraft, type EvaluationProtocolRowTarget, type ProtocolVersionWrite } from '@memberjunction/predictive-studio-core';
|
|
13
|
+
import type { IEntityFactory } from '../training/types.js';
|
|
14
|
+
/** A protocol row this module writes and saves (the generated entity satisfies it). */
|
|
15
|
+
export type EvaluationProtocolVersionRow = EvaluationProtocolRowTarget & {
|
|
16
|
+
/** Saves the row; false when the save (or its validation) failed. */
|
|
17
|
+
Save(): Promise<boolean>;
|
|
18
|
+
/** The last save's result; its message explains a failed save. */
|
|
19
|
+
readonly LatestResult: {
|
|
20
|
+
readonly CompleteMessage: string;
|
|
21
|
+
} | null;
|
|
22
|
+
};
|
|
23
|
+
/** Evaluation Protocol version rows: each version's draft and row identity, written with Core's row writer. */
|
|
24
|
+
export declare class EvaluationProtocolVersioning {
|
|
25
|
+
/** Pure: version 1 of a new lineage, its own lineage root: `id` is both its ID and its LineageRootID. */
|
|
26
|
+
static BuildV1(draft: EvaluationProtocolDraft, actor: Actor, id: string): ProtocolVersionWrite;
|
|
27
|
+
/**
|
|
28
|
+
* Pure: the version after `latest` — `latest` parsed back to a draft, `changes` applied, its description carried over,
|
|
29
|
+
* the ID left to the database.
|
|
30
|
+
*
|
|
31
|
+
* @throws Error when `latest` does not parse
|
|
32
|
+
*/
|
|
33
|
+
static BuildNextVersion(latest: EvaluationProtocolRowTarget, changes: Partial<EvaluationProtocolDraft>, actor: Actor): ProtocolVersionWrite;
|
|
34
|
+
/**
|
|
35
|
+
* Writes the version into a new row with Core's row writer and saves it. A null ID leaves the row's own ID alone, so
|
|
36
|
+
* the database supplies it.
|
|
37
|
+
*
|
|
38
|
+
* @throws Error naming `what` and the save message when the save fails
|
|
39
|
+
*/
|
|
40
|
+
static WriteVersionRow(row: EvaluationProtocolVersionRow, version: ProtocolVersionWrite, what: string): Promise<void>;
|
|
41
|
+
/** Version 1 of a new protocol lineage: its own lineage root, with a client-minted upper-case ID. */
|
|
42
|
+
static CreateEvaluationProtocolV1(draft: EvaluationProtocolDraft, actor: Actor, entityFactory: IEntityFactory, contextUser?: UserInfo): Promise<MJMLEvaluationProtocolEntity>;
|
|
43
|
+
/** The next version under `latest`'s lineage, with `changes` applied over the latest version's content. */
|
|
44
|
+
static CreateNextEvaluationProtocolVersion(latest: MJMLEvaluationProtocolEntity, changes: Partial<EvaluationProtocolDraft>, actor: Actor, entityFactory: IEntityFactory, contextUser?: UserInfo): Promise<MJMLEvaluationProtocolEntity>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=protocol-versioning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol-versioning.d.ts","sourceRo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AmC,CACrD,MAAM,EAAE,4BAA4B,EACpC,OAAO,EAAE,OAAO,CAAC,uBAAuB,CAAC,EACzC,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,cAAc,EAC7B,WAAW,CAAC,EAAE,QAAQ,GACrB,OAAO,CAAC,4BAA4B,CAAC;CAMzC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { EvaluationProtocol, EvaluationProtocolRules, ProtocolRows, } from '@memberjunction/predictive-studio-core';
|
|
2
|
+
/** Evaluation Protocol version rows: each version's draft and row identity, written with Core's row writer. */
|
|
3
|
+
export class EvaluationProtocolVersioning {
|
|
4
|
+
/** Pure: version 1 of a new lineage, its own lineage root: `id` is both its ID and its LineageRootID. */
|
|
5
|
+
static BuildV1(draft, actor, id) {
|
|
6
|
+
return { Draft: draft, Meta: { ID: id, LineageRootID: id, Version: 1, AuthoredBy: actor, Description: null } };
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Pure: the version after `latest` — `latest` parsed back to a draft, `changes` applied, its description carried over,
|
|
10
|
+
* the ID left to the database.
|
|
11
|
+
*
|
|
12
|
+
* @throws Error when `latest` does not parse
|
|
13
|
+
*/
|
|
14
|
+
static BuildNextVersion(latest, changes, actor) {
|
|
15
|
+
const parsed = EvaluationProtocol.ParseEvaluationProtocolRow(latest);
|
|
16
|
+
if (parsed.Ok === false)
|
|
17
|
+
throw new Error(`Evaluation Protocol ${latest.ID} does not parse: ${parsed.Errors.join('; ')}`);
|
|
18
|
+
return {
|
|
19
|
+
Draft: { ...EvaluationProtocolRules.DraftFromProtocolSpec(parsed.Value), ...changes },
|
|
20
|
+
Meta: { ID: null, LineageRootID: latest.LineageRootID, Version: latest.Version + 1, AuthoredBy: actor, Description: latest.Description },
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Writes the version into a new row with Core's row writer and saves it. A null ID leaves the row's own ID alone, so
|
|
25
|
+
* the database supplies it.
|
|
26
|
+
*
|
|
27
|
+
* @throws Error naming `what` and the save message when the save fails
|
|
28
|
+
*/
|
|
29
|
+
static async WriteVersionRow(row, version, what) {
|
|
30
|
+
ProtocolRows.ApplyProtocolDraftToRow(row, version.Draft, version.Meta);
|
|
31
|
+
if (!(await row.Save()))
|
|
32
|
+
throw new Error(`Saving ${what} failed: ${row.LatestResult?.CompleteMessage || 'unknown error'}`);
|
|
33
|
+
}
|
|
34
|
+
/** Version 1 of a new protocol lineage: its own lineage root, with a client-minted upper-case ID. */
|
|
35
|
+
static async CreateEvaluationProtocolV1(draft, actor, entityFactory, contextUser) {
|
|
36
|
+
const row = await entityFactory.getEntityObject('MJ: ML Evaluation Protocols', contextUser);
|
|
37
|
+
await EvaluationProtocolVersioning.WriteVersionRow(row, EvaluationProtocolVersioning.BuildV1(draft, actor, ProtocolRows.NewVersionRowID()), `Evaluation Protocol "${draft.name}" v1`);
|
|
38
|
+
return row;
|
|
39
|
+
}
|
|
40
|
+
/** The next version under `latest`'s lineage, with `changes` applied over the latest version's content. */
|
|
41
|
+
static async CreateNextEvaluationProtocolVersion(latest, changes, actor, entityFactory, contextUser) {
|
|
42
|
+
const next = EvaluationProtocolVersioning.BuildNextVersion(latest, changes, actor);
|
|
43
|
+
const row = await entityFactory.getEntityObject('MJ: ML Evaluation Protocols', contextUser);
|
|
44
|
+
await EvaluationProtocolVersioning.WriteVersionRow(row, next, `Evaluation Protocol "${next.Draft.name}" v${next.Meta.Version}`);
|
|
45
|
+
return row;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=protocol-versioning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol-versioning.js","sourceRoot":"","sources":["../../src/protocol/protocol-versioning.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,kBAAkB,EAAE,uBAAuB,EAAE,YAAY,GAE1D,MAAM,wCAAwC,CAAC;AAWhD,+GAA+G;AAC/G,MAAM,OAAO,4BAA4B;IACvC,yGAAyG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C,YAAY,EAAE,eAAe,IAAI,eAAe,EAAE,CAAC,CAAC;IAC7H,CAAC;IAED,qGAAqG;IAC9F,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,KAA8B,EAAE,KAAY,EAAE,aAA6B,EAAE,WAAsB;QAChJ,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,eAAe,CAA+B,6BAA6B,EAAE,WAAW,CAAC,CAAC;QAC1H,MAAM,4BAA4B,CAAC,eAAe,CAAC,GAAG,EAAE,4BAA4B,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,eAAe,EAAE,CAAC,EAAE,wBAAwB,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC;QACtL,OAAO,GAAG,CAAC;IACb,CAAC;IAED,2GAA2G;IACpG,MAAM,CAAC,KAAK,CAAC,mCAAmC,CACrD,MAAoC,EACpC,OAAyC,EACzC,KAAY,EACZ,aAA6B,EAC7B,WAAsB;QAEtB,MAAM,IAAI,GAAG,4BAA4B,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACnF,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,eAAe,CAA+B,6BAA6B,EAAE,WAAW,CAAC,CAAC;QAC1H,MAAM,4BAA4B,CAAC,eAAe,CAAC,GAAG,EAAE,IAAI,EAAE,wBAAwB,IAAI,CAAC,KAAK,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAChI,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module protocol/search-guard
|
|
3
|
+
*
|
|
4
|
+
* No protocol, no search: a unit pipeline's training search resolves the protocol version its `EvaluationProtocolID`
|
|
5
|
+
* names before any run row or candidate exists, refuses more candidates than that protocol's budget allows (nothing is
|
|
6
|
+
* silently dropped), checks the protocol against the unit, and checks that the protocol row existed before the run row
|
|
7
|
+
* (both instants from the database clock).
|
|
8
|
+
*/
|
|
9
|
+
import type { MJMLTrainingPipelineEntity } from '@memberjunction/core-entities';
|
|
10
|
+
import { type HoldoutSplit, type PipelineRefusal, type PredictionUnitSpec } from '@memberjunction/predictive-studio-core';
|
|
11
|
+
import { type IEvaluationProtocolStore, type LoadedProtocol } from '../training/evaluation-protocol-store.js';
|
|
12
|
+
/** The bound protocol version a search may run under, or the refusal that stops it before a run row is written. */
|
|
13
|
+
export type ProtocolRequirement = {
|
|
14
|
+
readonly Ok: true;
|
|
15
|
+
readonly Loaded: LoadedProtocol;
|
|
16
|
+
} | {
|
|
17
|
+
readonly Ok: false;
|
|
18
|
+
readonly Refusal: PipelineRefusal;
|
|
19
|
+
};
|
|
20
|
+
/** The search guard's checks. */
|
|
21
|
+
export declare class ProtocolSearchGuard {
|
|
22
|
+
/**
|
|
23
|
+
* The protocol version the pipeline is bound to, when it exists and its budget admits `candidates`; otherwise the
|
|
24
|
+
* refusal (`protocol-required` for no binding or a missing row, `too-many-candidates` over the budget).
|
|
25
|
+
*
|
|
26
|
+
* @param store where protocol rows are read
|
|
27
|
+
* @param pipeline the pipeline being searched
|
|
28
|
+
* @param candidates how many candidates the search would train
|
|
29
|
+
* @throws TrainingRefusedError (`protocol-invalid`) when the bound row does not parse
|
|
30
|
+
*/
|
|
31
|
+
static RequireProtocolForSearch(store: IEvaluationProtocolStore, pipeline: Pick<MJMLTrainingPipelineEntity, 'ID' | 'EvaluationProtocolID'>, candidates: number): Promise<ProtocolRequirement>;
|
|
32
|
+
/** Whether the protocol row was created before (or at) the run row: a run is judged only under a protocol that preceded it. */
|
|
33
|
+
static ProtocolPrecedesRun(protocolCreatedAt: Date, runCreatedAt: Date): boolean;
|
|
34
|
+
/** The holdout kinds that respect time: rows are tested on dates after the rows trained on. */
|
|
35
|
+
static readonly TimeRespectingHoldouts: readonly HoldoutSplit['kind'][];
|
|
36
|
+
/**
|
|
37
|
+
* A pipeline that declares a time index (`ValidationStrategy.TimeIndexColumn`) is judged only on a time-respecting
|
|
38
|
+
* holdout: any other (a seeded row hash) would test it on rows interleaved in time with its training rows and clear it
|
|
39
|
+
* unevaluated. The refusal, or null when the pipeline declares no time index or the holdout respects time.
|
|
40
|
+
*/
|
|
41
|
+
static CheckTimeIndexHoldout(loaded: LoadedProtocol, pipelineId: string, timeIndexColumn: string | null | undefined): PipelineRefusal | null;
|
|
42
|
+
/** The unit-dependent protocol rules as one storable refusal, or null when the protocol fits the unit. */
|
|
43
|
+
static CheckProtocolForUnit(loaded: LoadedProtocol, unit: PredictionUnitSpec): PipelineRefusal | null;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=search-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-guard.d.ts","sourceRoot":"","sources":["../../src/protocol/search-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAA2B,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AACnJ,OAAO,EAA2B,KAAK,wBAAwB,EAAE,KAAK,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEpI,mHAAmH;AACnH,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;CAAE,GACtD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;CAAE,CAAC;AAE9D,iCAAiC;AACjC,qBAAa,mBAAmB;IAC9B;;;;;;;;OAQG;WACiB,wBAAwB,CAC1C,KAAK,EAAE,wBAAwB,EAC/B,QAAQ,EAAE,IAAI,CAAC,0BAA0B,EAAE,IAAI,GAAG,sBAAsB,CAAC,EACzE,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,mBAAmB,CAAC;IAQ/B,+HAA+H;WACjH,mBAAmB,CAAC,iBAAiB,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,GAAG,OAAO;IAIvF,+FAA+F;IAC/F,gBAAuB,sBAAsB,EAAE,SAAS,YAAY,CAAC,MAAM,CAAC,EAAE,CAAqC;IAEnH;;;;OAIG;WACW,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,eAAe,GAAG,IAAI;IAOnJ,0GAA0G;WAC5F,oBAAoB,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,kBAAkB,GAAG,eAAe,GAAG,IAAI;CAK7G"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EvaluationProtocolRules } from '@memberjunction/predictive-studio-core';
|
|
2
|
+
import { EvaluationProtocolSpecs } from '../training/evaluation-protocol-store.js';
|
|
3
|
+
/** The search guard's checks. */
|
|
4
|
+
export class ProtocolSearchGuard {
|
|
5
|
+
/**
|
|
6
|
+
* The protocol version the pipeline is bound to, when it exists and its budget admits `candidates`; otherwise the
|
|
7
|
+
* refusal (`protocol-required` for no binding or a missing row, `too-many-candidates` over the budget).
|
|
8
|
+
*
|
|
9
|
+
* @param store where protocol rows are read
|
|
10
|
+
* @param pipeline the pipeline being searched
|
|
11
|
+
* @param candidates how many candidates the search would train
|
|
12
|
+
* @throws TrainingRefusedError (`protocol-invalid`) when the bound row does not parse
|
|
13
|
+
*/
|
|
14
|
+
static async RequireProtocolForSearch(store, pipeline, candidates) {
|
|
15
|
+
const loaded = pipeline.EvaluationProtocolID ? await EvaluationProtocolSpecs.LoadProtocol(store, pipeline.EvaluationProtocolID) : null;
|
|
16
|
+
if (loaded === null)
|
|
17
|
+
return { Ok: false, Refusal: { kind: 'protocol-required', pipelineId: pipeline.ID } };
|
|
18
|
+
const max = loaded.Protocol.budgets.maxCandidates;
|
|
19
|
+
if (candidates > max)
|
|
20
|
+
return { Ok: false, Refusal: { kind: 'too-many-candidates', pipelineId: pipeline.ID, candidates, maxCandidates: max } };
|
|
21
|
+
return { Ok: true, Loaded: loaded };
|
|
22
|
+
}
|
|
23
|
+
/** Whether the protocol row was created before (or at) the run row: a run is judged only under a protocol that preceded it. */
|
|
24
|
+
static ProtocolPrecedesRun(protocolCreatedAt, runCreatedAt) {
|
|
25
|
+
return protocolCreatedAt.getTime() <= runCreatedAt.getTime();
|
|
26
|
+
}
|
|
27
|
+
/** The holdout kinds that respect time: rows are tested on dates after the rows trained on. */
|
|
28
|
+
static { this.TimeRespectingHoldouts = ['date-carved', 'rolling-origin']; }
|
|
29
|
+
/**
|
|
30
|
+
* A pipeline that declares a time index (`ValidationStrategy.TimeIndexColumn`) is judged only on a time-respecting
|
|
31
|
+
* holdout: any other (a seeded row hash) would test it on rows interleaved in time with its training rows and clear it
|
|
32
|
+
* unevaluated. The refusal, or null when the pipeline declares no time index or the holdout respects time.
|
|
33
|
+
*/
|
|
34
|
+
static CheckTimeIndexHoldout(loaded, pipelineId, timeIndexColumn) {
|
|
35
|
+
if (!timeIndexColumn)
|
|
36
|
+
return null;
|
|
37
|
+
const holdout = loaded.Protocol.holdout.kind;
|
|
38
|
+
if (ProtocolSearchGuard.TimeRespectingHoldouts.includes(holdout))
|
|
39
|
+
return null;
|
|
40
|
+
return { kind: 'time-index-needs-time-holdout', pipelineId, protocolId: loaded.RowID, timeIndexColumn, holdout };
|
|
41
|
+
}
|
|
42
|
+
/** The unit-dependent protocol rules as one storable refusal, or null when the protocol fits the unit. */
|
|
43
|
+
static CheckProtocolForUnit(loaded, unit) {
|
|
44
|
+
const refusals = EvaluationProtocolRules.ValidateProtocolForUnit(loaded.Protocol, unit);
|
|
45
|
+
if (refusals.length === 0)
|
|
46
|
+
return null;
|
|
47
|
+
return { kind: 'protocol-unit-mismatch', protocolId: loaded.RowID, problems: refusals.map((r) => EvaluationProtocolRules.DescribeProtocolRefusal(r)) };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=search-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-guard.js","sourceRoot":"","sources":["../../src/protocol/search-guard.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,uBAAuB,EAAoE,MAAM,wCAAwC,CAAC;AACnJ,OAAO,EAAE,uBAAuB,EAAsD,MAAM,uCAAuC,CAAC;AAOpI,iCAAiC;AACjC,MAAM,OAAO,mBAAmB;IAC9B;;;;;;;;OAQG;IACI,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAC1C,KAA+B,EAC/B,QAAyE,EACzE,UAAkB;QAElB,MAAM,MAAM,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC,MAAM,uBAAuB,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACvI,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;QAC3G,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC;QAClD,IAAI,UAAU,GAAG,GAAG;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,EAAE,EAAE,CAAC;QAC9I,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACtC,CAAC;IAED,+HAA+H;IACxH,MAAM,CAAC,mBAAmB,CAAC,iBAAuB,EAAE,YAAkB;QAC3E,OAAO,iBAAiB,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