@memberjunction/predictive-studio 6.2.2 → 6.3.0-edge.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/README.md +16 -11
  2. package/dist/actions/base-predictive-studio.action.d.ts +7 -0
  3. package/dist/actions/base-predictive-studio.action.d.ts.map +1 -1
  4. package/dist/actions/base-predictive-studio.action.js +22 -0
  5. package/dist/actions/base-predictive-studio.action.js.map +1 -1
  6. package/dist/actions/driver-classes.d.ts +2 -0
  7. package/dist/actions/driver-classes.d.ts.map +1 -1
  8. package/dist/actions/driver-classes.js +2 -0
  9. package/dist/actions/driver-classes.js.map +1 -1
  10. package/dist/actions/evaluate-drift.action.d.ts +100 -0
  11. package/dist/actions/evaluate-drift.action.d.ts.map +1 -0
  12. package/dist/actions/evaluate-drift.action.js +512 -0
  13. package/dist/actions/evaluate-drift.action.js.map +1 -0
  14. package/dist/actions/index.d.ts +3 -0
  15. package/dist/actions/index.d.ts.map +1 -1
  16. package/dist/actions/index.js +7 -0
  17. package/dist/actions/index.js.map +1 -1
  18. package/dist/actions/migrate-pipelines.action.d.ts +19 -0
  19. package/dist/actions/migrate-pipelines.action.d.ts.map +1 -0
  20. package/dist/actions/migrate-pipelines.action.js +51 -0
  21. package/dist/actions/migrate-pipelines.action.js.map +1 -0
  22. package/dist/actions/promote-model.action.d.ts +12 -1
  23. package/dist/actions/promote-model.action.d.ts.map +1 -1
  24. package/dist/actions/promote-model.action.js +7 -2
  25. package/dist/actions/promote-model.action.js.map +1 -1
  26. package/dist/actions/promote-model.gate.d.ts +31 -2
  27. package/dist/actions/promote-model.gate.d.ts.map +1 -1
  28. package/dist/actions/promote-model.gate.js +84 -5
  29. package/dist/actions/promote-model.gate.js.map +1 -1
  30. package/dist/actions/run-experiment.action.d.ts.map +1 -1
  31. package/dist/actions/run-experiment.action.js +5 -4
  32. package/dist/actions/run-experiment.action.js.map +1 -1
  33. package/dist/actions/schedule-model-scoring.action.js +2 -2
  34. package/dist/actions/schedule-model-scoring.action.js.map +1 -1
  35. package/dist/actions/score-record-set.action.js +1 -1
  36. package/dist/actions/score-record-set.action.js.map +1 -1
  37. package/dist/actions/score-record-set.runner.d.ts +2 -2
  38. package/dist/actions/score-record-set.runner.js +3 -3
  39. package/dist/actions/score-record-set.runner.js.map +1 -1
  40. package/dist/actions/train-model.action.d.ts +28 -25
  41. package/dist/actions/train-model.action.d.ts.map +1 -1
  42. package/dist/actions/train-model.action.js +50 -39
  43. package/dist/actions/train-model.action.js.map +1 -1
  44. package/dist/agent/index.d.ts +1 -1
  45. package/dist/agent/index.js +1 -1
  46. package/dist/agent/modeling-plan-to-pipeline.d.ts +0 -2
  47. package/dist/agent/modeling-plan-to-pipeline.d.ts.map +1 -1
  48. package/dist/agent/modeling-plan-to-pipeline.js +30 -39
  49. package/dist/agent/modeling-plan-to-pipeline.js.map +1 -1
  50. package/dist/agent/pipeline-builder-agent.d.ts +47 -18
  51. package/dist/agent/pipeline-builder-agent.d.ts.map +1 -1
  52. package/dist/agent/pipeline-builder-agent.js +161 -92
  53. package/dist/agent/pipeline-builder-agent.js.map +1 -1
  54. package/dist/agent/pipeline-builder.d.ts +178 -56
  55. package/dist/agent/pipeline-builder.d.ts.map +1 -1
  56. package/dist/agent/pipeline-builder.js +333 -234
  57. package/dist/agent/pipeline-builder.js.map +1 -1
  58. package/dist/experiment/budget.d.ts +61 -0
  59. package/dist/experiment/budget.d.ts.map +1 -0
  60. package/dist/experiment/budget.js +72 -0
  61. package/dist/experiment/budget.js.map +1 -0
  62. package/dist/experiment/experiment-orchestrator.d.ts +43 -7
  63. package/dist/experiment/experiment-orchestrator.d.ts.map +1 -1
  64. package/dist/experiment/experiment-orchestrator.js +130 -33
  65. package/dist/experiment/experiment-orchestrator.js.map +1 -1
  66. package/dist/experiment/index.d.ts +2 -0
  67. package/dist/experiment/index.d.ts.map +1 -1
  68. package/dist/experiment/index.js +2 -0
  69. package/dist/experiment/index.js.map +1 -1
  70. package/dist/experiment/leaderboard.d.ts +15 -15
  71. package/dist/experiment/leaderboard.d.ts.map +1 -1
  72. package/dist/experiment/leaderboard.js +44 -18
  73. package/dist/experiment/leaderboard.js.map +1 -1
  74. package/dist/experiment/scores.d.ts +32 -0
  75. package/dist/experiment/scores.d.ts.map +1 -0
  76. package/dist/experiment/scores.js +62 -0
  77. package/dist/experiment/scores.js.map +1 -0
  78. package/dist/experiment/seams.d.ts +23 -20
  79. package/dist/experiment/seams.d.ts.map +1 -1
  80. package/dist/experiment/seams.js +54 -56
  81. package/dist/experiment/seams.js.map +1 -1
  82. package/dist/experiment/types.d.ts +55 -10
  83. package/dist/experiment/types.d.ts.map +1 -1
  84. package/dist/experiment/types.js.map +1 -1
  85. package/dist/feature-assembly/as-of/as-of-assembler.d.ts +412 -0
  86. package/dist/feature-assembly/as-of/as-of-assembler.d.ts.map +1 -0
  87. package/dist/feature-assembly/as-of/as-of-assembler.js +1239 -0
  88. package/dist/feature-assembly/as-of/as-of-assembler.js.map +1 -0
  89. package/dist/feature-assembly/as-of/feature-resolution.d.ts +84 -0
  90. package/dist/feature-assembly/as-of/feature-resolution.d.ts.map +1 -0
  91. package/dist/feature-assembly/as-of/feature-resolution.js +229 -0
  92. package/dist/feature-assembly/as-of/feature-resolution.js.map +1 -0
  93. package/dist/feature-assembly/as-of/index.d.ts +15 -0
  94. package/dist/feature-assembly/as-of/index.d.ts.map +1 -0
  95. package/dist/feature-assembly/as-of/index.js +15 -0
  96. package/dist/feature-assembly/as-of/index.js.map +1 -0
  97. package/dist/feature-assembly/as-of/read-by-keys.d.ts +30 -0
  98. package/dist/feature-assembly/as-of/read-by-keys.d.ts.map +1 -0
  99. package/dist/feature-assembly/as-of/read-by-keys.js +51 -0
  100. package/dist/feature-assembly/as-of/read-by-keys.js.map +1 -0
  101. package/dist/feature-assembly/as-of/record-history.d.ts +256 -0
  102. package/dist/feature-assembly/as-of/record-history.d.ts.map +1 -0
  103. package/dist/feature-assembly/as-of/record-history.js +505 -0
  104. package/dist/feature-assembly/as-of/record-history.js.map +1 -0
  105. package/dist/feature-assembly/as-of/refusal.d.ts +19 -0
  106. package/dist/feature-assembly/as-of/refusal.d.ts.map +1 -0
  107. package/dist/feature-assembly/as-of/refusal.js +13 -0
  108. package/dist/feature-assembly/as-of/refusal.js.map +1 -0
  109. package/dist/feature-assembly/as-of/series-features.d.ts +65 -0
  110. package/dist/feature-assembly/as-of/series-features.d.ts.map +1 -0
  111. package/dist/feature-assembly/as-of/series-features.js +97 -0
  112. package/dist/feature-assembly/as-of/series-features.js.map +1 -0
  113. package/dist/feature-assembly/as-of/windowed-aggregate.d.ts +36 -0
  114. package/dist/feature-assembly/as-of/windowed-aggregate.d.ts.map +1 -0
  115. package/dist/feature-assembly/as-of/windowed-aggregate.js +99 -0
  116. package/dist/feature-assembly/as-of/windowed-aggregate.js.map +1 -0
  117. package/dist/feature-assembly/as-of.d.ts +1 -9
  118. package/dist/feature-assembly/as-of.d.ts.map +1 -1
  119. package/dist/feature-assembly/as-of.js +2 -19
  120. package/dist/feature-assembly/as-of.js.map +1 -1
  121. package/dist/feature-assembly/assembly-metadata.d.ts +34 -0
  122. package/dist/feature-assembly/assembly-metadata.d.ts.map +1 -0
  123. package/dist/feature-assembly/assembly-metadata.js +26 -0
  124. package/dist/feature-assembly/assembly-metadata.js.map +1 -0
  125. package/dist/feature-assembly/data-access.d.ts +21 -2
  126. package/dist/feature-assembly/data-access.d.ts.map +1 -1
  127. package/dist/feature-assembly/data-access.js +14 -0
  128. package/dist/feature-assembly/data-access.js.map +1 -1
  129. package/dist/feature-assembly/feature-assembly-executor.d.ts.map +1 -1
  130. package/dist/feature-assembly/feature-assembly-executor.js +5 -2
  131. package/dist/feature-assembly/feature-assembly-executor.js.map +1 -1
  132. package/dist/feature-assembly/index.d.ts +3 -0
  133. package/dist/feature-assembly/index.d.ts.map +1 -1
  134. package/dist/feature-assembly/index.js +3 -0
  135. package/dist/feature-assembly/index.js.map +1 -1
  136. package/dist/feature-assembly/leakage-guard.d.ts +1 -1
  137. package/dist/feature-assembly/leakage-guard.js +1 -1
  138. package/dist/feature-assembly/read-policy.d.ts +27 -0
  139. package/dist/feature-assembly/read-policy.d.ts.map +1 -0
  140. package/dist/feature-assembly/read-policy.js +63 -0
  141. package/dist/feature-assembly/read-policy.js.map +1 -0
  142. package/dist/feature-pipelines/feature-pipeline-engine.d.ts.map +1 -1
  143. package/dist/feature-pipelines/feature-pipeline-engine.js +3 -1
  144. package/dist/feature-pipelines/feature-pipeline-engine.js.map +1 -1
  145. package/dist/index.d.ts +5 -2
  146. package/dist/index.d.ts.map +1 -1
  147. package/dist/index.js +16 -4
  148. package/dist/index.js.map +1 -1
  149. package/dist/maintenance/index.d.ts +1 -0
  150. package/dist/maintenance/index.d.ts.map +1 -1
  151. package/dist/maintenance/index.js +1 -0
  152. package/dist/maintenance/index.js.map +1 -1
  153. package/dist/maintenance/maintenance-engine.d.ts +16 -19
  154. package/dist/maintenance/maintenance-engine.d.ts.map +1 -1
  155. package/dist/maintenance/maintenance-engine.js +53 -53
  156. package/dist/maintenance/maintenance-engine.js.map +1 -1
  157. package/dist/maintenance/metrics.d.ts +19 -15
  158. package/dist/maintenance/metrics.d.ts.map +1 -1
  159. package/dist/maintenance/metrics.js +29 -24
  160. package/dist/maintenance/metrics.js.map +1 -1
  161. package/dist/maintenance/psi-drift-detector.d.ts +246 -0
  162. package/dist/maintenance/psi-drift-detector.d.ts.map +1 -0
  163. package/dist/maintenance/psi-drift-detector.js +1002 -0
  164. package/dist/maintenance/psi-drift-detector.js.map +1 -0
  165. package/dist/maintenance/types.d.ts +11 -2
  166. package/dist/maintenance/types.d.ts.map +1 -1
  167. package/dist/maintenance/types.js.map +1 -1
  168. package/dist/migration/index.d.ts +8 -0
  169. package/dist/migration/index.d.ts.map +1 -0
  170. package/dist/migration/index.js +8 -0
  171. package/dist/migration/index.js.map +1 -0
  172. package/dist/migration/legacy-pipeline-migration.d.ts +138 -0
  173. package/dist/migration/legacy-pipeline-migration.d.ts.map +1 -0
  174. package/dist/migration/legacy-pipeline-migration.js +273 -0
  175. package/dist/migration/legacy-pipeline-migration.js.map +1 -0
  176. package/dist/operations/delegation.d.ts +58 -46
  177. package/dist/operations/delegation.d.ts.map +1 -1
  178. package/dist/operations/delegation.js +90 -77
  179. package/dist/operations/delegation.js.map +1 -1
  180. package/dist/operations/promote-model.operation.d.ts +2 -2
  181. package/dist/operations/promote-model.operation.d.ts.map +1 -1
  182. package/dist/operations/promote-model.operation.js +6 -2
  183. package/dist/operations/promote-model.operation.js.map +1 -1
  184. package/dist/operations/refusals.d.ts +5 -0
  185. package/dist/operations/refusals.d.ts.map +1 -1
  186. package/dist/operations/refusals.js +26 -1
  187. package/dist/operations/refusals.js.map +1 -1
  188. package/dist/operations/start-experiment-session.operation.js +3 -3
  189. package/dist/operations/train-model.mapping.d.ts +91 -0
  190. package/dist/operations/train-model.mapping.d.ts.map +1 -0
  191. package/dist/operations/train-model.mapping.js +145 -0
  192. package/dist/operations/train-model.mapping.js.map +1 -0
  193. package/dist/operations/train-model.operation.d.ts +14 -9
  194. package/dist/operations/train-model.operation.d.ts.map +1 -1
  195. package/dist/operations/train-model.operation.js +30 -51
  196. package/dist/operations/train-model.operation.js.map +1 -1
  197. package/dist/prediction-unit/decision-date-advance.d.ts +46 -0
  198. package/dist/prediction-unit/decision-date-advance.d.ts.map +1 -0
  199. package/dist/prediction-unit/decision-date-advance.js +79 -0
  200. package/dist/prediction-unit/decision-date-advance.js.map +1 -0
  201. package/dist/prediction-unit/index.d.ts +12 -0
  202. package/dist/prediction-unit/index.d.ts.map +1 -0
  203. package/dist/prediction-unit/index.js +12 -0
  204. package/dist/prediction-unit/index.js.map +1 -0
  205. package/dist/prediction-unit/target-validation.d.ts +21 -0
  206. package/dist/prediction-unit/target-validation.d.ts.map +1 -0
  207. package/dist/prediction-unit/target-validation.js +54 -0
  208. package/dist/prediction-unit/target-validation.js.map +1 -0
  209. package/dist/prediction-unit/unit-row-reader.d.ts +108 -0
  210. package/dist/prediction-unit/unit-row-reader.d.ts.map +1 -0
  211. package/dist/prediction-unit/unit-row-reader.js +348 -0
  212. package/dist/prediction-unit/unit-row-reader.js.map +1 -0
  213. package/dist/prediction-unit/unit-store.d.ts +28 -0
  214. package/dist/prediction-unit/unit-store.d.ts.map +1 -0
  215. package/dist/prediction-unit/unit-store.js +41 -0
  216. package/dist/prediction-unit/unit-store.js.map +1 -0
  217. package/dist/prediction-unit/unit-versioning.d.ts +43 -0
  218. package/dist/prediction-unit/unit-versioning.d.ts.map +1 -0
  219. package/dist/prediction-unit/unit-versioning.js +71 -0
  220. package/dist/prediction-unit/unit-versioning.js.map +1 -0
  221. package/dist/protocol/index.d.ts +9 -0
  222. package/dist/protocol/index.d.ts.map +1 -0
  223. package/dist/protocol/index.js +9 -0
  224. package/dist/protocol/index.js.map +1 -0
  225. package/dist/protocol/protocol-defaults.d.ts +37 -0
  226. package/dist/protocol/protocol-defaults.d.ts.map +1 -0
  227. package/dist/protocol/protocol-defaults.js +59 -0
  228. package/dist/protocol/protocol-defaults.js.map +1 -0
  229. package/dist/protocol/protocol-versioning.d.ts +46 -0
  230. package/dist/protocol/protocol-versioning.d.ts.map +1 -0
  231. package/dist/protocol/protocol-versioning.js +48 -0
  232. package/dist/protocol/protocol-versioning.js.map +1 -0
  233. package/dist/protocol/search-guard.d.ts +45 -0
  234. package/dist/protocol/search-guard.d.ts.map +1 -0
  235. package/dist/protocol/search-guard.js +50 -0
  236. package/dist/protocol/search-guard.js.map +1 -0
  237. package/dist/scoring/artifact-loader.d.ts +5 -32
  238. package/dist/scoring/artifact-loader.d.ts.map +1 -1
  239. package/dist/scoring/artifact-loader.js +4 -59
  240. package/dist/scoring/artifact-loader.js.map +1 -1
  241. package/dist/scoring/auto-train.d.ts +25 -5
  242. package/dist/scoring/auto-train.d.ts.map +1 -1
  243. package/dist/scoring/auto-train.js +48 -31
  244. package/dist/scoring/auto-train.js.map +1 -1
  245. package/dist/scoring/index.d.ts +3 -0
  246. package/dist/scoring/index.d.ts.map +1 -1
  247. package/dist/scoring/index.js +3 -0
  248. package/dist/scoring/index.js.map +1 -1
  249. package/dist/scoring/ml-model-inference-processor.d.ts +137 -10
  250. package/dist/scoring/ml-model-inference-processor.d.ts.map +1 -1
  251. package/dist/scoring/ml-model-inference-processor.js +383 -40
  252. package/dist/scoring/ml-model-inference-processor.js.map +1 -1
  253. package/dist/scoring/model-readiness.d.ts +45 -0
  254. package/dist/scoring/model-readiness.d.ts.map +1 -1
  255. package/dist/scoring/model-readiness.js +49 -0
  256. package/dist/scoring/model-readiness.js.map +1 -1
  257. package/dist/scoring/register.d.ts +8 -3
  258. package/dist/scoring/register.d.ts.map +1 -1
  259. package/dist/scoring/register.js +28 -4
  260. package/dist/scoring/register.js.map +1 -1
  261. package/dist/scoring/seams.d.ts +18 -2
  262. package/dist/scoring/seams.d.ts.map +1 -1
  263. package/dist/scoring/seams.js +35 -10
  264. package/dist/scoring/seams.js.map +1 -1
  265. package/dist/scoring/shadow-scoring.d.ts +245 -0
  266. package/dist/scoring/shadow-scoring.d.ts.map +1 -0
  267. package/dist/scoring/shadow-scoring.js +510 -0
  268. package/dist/scoring/shadow-scoring.js.map +1 -0
  269. package/dist/scoring/startup-register.d.ts +3 -3
  270. package/dist/scoring/startup-register.d.ts.map +1 -1
  271. package/dist/scoring/startup-register.js +10 -4
  272. package/dist/scoring/startup-register.js.map +1 -1
  273. package/dist/scoring/storage-provider-artifact-loader.d.ts +14 -0
  274. package/dist/scoring/storage-provider-artifact-loader.d.ts.map +1 -0
  275. package/dist/scoring/storage-provider-artifact-loader.js +47 -0
  276. package/dist/scoring/storage-provider-artifact-loader.js.map +1 -0
  277. package/dist/scoring/training-keys.d.ts +27 -0
  278. package/dist/scoring/training-keys.d.ts.map +1 -0
  279. package/dist/scoring/training-keys.js +54 -0
  280. package/dist/scoring/training-keys.js.map +1 -0
  281. package/dist/scoring/types.d.ts +72 -7
  282. package/dist/scoring/types.d.ts.map +1 -1
  283. package/dist/scoring/types.js +4 -0
  284. package/dist/scoring/types.js.map +1 -1
  285. package/dist/sidecar-provider.d.ts +2 -2
  286. package/dist/sidecar-provider.js +3 -3
  287. package/dist/snapshot/code-version.d.ts +16 -0
  288. package/dist/snapshot/code-version.d.ts.map +1 -0
  289. package/dist/snapshot/code-version.js +39 -0
  290. package/dist/snapshot/code-version.js.map +1 -0
  291. package/dist/snapshot/holdout-carver.d.ts +110 -0
  292. package/dist/snapshot/holdout-carver.d.ts.map +1 -0
  293. package/dist/snapshot/holdout-carver.js +171 -0
  294. package/dist/snapshot/holdout-carver.js.map +1 -0
  295. package/dist/snapshot/index.d.ts +17 -0
  296. package/dist/snapshot/index.d.ts.map +1 -0
  297. package/dist/snapshot/index.js +17 -0
  298. package/dist/snapshot/index.js.map +1 -0
  299. package/dist/snapshot/snapshot-builder.d.ts +152 -0
  300. package/dist/snapshot/snapshot-builder.d.ts.map +1 -0
  301. package/dist/snapshot/snapshot-builder.js +286 -0
  302. package/dist/snapshot/snapshot-builder.js.map +1 -0
  303. package/dist/snapshot/snapshot-file-store.d.ts +161 -0
  304. package/dist/snapshot/snapshot-file-store.d.ts.map +1 -0
  305. package/dist/snapshot/snapshot-file-store.js +204 -0
  306. package/dist/snapshot/snapshot-file-store.js.map +1 -0
  307. package/dist/snapshot/snapshot-hash.d.ts +6 -0
  308. package/dist/snapshot/snapshot-hash.d.ts.map +1 -0
  309. package/dist/snapshot/snapshot-hash.js +16 -0
  310. package/dist/snapshot/snapshot-hash.js.map +1 -0
  311. package/dist/snapshot/snapshot-manifest.d.ts +43 -0
  312. package/dist/snapshot/snapshot-manifest.d.ts.map +1 -0
  313. package/dist/snapshot/snapshot-manifest.js +43 -0
  314. package/dist/snapshot/snapshot-manifest.js.map +1 -0
  315. package/dist/snapshot/snapshot-retrainer.d.ts +107 -0
  316. package/dist/snapshot/snapshot-retrainer.d.ts.map +1 -0
  317. package/dist/snapshot/snapshot-retrainer.js +194 -0
  318. package/dist/snapshot/snapshot-retrainer.js.map +1 -0
  319. package/dist/snapshot/snapshot-serialization.d.ts +99 -0
  320. package/dist/snapshot/snapshot-serialization.d.ts.map +1 -0
  321. package/dist/snapshot/snapshot-serialization.js +191 -0
  322. package/dist/snapshot/snapshot-serialization.js.map +1 -0
  323. package/dist/snapshot/training-snapshot-store.d.ts +38 -0
  324. package/dist/snapshot/training-snapshot-store.d.ts.map +1 -0
  325. package/dist/snapshot/training-snapshot-store.js +41 -0
  326. package/dist/snapshot/training-snapshot-store.js.map +1 -0
  327. package/dist/storage/ps-storage-provider.d.ts +108 -0
  328. package/dist/storage/ps-storage-provider.d.ts.map +1 -0
  329. package/dist/storage/ps-storage-provider.js +154 -0
  330. package/dist/storage/ps-storage-provider.js.map +1 -0
  331. package/dist/training/artifact-store.d.ts +12 -103
  332. package/dist/training/artifact-store.d.ts.map +1 -1
  333. package/dist/training/artifact-store.js +13 -137
  334. package/dist/training/artifact-store.js.map +1 -1
  335. package/dist/training/compute-cost.d.ts +23 -0
  336. package/dist/training/compute-cost.d.ts.map +1 -0
  337. package/dist/training/compute-cost.js +36 -0
  338. package/dist/training/compute-cost.js.map +1 -0
  339. package/dist/training/evaluation-protocol-store.d.ts +53 -0
  340. package/dist/training/evaluation-protocol-store.d.ts.map +1 -0
  341. package/dist/training/evaluation-protocol-store.js +54 -0
  342. package/dist/training/evaluation-protocol-store.js.map +1 -0
  343. package/dist/training/index.d.ts +9 -1
  344. package/dist/training/index.d.ts.map +1 -1
  345. package/dist/training/index.js +9 -1
  346. package/dist/training/index.js.map +1 -1
  347. package/dist/training/locked-holdout.d.ts +19 -4
  348. package/dist/training/locked-holdout.d.ts.map +1 -1
  349. package/dist/training/locked-holdout.js +29 -5
  350. package/dist/training/locked-holdout.js.map +1 -1
  351. package/dist/training/seams.d.ts +34 -8
  352. package/dist/training/seams.d.ts.map +1 -1
  353. package/dist/training/seams.js +74 -18
  354. package/dist/training/seams.js.map +1 -1
  355. package/dist/training/storage-provider-artifact-store.d.ts +49 -0
  356. package/dist/training/storage-provider-artifact-store.d.ts.map +1 -0
  357. package/dist/training/storage-provider-artifact-store.js +147 -0
  358. package/dist/training/storage-provider-artifact-store.js.map +1 -0
  359. package/dist/training/trainer-model-lineage.d.ts +32 -0
  360. package/dist/training/trainer-model-lineage.d.ts.map +1 -0
  361. package/dist/training/trainer-model-lineage.js +62 -0
  362. package/dist/training/trainer-model-lineage.js.map +1 -0
  363. package/dist/training/trainer-request.d.ts +50 -0
  364. package/dist/training/trainer-request.d.ts.map +1 -0
  365. package/dist/training/trainer-request.js +65 -0
  366. package/dist/training/trainer-request.js.map +1 -0
  367. package/dist/training/trainer-result.d.ts +30 -0
  368. package/dist/training/trainer-result.d.ts.map +1 -0
  369. package/dist/training/trainer-result.js +40 -0
  370. package/dist/training/trainer-result.js.map +1 -0
  371. package/dist/training/training-engine.d.ts +417 -64
  372. package/dist/training/training-engine.d.ts.map +1 -1
  373. package/dist/training/training-engine.js +869 -178
  374. package/dist/training/training-engine.js.map +1 -1
  375. package/dist/training/training-refusal.d.ts +15 -0
  376. package/dist/training/training-refusal.d.ts.map +1 -0
  377. package/dist/training/training-refusal.js +62 -0
  378. package/dist/training/training-refusal.js.map +1 -0
  379. package/dist/training/types.d.ts +133 -41
  380. package/dist/training/types.d.ts.map +1 -1
  381. package/dist/training/types.js +4 -4
  382. package/dist/training/unit-model-lineage.d.ts +72 -0
  383. package/dist/training/unit-model-lineage.d.ts.map +1 -0
  384. package/dist/training/unit-model-lineage.js +288 -0
  385. package/dist/training/unit-model-lineage.js.map +1 -0
  386. package/dist/tsconfig.tsbuildinfo +1 -0
  387. package/package.json +16 -13
  388. package/dist/operations/__tests__/helpers.d.ts +0 -30
  389. package/dist/operations/__tests__/helpers.d.ts.map +0 -1
  390. package/dist/operations/__tests__/helpers.js +0 -44
  391. package/dist/operations/__tests__/helpers.js.map +0 -1
@@ -9,9 +9,11 @@
9
9
  * MJ's live plumbing; the orchestrator itself depends solely on the narrow
10
10
  * interfaces, so unit tests substitute in-memory fakes and a fake clock.
11
11
  */
12
- import { Metadata, } from '@memberjunction/core';
13
- import { isErrorMetric } from '@memberjunction/predictive-studio-core';
12
+ import { LogError, Metadata, } from '@memberjunction/core';
14
13
  import { TrainingEngine } from '../training/index.js';
14
+ import { RunViewTrainingSnapshotStore } from '../snapshot/training-snapshot-store.js';
15
+ import { TrainingAttemptFailedError } from './budget.js';
16
+ import { ExperimentScores } from './scores.js';
15
17
  /** Real wall-clock {@link IClock}. Tests inject a controllable fake instead. */
16
18
  export class SystemClock {
17
19
  /** @inheritdoc */
@@ -46,8 +48,9 @@ export class MetadataExperimentEntityFactory {
46
48
  * iteration it resolves the pipeline (via an injected {@link IPipelineResolver}),
47
49
  * trains it through the engine (producing an immutable Draft `MJ: ML Models` +
48
50
  * its `MJ: ML Training Runs` leaf linked to the iteration via
49
- * `experimentSessionIterationId`), and extracts the normalized holdout Score for
50
- * the plan's `SuccessMetric` to drive the leaderboard.
51
+ * `experimentSessionIterationId`), and extracts the normalized holdout Score that
52
+ * drives the leaderboard: on the plan's `SuccessMetric`, or on the model's primary
53
+ * proper score when its holdout gave none on it ({@link ExperimentScores.ExtractNormalizedScore}).
51
54
  */
52
55
  export class TrainingEngineExperimentTrainer {
53
56
  /**
@@ -60,71 +63,66 @@ export class TrainingEngineExperimentTrainer {
60
63
  this.pipelineResolver = pipelineResolver;
61
64
  this.engine = engine;
62
65
  }
63
- /** @inheritdoc */
66
+ /**
67
+ * @inheritdoc
68
+ * The session's remaining compute seconds become the run's timeout (the engine takes the smaller of them and the
69
+ * protocol's compute budget); a session with no seconds bound leaves the protocol's.
70
+ *
71
+ * @throws TrainingAttemptFailedError when the attempt failed after its run row existed, carrying the run's compute
72
+ */
64
73
  async train(input) {
65
74
  const pipelineId = await this.pipelineResolver.resolvePipelineId(input);
66
- const { model, run } = await this.engine.trainModel({
75
+ const { model, run } = await this.trainPipeline({
67
76
  pipelineId,
68
77
  experimentSessionIterationId: input.iterationId,
69
- }, this.trainingDeps);
70
- const score = ExtractNormalizedScore(model.HoldoutMetrics, model.Metrics, input.plan.TargetDefinition.SuccessMetric, input.plan.TargetDefinition.ProblemType);
78
+ ...(input.timeoutSeconds === null ? {} : { timeoutSeconds: input.timeoutSeconds }),
79
+ }, input.iterationId);
80
+ // A run whose gate decision shipped no artifact has no model to score: the iteration completes with no score
81
+ // (its run's stored gate record says why) and the session continues.
82
+ const scored = model === null ? null : ExperimentScores.ExtractNormalizedScore(model.HoldoutMetrics, input.plan.TargetDefinition.SuccessMetric);
71
83
  return {
72
84
  model,
73
85
  run,
74
- Score: score,
86
+ Score: scored === null ? null : scored.Score,
87
+ ScoreMetric: scored === null ? null : scored.Metric,
88
+ // A NULL run ComputeCost (no PS_COMPUTE_USD_PER_SECOND rate configured) is unbudgeted: it adds 0 to the
89
+ // session's MaxComputeCost sum.
75
90
  ComputeCost: run.ComputeCost ?? 0,
91
+ ComputeSeconds: run.ComputeSeconds || 0,
76
92
  TokensUsed: 0,
77
93
  };
78
94
  }
79
- }
80
- /**
81
- * Extract the **normalized** leaderboard score from a model's holdout metrics
82
- * (preferred — the honest, search-never-saw-it number, §8.2), falling back to
83
- * the training metrics. The score is normalized so **higher is always better**:
84
- * error metrics (RMSE/MAE/loss) are negated, ranking metrics (AUC/F1/accuracy)
85
- * pass through. Returns `0` when the metric is absent (a failed/empty run).
86
- *
87
- * Exported for unit testing the normalization in isolation.
88
- *
89
- * @param holdoutMetricsJson the model's `HoldoutMetrics` JSON (preferred)
90
- * @param trainMetricsJson the model's `Metrics` JSON (fallback)
91
- * @param successMetric the plan's `SuccessMetric` (e.g. `AUC`, `RMSE`)
92
- * @param problemType classification vs. regression (informs the error-metric direction)
93
- */
94
- export function ExtractNormalizedScore(holdoutMetricsJson, trainMetricsJson, successMetric, problemType) {
95
- const metrics = parseMetrics(holdoutMetricsJson) ?? parseMetrics(trainMetricsJson) ?? {};
96
- const key = successMetric.toLowerCase();
97
- const raw = metrics[key];
98
- if (raw == null || !Number.isFinite(raw)) {
99
- return 0;
100
- }
101
- // `problemType` is retained on the signature for callers/back-compat; the
102
- // error-metric direction is metric-name driven (shared with maintenance via
103
- // the Core `isErrorMetric`) so the two consumers can never drift apart.
104
- void problemType;
105
- return isErrorMetric(key) ? -raw : raw;
106
- }
107
- /** @deprecated Use {@link ExtractNormalizedScore}. */
108
- export function extractNormalizedScore(holdoutMetricsJson, trainMetricsJson, successMetric, problemType) {
109
- return ExtractNormalizedScore(holdoutMetricsJson, trainMetricsJson, successMetric, problemType);
110
- }
111
- /** Parse a metrics JSON column into a lower-cased numeric record, or null. */
112
- function parseMetrics(json) {
113
- if (json == null || json.trim().length === 0) {
114
- return null;
115
- }
116
- try {
117
- const parsed = JSON.parse(json);
118
- const out = {};
119
- for (const [k, v] of Object.entries(parsed)) {
120
- if (typeof v === 'number') {
121
- out[k.toLowerCase()] = v;
122
- }
95
+ /**
96
+ * Train through the engine. When the attempt fails after its run row was written (a refusal at any stage after the
97
+ * run exists, or any other error), the run already recorded the compute it spent; the failure becomes a
98
+ * {@link TrainingAttemptFailedError} carrying that run's seconds and USD (the engine's error as its `cause`, its
99
+ * message unchanged), so the session charges the failed attempt what it spent. A failure before any run row exists
100
+ * spent nothing and passes through unchanged.
101
+ */
102
+ async trainPipeline(trainInput, iterationId) {
103
+ try {
104
+ return await this.engine.trainModel(trainInput, this.trainingDeps);
105
+ }
106
+ catch (err) {
107
+ const run = await this.failedAttemptRun(iterationId);
108
+ if (run === null || !(err instanceof Error))
109
+ throw err;
110
+ throw new TrainingAttemptFailedError(err.message, run.ComputeSeconds || 0, run.ComputeCost || 0, err);
123
111
  }
124
- return out;
125
112
  }
126
- catch {
127
- return null;
113
+ /**
114
+ * The run the failed attempt wrote, read through the training deps' run reader, or null when it wrote none. A failed
115
+ * read is logged and treated as no run, so it never masks the attempt's own error.
116
+ */
117
+ async failedAttemptRun(iterationId) {
118
+ const runs = this.trainingDeps.snapshots || new RunViewTrainingSnapshotStore(this.trainingDeps.provider, this.trainingDeps.contextUser);
119
+ try {
120
+ return await runs.FindRunForIteration(iterationId);
121
+ }
122
+ catch (readErr) {
123
+ LogError(`TrainingEngineExperimentTrainer: reading the run of failed iteration ${iterationId} failed: ${readErr instanceof Error ? readErr.message : String(readErr)}`);
124
+ return null;
125
+ }
128
126
  }
129
127
  }
130
128
  //# sourceMappingURL=seams.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"seams.js","sourceRoot":"","sources":["../../src/experiment/seams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,QAAQ,GAIT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAU7C,gFAAgF;AAChF,MAAM,OAAO,WAAW;IACtB,kBAAkB;IACX,GAAG;QACR,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;IACpB,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,+BAA+B;IAC1C;;;;OAIG;IACH,YAA6B,QAA4B;QAA5B,aAAQ,GAAR,QAAQ,CAAoB;IAAG,CAAC;IAE7D,kBAAkB;IACX,KAAK,CAAC,eAAe,CAAuB,UAAkB,EAAE,WAAsB;QAC3F,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAI,UAAU,EAAE,WAAW,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAChG,CAAC;QACD,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC3C,OAAO,EAAE,CAAC,eAAe,CAAI,UAAU,EAAE,WAAW,CAAC,CAAC;IACxD,CAAC;CACF;AA0BD;;;;;;;GAOG;AACH,MAAM,OAAO,+BAA+B;IAC1C;;;;OAIG;IACH,YACmB,YAA0B,EAC1B,gBAAmC,EACnC,SAAyB,I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CAAC,GAAG,YAAY,KAAK,CAAC;gBAAE,MAAM,GAAG,CAAC;YACvD,MAAM,IAAI,0BAA0B,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,cAAc,IAAI,CAAC,EAAE,GAAG,CAAC,WAAW,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACxG,CAAC;IACH,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,gBAAgB,CAAC,WAAmB;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,IAAI,IAAI,4BAA4B,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QACxI,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,OAAO,EAAE,CAAC;YACjB,QAAQ,CAAC,wEAAwE,WAAW,YAAY,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACxK,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
@@ -15,7 +15,7 @@
15
15
  * a leaderboard, pruning, and a between-wave budget gate.
16
16
  */
17
17
  import type { BaseEntity, UserInfo, IMetadataProvider } from '@memberjunction/core';
18
- import type { ModelingPlanSpec, Budget, LeaderboardEntry } from '@memberjunction/predictive-studio-core';
18
+ import type { ModelingPlanSpec, Budget, Budgets, LeaderboardEntry } from '@memberjunction/predictive-studio-core';
19
19
  import type { MJExperimentEntity, MJExperimentSessionEntity, MJExperimentSessionIterationEntity, MJMLModelEntity, MJMLTrainingRunEntity } from '@memberjunction/core-entities';
20
20
  /**
21
21
  * One proposed experiment lifted off a {@link ModelingPlanSpec}. Mirrors an
@@ -23,6 +23,30 @@ import type { MJExperimentEntity, MJExperimentSessionEntity, MJExperimentSession
23
23
  * the orchestrator code reads against a named type.
24
24
  */
25
25
  export type ProposedExperiment = ModelingPlanSpec['ProposedExperiments'][number];
26
+ /** A model's normalized leaderboard score and the holdout metric it was read from. */
27
+ export interface ExperimentScore {
28
+ /** The normalized score: higher is always better (a lower-is-better metric is negated). */
29
+ readonly Score: number;
30
+ /** The holdout metric the score was read from, lower-cased as the model's `HoldoutMetrics` key. */
31
+ readonly Metric: string;
32
+ }
33
+ /**
34
+ * An experiment session's leaderboard entry: the Core entry plus the holdout metric its normalized `Metric` was read
35
+ * from, so the leaderboard (the session's snapshot and the run's result) states each entry's metric.
36
+ */
37
+ export interface ExperimentLeaderboardEntry extends LeaderboardEntry {
38
+ /**
39
+ * The holdout metric `Metric` was read from: the plan's success metric, or the model's primary proper score when its
40
+ * holdout gave no score on the success metric (a kept simple baseline stores its primary score alone).
41
+ */
42
+ readonly ScoreMetric: string;
43
+ /**
44
+ * True when `ScoreMetric` is the plan's success metric. Numbers of two metrics are not comparable, so an entry on the
45
+ * success metric ranks above every entry on a fallback metric: a kept simple baseline is the model a shipped
46
+ * finalist of the same unit and protocol beat at its own gate.
47
+ */
48
+ readonly OnSuccessMetric: boolean;
49
+ }
26
50
  /**
27
51
  * Factory seam for creating strongly-typed entity objects. Wraps
28
52
  * `Metadata.GetEntityObject` in production; tests inject a fake returning
@@ -88,6 +112,11 @@ export interface TrainExperimentInput {
88
112
  contextUser?: UserInfo;
89
113
  /** Optional provider for multi-provider correctness. */
90
114
  provider?: IMetadataProvider;
115
+ /**
116
+ * Compute seconds the session has left: the attempt's trainer timeout is at most this. Null when the session has no
117
+ * compute-seconds bound.
118
+ */
119
+ timeoutSeconds: number | null;
91
120
  }
92
121
  /**
93
122
  * The result of training one experiment — the model produced, the training-run
@@ -95,14 +124,22 @@ export interface TrainExperimentInput {
95
124
  * compute/token cost attributed to the attempt (for budget enforcement, §8.4).
96
125
  */
97
126
  export interface TrainExperimentResult {
98
- /** The immutable `MJ: ML Models` row produced (Draft). */
99
- model: MJMLModelEntity;
127
+ /** The immutable `MJ: ML Models` row produced (Draft); null when the run's gate decision shipped no artifact. */
128
+ model: MJMLModelEntity | null;
100
129
  /** The `MJ: ML Training Runs` leaf recording the attempt (linked to the iteration). */
101
130
  run: MJMLTrainingRunEntity;
102
- /** Normalized holdout metric for the plan's `SuccessMetric` — drives the leaderboard. */
103
- Score: number;
104
- /** Compute cost attributed to this attempt (defaults to 0 when unknown). */
131
+ /**
132
+ * Normalized holdout score (higher is better) — drives the leaderboard: on the plan's `SuccessMetric`, or on the model's
133
+ * primary proper score when its holdout gave no score on the success metric; null when neither gives one (or no model
134
+ * shipped).
135
+ */
136
+ Score: number | null;
137
+ /** The holdout metric `Score` was read from ({@link ExperimentScore.Metric}); null exactly when `Score` is null. */
138
+ ScoreMetric: string | null;
139
+ /** Compute cost attributed to this attempt, in USD (defaults to 0 when unknown). */
105
140
  ComputeCost?: number;
141
+ /** Compute seconds the attempt spent (defaults to 0 when unknown); the session's compute-seconds bound sums these. */
142
+ ComputeSeconds?: number;
106
143
  /** LLM tokens used by this attempt (defaults to 0 when unknown). */
107
144
  TokensUsed?: number;
108
145
  }
@@ -135,7 +172,7 @@ export interface WaveStrategistContext {
135
172
  /** Experiments NOT yet dispatched (deterministic default draws from here, priority-ordered). */
136
173
  remaining: ProposedExperiment[];
137
174
  /** The current leaderboard, best-first, across all completed iterations so far. */
138
- leaderboard: LeaderboardEntry[];
175
+ leaderboard: ExperimentLeaderboardEntry[];
139
176
  /** Index of the wave about to be produced (0-based). */
140
177
  waveIndex: number;
141
178
  /** The max iterations this wave may contain (the configured concurrency). */
@@ -160,8 +197,10 @@ export interface ExperimentRunOptions {
160
197
  /**
161
198
  * Prune any completed iteration whose Score is below
162
199
  * `bestScore * relativePruneThreshold` (a fraction in [0,1]). E.g. `0.8`
163
- * prunes anything scoring under 80% of the current best. When omitted, no
164
- * relative prune is applied.
200
+ * prunes anything scoring under 80% of the current best. A negative best (a
201
+ * negated loss) is bounded the other way: `0.8` prunes a loss more than
202
+ * `bestLoss / 0.8`. Only scores on the best's own metric are compared. When
203
+ * omitted, no relative prune is applied.
165
204
  */
166
205
  relativePruneThreshold?: number;
167
206
  /**
@@ -178,6 +217,12 @@ export interface ExperimentRunOptions {
178
217
  * omitted, the orchestrator creates a new durable Experiment definition.
179
218
  */
180
219
  experimentID?: string;
220
+ /**
221
+ * The trainer budgets of the Evaluation Protocol the session's pipeline is bound to
222
+ * (`ExperimentBudget.ProtocolBudgetsFor`). They tighten the session budget: at most `maxCandidates` attempts and
223
+ * `maxComputeSeconds` compute seconds in total, failed attempts included. Omitted when the session runs under no protocol.
224
+ */
225
+ protocolBudgets?: Budgets;
181
226
  }
182
227
  /**
183
228
  * The injected dependency bundle passed to
@@ -217,7 +262,7 @@ export interface ExperimentSessionResult {
217
262
  /** All `MJ: Experiment Session Iterations` created during the run. */
218
263
  iterations: MJExperimentSessionIterationEntity[];
219
264
  /** The final leaderboard, best-first. */
220
- leaderboard: LeaderboardEntry[];
265
+ leaderboard: ExperimentLeaderboardEntry[];
221
266
  /** The best (winning) model surfaced, if any iteration produced one. */
222
267
  bestModel: MJMLModelEntity | null;
223
268
  /** Why the session stopped (completed vs. a clean budget pause). */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/experiment/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,KAAK,EACV,gBAAgB,EAChB,MAAM,EACN,gBAAgB,EACjB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,kCAAkC,EAClC,eAAe,EACf,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AAEvC;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,qBAAqB,CAAC,CAAC,MAAM,CAAC,C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AChB,uBAAuB,GACvB,qBAAqB,CAAC;AAE1B;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,gDAAgD;IAChD,UAAU,EAAE,kBAAkB,CAAC;IAC/B,wEAAwE;IACxE,OAAO,EAAE,yBAAyB,CAAC;IACnC,sEAAsE;IACtE,UAAU,EAAE,kCAAkC,EAAE,CAAC;IACjD,yCAAyC;IACzC,WAAW,EAAE,0BAA0B,EAAE,CAAC;IAC1C,wEAAwE;IACxE,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,oEAAoE;IACpE,UAAU,EAAE,iBAAiB,CAAC;CAC/B;AAED,kFAAkF;AAClF,eAAO,MAAM,wBAAwB,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/experiment/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA8OH,kFAAkF;AAClF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/experiment/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA8RH,kFAAkF;AAClF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC"}