@memberjunction/ng-dashboards 6.1.2 → 6.2.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/dist/AI/components/vectors/vector-management-resource.component.d.ts +6 -1
- package/dist/AI/components/vectors/vector-management-resource.component.d.ts.map +1 -1
- package/dist/AI/components/vectors/vector-management-resource.component.js +99 -45
- package/dist/AI/components/vectors/vector-management-resource.component.js.map +1 -1
- package/dist/DataExplorer/components/navigation-panel/navigation-panel.component.d.ts +4 -0
- package/dist/DataExplorer/components/navigation-panel/navigation-panel.component.d.ts.map +1 -1
- package/dist/DataExplorer/components/navigation-panel/navigation-panel.component.js +16 -6
- package/dist/DataExplorer/components/navigation-panel/navigation-panel.component.js.map +1 -1
- package/dist/DataExplorer/data-explorer-dashboard.component.d.ts +4 -0
- package/dist/DataExplorer/data-explorer-dashboard.component.d.ts.map +1 -1
- package/dist/DataExplorer/data-explorer-dashboard.component.js +14 -4
- package/dist/DataExplorer/data-explorer-dashboard.component.js.map +1 -1
- package/dist/DataExplorer/services/explorer-state.service.js +2 -2
- package/dist/DataExplorer/services/explorer-state.service.js.map +1 -1
- package/dist/DevTools/graphql-console.component.d.ts.map +1 -1
- package/dist/DevTools/graphql-console.component.js +2 -0
- package/dist/DevTools/graphql-console.component.js.map +1 -1
- package/dist/Integration/components/connections/connections.component.d.ts.map +1 -1
- package/dist/Integration/components/connections/connections.component.js +2 -0
- package/dist/Integration/components/connections/connections.component.js.map +1 -1
- package/dist/KnowledgeHub/components/feature-pipelines/feature-pipelines-resource.component.d.ts +4 -12
- package/dist/KnowledgeHub/components/feature-pipelines/feature-pipelines-resource.component.d.ts.map +1 -1
- package/dist/KnowledgeHub/components/feature-pipelines/feature-pipelines-resource.component.js +39 -78
- package/dist/KnowledgeHub/components/feature-pipelines/feature-pipelines-resource.component.js.map +1 -1
- package/dist/Lists/components/lists-browse-resource.component.d.ts +3 -0
- package/dist/Lists/components/lists-browse-resource.component.d.ts.map +1 -1
- package/dist/Lists/components/lists-browse-resource.component.js +7 -6
- package/dist/Lists/components/lists-browse-resource.component.js.map +1 -1
- package/dist/Lists/components/lists-my-lists-resource.component.d.ts +3 -0
- package/dist/Lists/components/lists-my-lists-resource.component.d.ts.map +1 -1
- package/dist/Lists/components/lists-my-lists-resource.component.js +7 -6
- package/dist/Lists/components/lists-my-lists-resource.component.js.map +1 -1
- package/dist/PredictiveStudio/at-risk.view-models.d.ts +41 -3
- package/dist/PredictiveStudio/at-risk.view-models.d.ts.map +1 -1
- package/dist/PredictiveStudio/at-risk.view-models.js +99 -6
- package/dist/PredictiveStudio/at-risk.view-models.js.map +1 -1
- package/dist/PredictiveStudio/components/ps-catalog.component.d.ts +4 -1
- package/dist/PredictiveStudio/components/ps-catalog.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/components/ps-catalog.component.js +61 -37
- package/dist/PredictiveStudio/components/ps-catalog.component.js.map +1 -1
- package/dist/PredictiveStudio/components/ps-experiments.component.d.ts +12 -0
- package/dist/PredictiveStudio/components/ps-experiments.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/components/ps-experiments.component.js +426 -184
- package/dist/PredictiveStudio/components/ps-experiments.component.js.map +1 -1
- package/dist/PredictiveStudio/components/ps-pipeline-wizard.component.d.ts +84 -0
- package/dist/PredictiveStudio/components/ps-pipeline-wizard.component.d.ts.map +1 -0
- package/dist/PredictiveStudio/components/ps-pipeline-wizard.component.js +1397 -0
- package/dist/PredictiveStudio/components/ps-pipeline-wizard.component.js.map +1 -0
- package/dist/PredictiveStudio/components/ps-pipelines.component.d.ts +66 -34
- package/dist/PredictiveStudio/components/ps-pipelines.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/components/ps-pipelines.component.js +2456 -743
- package/dist/PredictiveStudio/components/ps-pipelines.component.js.map +1 -1
- package/dist/PredictiveStudio/components/ps-predictions-grid.component.d.ts +194 -0
- package/dist/PredictiveStudio/components/ps-predictions-grid.component.d.ts.map +1 -0
- package/dist/PredictiveStudio/components/ps-predictions-grid.component.js +1902 -0
- package/dist/PredictiveStudio/components/ps-predictions-grid.component.js.map +1 -0
- package/dist/PredictiveStudio/components/ps-production.component.d.ts +17 -1
- package/dist/PredictiveStudio/components/ps-production.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/components/ps-production.component.js +653 -372
- package/dist/PredictiveStudio/components/ps-production.component.js.map +1 -1
- package/dist/PredictiveStudio/components/ps-registry.component.d.ts +21 -61
- package/dist/PredictiveStudio/components/ps-registry.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/components/ps-registry.component.js +214 -681
- package/dist/PredictiveStudio/components/ps-registry.component.js.map +1 -1
- package/dist/PredictiveStudio/components/ps-run-experiment-modal.component.d.ts +49 -0
- package/dist/PredictiveStudio/components/ps-run-experiment-modal.component.d.ts.map +1 -0
- package/dist/PredictiveStudio/components/ps-run-experiment-modal.component.js +658 -0
- package/dist/PredictiveStudio/components/ps-run-experiment-modal.component.js.map +1 -0
- package/dist/PredictiveStudio/predictive-studio-score-history.service.d.ts +42 -0
- package/dist/PredictiveStudio/predictive-studio-score-history.service.d.ts.map +1 -0
- package/dist/PredictiveStudio/predictive-studio-score-history.service.js +90 -0
- package/dist/PredictiveStudio/predictive-studio-score-history.service.js.map +1 -0
- package/dist/PredictiveStudio/predictive-studio.view-models.d.ts +14 -2
- package/dist/PredictiveStudio/predictive-studio.view-models.d.ts.map +1 -1
- package/dist/PredictiveStudio/predictive-studio.view-models.js +41 -5
- package/dist/PredictiveStudio/predictive-studio.view-models.js.map +1 -1
- package/dist/PredictiveStudio/resources/ps-models-resource.component.d.ts +9 -1
- package/dist/PredictiveStudio/resources/ps-models-resource.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/resources/ps-models-resource.component.js +178 -65
- package/dist/PredictiveStudio/resources/ps-models-resource.component.js.map +1 -1
- package/dist/PredictiveStudio/resources/ps-predictions-resource.component.d.ts +9 -1
- package/dist/PredictiveStudio/resources/ps-predictions-resource.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/resources/ps-predictions-resource.component.js +307 -369
- package/dist/PredictiveStudio/resources/ps-predictions-resource.component.js.map +1 -1
- package/dist/PredictiveStudio/resources/ps-resource-base.js +1 -1
- package/dist/PredictiveStudio/resources/ps-resource-base.js.map +1 -1
- package/dist/PredictiveStudio/resources/ps-studio-resource.component.d.ts +17 -1
- package/dist/PredictiveStudio/resources/ps-studio-resource.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/resources/ps-studio-resource.component.js +309 -138
- package/dist/PredictiveStudio/resources/ps-studio-resource.component.js.map +1 -1
- package/dist/VersionHistory/components/graph-resource.component.d.ts +1 -0
- package/dist/VersionHistory/components/graph-resource.component.d.ts.map +1 -1
- package/dist/VersionHistory/components/graph-resource.component.js +6 -5
- package/dist/VersionHistory/components/graph-resource.component.js.map +1 -1
- package/dist/predictive-studio-dashboards.module.d.ts +10 -8
- package/dist/predictive-studio-dashboards.module.d.ts.map +1 -1
- package/dist/predictive-studio-dashboards.module.js +13 -3
- package/dist/predictive-studio-dashboards.module.js.map +1 -1
- package/package.json +64 -63
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ps-run-experiment-modal.component.js","sourceRoot":"","sources":["../../../src/PredictiveStudio/components/ps-run-experiment-modal.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,KAAK,EAEL,MAAM,EACN,iBAAiB,EACjB,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAGL,+CAA+C,GAChD,MAA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AjB,mCAAiB;YAInB,eAA6B;YAA7B,mDAA6B;YAC3F,cAIC;YAJD,oCAIC;4BAnJD,YAAY,EAAE,WAAW,mMAAE,iBAAiB;;iFA0J3C,6BAA6B;cA7JzC,SAAS;6BACI,IAAI,YACN,yBAAyB,WAC1B,CAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,CAAC,iBACxC,iBAAiB,CAAC,IAAI,YAE3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqJT;;kBAGA,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kFAPI,6BAA6B","sourcesContent":["import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MJButtonDirective } from '@memberjunction/ng-ui-components';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { IMetadataProvider, UserInfo } from '@memberjunction/core';\nimport {\n MJMLAlgorithmEntity,\n MJMLTrainingPipelineEntity,\n PredictiveStudioStartExperimentSessionOperation,\n} from '@memberjunction/core-entities';\nimport {\n DOMINANCE_THRESHOLD_DEFAULT,\n type SourceBinding,\n type FeatureStepGraph,\n type LeakageGuard,\n type AsOfStrategy,\n type ValidationStrategy,\n type ModelingPlanSpec,\n type Budget,\n} from '@memberjunction/predictive-studio-core';\nimport { PredictiveStudioEngine } from '../engine/predictive-studio.engine';\n\nconst ALGO_ICONS: Record<string, string> = {\n xgboost: 'fa-solid fa-bolt',\n lightgbm: 'fa-solid fa-feather',\n logistic_regression: 'fa-solid fa-wave-square',\n random_forest: 'fa-solid fa-tree',\n ridge: 'fa-solid fa-ruler',\n linear_regression: 'fa-solid fa-ruler',\n mlp: 'fa-solid fa-network-wired',\n};\n\n/**\n * Manual Experiment Runner modal — lets data scientists configure and launch a\n * multi-algorithm tournament session on an existing training pipeline.\n */\n@Component({\n standalone: true,\n selector: 'ps-run-experiment-modal',\n imports: [CommonModule, FormsModule, MJButtonDirective],\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['../predictive-studio.shared.css', './ps-run-experiment-modal.component.css'],\n template: `\n <div class=\"ps-modal-backdrop\" (click)=\"onBackdropClick($event)\">\n <div class=\"ps-modal-dialog ps-run-exp-dialog\" role=\"dialog\" aria-modal=\"true\" data-testid=\"ps-run-experiment-modal\">\n <!-- Header -->\n <div class=\"ps-wizard-header\">\n <div class=\"ps-wizard-header-title\">\n <i class=\"fa-solid fa-flask\" style=\"color: var(--mj-brand-primary)\"></i>\n <div>\n <h2>Run Multi-Algorithm Experiment</h2>\n <span class=\"ps-wizard-subtitle\">Execute a tournament search across multiple algorithms under bounded budget</span>\n </div>\n </div>\n <button class=\"ps-wizard-close\" (click)=\"cancel()\" aria-label=\"Close dialog\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n </div>\n\n <!-- Body -->\n <div class=\"ps-run-exp-body\">\n <!-- Step 1: Select Pipeline -->\n <div class=\"ps-form-group\">\n <label class=\"ps-form-label\">\n <i class=\"fa-solid fa-diagram-project\"></i> Training Pipeline\n </label>\n <select class=\"mj-input\" [ngModel]=\"selectedPipelineId\" (ngModelChange)=\"onPipelineChange($event)\" [disabled]=\"busy\">\n @for (p of engine.Pipelines; track p.ID) {\n <option [value]=\"p.ID\">{{ p.Name }} (Target: {{ p.TargetVariable || 'None' }})</option>\n }\n </select>\n <span class=\"ps-form-hint\">\n The dataset, feature assembly graph, and leakage deny-list are derived from this pipeline.\n </span>\n </div>\n\n <!-- Session Name & Goal -->\n <div class=\"exp-grid-2\">\n <div class=\"ps-form-group\">\n <label class=\"ps-form-label\">Session Name</label>\n <input class=\"mj-input\" type=\"text\" [(ngModel)]=\"sessionName\" placeholder=\"e.g. Churn Tournament Q3\" [disabled]=\"busy\" />\n </div>\n <div class=\"ps-form-group\">\n <label class=\"ps-form-label\">Evaluation Metric</label>\n <select class=\"mj-input\" [(ngModel)]=\"successMetric\" [disabled]=\"busy\">\n @if (problemType === 'classification') {\n <option value=\"AUC\">ROC-AUC (Default)</option>\n <option value=\"F1\">F1 Score</option>\n <option value=\"Accuracy\">Accuracy</option>\n } @else {\n <option value=\"RMSE\">RMSE (Default)</option>\n <option value=\"MAE\">MAE</option>\n <option value=\"R2\">R-Squared</option>\n }\n </select>\n </div>\n </div>\n\n <div class=\"ps-form-group\">\n <label class=\"ps-form-label\">Experiment Goal</label>\n <input class=\"mj-input\" type=\"text\" [(ngModel)]=\"goal\" placeholder=\"e.g. Find best algorithm on holdout split\" [disabled]=\"busy\" />\n </div>\n\n <!-- Step 2: Algorithm Candidates -->\n <div class=\"ps-form-group\">\n <div class=\"algo-bar-actions\">\n <label class=\"ps-form-label\" style=\"margin-bottom:0\">\n <i class=\"fa-solid fa-shapes\"></i> Candidate Algorithms ({{ selectedAlgoIds.size }} selected)\n </label>\n <div style=\"display:flex; gap:8px\">\n <button type=\"button\" class=\"ps-link-btn\" (click)=\"selectAllAlgos()\" [disabled]=\"busy\">Select All</button>\n <span class=\"ps-muted\">·</span>\n <button type=\"button\" class=\"ps-link-btn\" (click)=\"selectRecommendedAlgos()\" [disabled]=\"busy\">Recommended</button>\n <span class=\"ps-muted\">·</span>\n <button type=\"button\" class=\"ps-link-btn\" (click)=\"clearAlgos()\" [disabled]=\"busy\">Clear</button>\n </div>\n </div>\n\n <div class=\"algo-selection-grid\">\n @for (algo of availableAlgorithms; track algo.ID) {\n <div class=\"algo-select-card\"\n [class.selected]=\"isAlgoSelected(algo.ID)\"\n (click)=\"toggleAlgo(algo.ID)\">\n <input type=\"checkbox\"\n [checked]=\"isAlgoSelected(algo.ID)\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"toggleAlgo(algo.ID)\"\n [disabled]=\"busy\" />\n <div class=\"algo-select-info\">\n <div class=\"algo-select-name\">\n <i [class]=\"getAlgoIcon(algo.DriverClass)\"></i>\n <span>{{ algo.Name }}</span>\n </div>\n @if (algo.Description) {\n <div class=\"algo-select-desc\">{{ algo.Description }}</div>\n }\n <div class=\"algo-select-tags\">\n @if (algo.SupportsFeatureImportance) {\n <span class=\"ps-badge green\" style=\"font-size:10px\">Importance</span>\n }\n <span class=\"ps-tag\" style=\"font-size:10px\">{{ algo.DriverClass }}</span>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n\n <!-- Step 3: Validation & Budget -->\n <div class=\"exp-grid-3\">\n <div class=\"ps-form-group\">\n <label class=\"ps-form-label\">Max Iterations (Trials)</label>\n <input class=\"mj-input\" type=\"number\" min=\"1\" max=\"100\" [(ngModel)]=\"budgetRuns\" [disabled]=\"busy\" />\n <span class=\"ps-form-hint\">Total model training runs bounded</span>\n </div>\n <div class=\"ps-form-group\">\n <label class=\"ps-form-label\">Compute Cost Cap ($)</label>\n <input class=\"mj-input\" type=\"number\" min=\"1\" max=\"500\" [(ngModel)]=\"budgetCost\" [disabled]=\"busy\" />\n <span class=\"ps-form-hint\">Max spending for cloud / GPU compute</span>\n </div>\n <div class=\"ps-form-group\">\n <label class=\"ps-form-label\">Wall-Clock Cap (Minutes)</label>\n <input class=\"mj-input\" type=\"number\" min=\"5\" max=\"300\" [(ngModel)]=\"budgetMinutes\" [disabled]=\"busy\" />\n <span class=\"ps-form-hint\">Session timeouts if exceeded</span>\n </div>\n </div>\n\n <div class=\"budget-banner\">\n <i class=\"fa-solid fa-shield-halved\"></i>\n <div style=\"font-size: 12px; color: var(--mj-text-secondary)\">\n <strong>Autonomous Guardrails:</strong> The session will run across waves, evaluate each candidate on a locked holdout fraction ({{ holdoutPercent }}%), rank them on the leaderboard by {{ successMetric }}, and automatically prune unpromising configurations.\n </div>\n </div>\n </div>\n\n <!-- Footer -->\n <div class=\"ps-wizard-footer\">\n <button mjButton variant=\"secondary\" size=\"md\" (click)=\"cancel()\" [disabled]=\"busy\">\n Cancel\n </button>\n <span class=\"ps-spacer\"></span>\n <button mjButton variant=\"primary\" size=\"md\" (click)=\"launch()\" [disabled]=\"busy || !isValid\">\n @if (busy) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i> Launching Experiment…\n } @else {\n <i class=\"fa-solid fa-play\"></i> Launch Experiment\n }\n </button>\n </div>\n </div>\n </div>\n `,\n})\nexport class PSRunExperimentModalComponent implements OnInit {\n @Input() engine!: PredictiveStudioEngine;\n @Input() provider: IMetadataProvider | null = null;\n @Input() currentUser: UserInfo | null = null;\n @Input() preselectedPipelineId?: string;\n\n @Output() closed = new EventEmitter<void>();\n @Output() started = new EventEmitter<string>();\n\n private cdr = inject(ChangeDetectorRef);\n private notifications = inject(MJNotificationService);\n\n public selectedPipelineId = '';\n public sessionName = '';\n public goal = '';\n public successMetric: 'AUC' | 'F1' | 'Accuracy' | 'RMSE' | 'MAE' | 'R2' = 'AUC';\n public problemType: 'classification' | 'regression' = 'classification';\n\n public selectedAlgoIds = new Set<string>();\n\n public budgetRuns = 15;\n public budgetCost = 25;\n public budgetMinutes = 30;\n public holdoutPercent = 15;\n\n public busy = false;\n\n ngOnInit(): void {\n const pipelines = this.engine?.Pipelines ?? [];\n if (this.preselectedPipelineId && pipelines.some((p) => UUIDsEqual(p.ID, this.preselectedPipelineId))) {\n this.selectedPipelineId = this.preselectedPipelineId;\n } else if (pipelines.length > 0) {\n this.selectedPipelineId = pipelines[0].ID;\n }\n this.syncFromSelectedPipeline();\n }\n\n public get availableAlgorithms(): MJMLAlgorithmEntity[] {\n return this.engine?.Algorithms ?? [];\n }\n\n public get selectedPipeline(): MJMLTrainingPipelineEntity | undefined {\n return this.engine?.Pipelines.find((p) => UUIDsEqual(p.ID, this.selectedPipelineId));\n }\n\n public onPipelineChange(newId: string): void {\n this.selectedPipelineId = newId;\n this.syncFromSelectedPipeline();\n }\n\n private syncFromSelectedPipeline(): void {\n const p = this.selectedPipeline;\n if (!p) return;\n this.problemType = (p.ProblemType as 'classification' | 'regression') || 'classification';\n this.successMetric = this.problemType === 'classification' ? 'AUC' : 'RMSE';\n this.sessionName = `${p.Name} — Multi-Algorithm Tournament`;\n this.goal = `Evaluate and compare algorithms on ${p.Name} to maximize ${this.successMetric}.`;\n this.selectRecommendedAlgos();\n }\n\n public selectRecommendedAlgos(): void {\n this.selectedAlgoIds.clear();\n const pt = this.problemType;\n for (const algo of this.availableAlgorithms) {\n const types = (algo.ProblemTypes || '').toLowerCase();\n if (types.includes(pt) || types.length === 0) {\n // Recommend gradient boosting and random forest by default\n const dc = (algo.DriverClass || '').toLowerCase();\n if (dc.includes('xgboost') || dc.includes('lightgbm') || dc.includes('forest') || dc.includes('logistic')) {\n this.selectedAlgoIds.add(algo.ID);\n }\n }\n }\n if (this.selectedAlgoIds.size === 0) {\n // Fallback: select first 3\n this.availableAlgorithms.slice(0, 3).forEach((a) => this.selectedAlgoIds.add(a.ID));\n }\n }\n\n public selectAllAlgos(): void {\n this.availableAlgorithms.forEach((a) => this.selectedAlgoIds.add(a.ID));\n }\n\n public clearAlgos(): void {\n this.selectedAlgoIds.clear();\n }\n\n public isAlgoSelected(id: string): boolean {\n return this.selectedAlgoIds.has(id);\n }\n\n public toggleAlgo(id: string): void {\n if (this.selectedAlgoIds.has(id)) {\n this.selectedAlgoIds.delete(id);\n } else {\n this.selectedAlgoIds.add(id);\n }\n }\n\n public getAlgoIcon(driverClass: string): string {\n const key = (driverClass || '').toLowerCase();\n for (const [k, icon] of Object.entries(ALGO_ICONS)) {\n if (key.includes(k)) return icon;\n }\n return 'fa-solid fa-chart-line';\n }\n\n public get isValid(): boolean {\n return Boolean(\n this.selectedPipelineId &&\n this.sessionName.trim() &&\n this.selectedAlgoIds.size > 0 &&\n this.budgetRuns > 0 &&\n this.budgetCost > 0\n );\n }\n\n public cancel(): void {\n if (this.busy) return;\n this.closed.emit();\n }\n\n public onBackdropClick(event: MouseEvent): void {\n if (event.target === event.currentTarget && !this.busy) {\n this.cancel();\n }\n }\n\n public async launch(): Promise<void> {\n const pipeline = this.selectedPipeline;\n if (!pipeline || !this.isValid || this.busy) return;\n\n this.busy = true;\n this.notifications.CreateSimpleNotification('Starting experiment session…', 'info', 3000);\n\n try {\n // Parse pipeline configuration\n const sources = this.parseJson<SourceBinding[]>(pipeline.SourceBindings, []);\n const stepGraph = this.parseJson<FeatureStepGraph>(pipeline.FeatureSteps, { Steps: [] });\n const leakage = this.parseJson<LeakageGuard>(pipeline.LeakageGuard, {\n DenyFields: [],\n SingleFeatureDominanceThreshold: DOMINANCE_THRESHOLD_DEFAULT,\n });\n const asOf = this.parseJson<AsOfStrategy>(pipeline.AsOfStrategy, { Mode: 'none' });\n const validation = this.parseJson<ValidationStrategy>(pipeline.ValidationStrategy, {\n Strategy: 'train_test_split',\n TestSize: 0.2,\n LockedHoldoutFraction: 0.15,\n });\n\n const sourceEntity = sources[0]?.Ref || 'Entity';\n const features: string[] = [];\n for (const step of stepGraph.Steps ?? []) {\n if ('Columns' in step && Array.isArray(step.Columns)) {\n features.push(...step.Columns);\n } else if ('Column' in step && typeof step.Column === 'string') {\n features.push(step.Column);\n }\n }\n\n const selectedAlgos = this.availableAlgorithms.filter((a) => this.selectedAlgoIds.has(a.ID));\n\n const planSpec: ModelingPlanSpec = {\n Goal: this.goal.trim() || `Optimize model for ${pipeline.Name}`,\n TargetDefinition: {\n EntityName: sourceEntity,\n TargetVariable: pipeline.TargetVariable || 'Target',\n ProblemType: this.problemType,\n SuccessMetric: this.successMetric,\n AsOfStrategy: asOf,\n },\n CandidateSources: sources.map((s) => ({\n Kind: s.Kind,\n Ref: s.Ref,\n Why: 'Configured in training pipeline',\n })),\n CandidateFeatures: features.map((f) => ({\n Name: f,\n SourceRef: sourceEntity,\n Kind: 'numeric',\n Why: 'Selected in pipeline feature steps',\n })),\n LeakageNotes: (leakage.DenyFields || []).map((field) => ({\n Field: field,\n Risk: 'Deny-listed leakage risk',\n Action: 'exclude',\n })),\n ProposedExperiments: selectedAlgos.map((algo, index) => ({\n Label: `${algo.Name} (tournament trial)`,\n AlgorithmName: algo.Name,\n FeatureSet: features,\n Rationale: `Evaluate ${algo.Name} across pipeline features`,\n Priority: index + 1,\n })),\n ValidationStrategy: validation,\n ProposedBudget: {\n MaxRuns: this.budgetRuns,\n MaxComputeCost: this.budgetCost,\n MaxWallclockMinutes: this.budgetMinutes,\n },\n Approved: true,\n };\n\n const budget: Budget = {\n MaxRuns: this.budgetRuns,\n MaxComputeCost: this.budgetCost,\n MaxWallclockMinutes: this.budgetMinutes,\n };\n\n const op = new PredictiveStudioStartExperimentSessionOperation();\n const result = await op.Execute(\n {\n planSpec,\n budget,\n },\n { provider: this.provider ?? undefined, user: this.currentUser ?? undefined },\n );\n\n if (result.Success && result.Output) {\n this.notifications.CreateSimpleNotification(\n `Experiment session started! Session ID: ${result.Output.sessionId}`,\n 'success',\n 5000,\n );\n this.started.emit(result.Output.sessionId);\n this.closed.emit();\n } else {\n this.notifications.CreateSimpleNotification(\n result.ErrorMessage || 'Failed to start experiment session.',\n 'error',\n 6000,\n );\n }\n } catch (err) {\n this.notifications.CreateSimpleNotification(\n `Experiment error: ${err instanceof Error ? err.message : String(err)}`,\n 'error',\n 6000,\n );\n } finally {\n this.busy = false;\n this.cdr.detectChanges();\n }\n }\n\n private parseJson<T>(raw: string | null | undefined, fallback: T): T {\n if (!raw) return fallback;\n try {\n const val: unknown = JSON.parse(raw);\n return (val ?? fallback) as T;\n } catch {\n return fallback;\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { UserInfo, type IMetadataProvider } from '@memberjunction/core';
|
|
2
|
+
import { type RowDriver } from './at-risk.view-models';
|
|
3
|
+
import { type OutcomeConfig } from '@memberjunction/predictive-studio-core';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/** One historical score point for an entity record produced by a model run. */
|
|
6
|
+
export interface ModelScoreHistoryPoint {
|
|
7
|
+
runId: string;
|
|
8
|
+
runDate: Date;
|
|
9
|
+
score: number;
|
|
10
|
+
scoreFormatted: string;
|
|
11
|
+
riskPct: number;
|
|
12
|
+
class: string | null;
|
|
13
|
+
band: 'high' | 'medium' | 'low' | string;
|
|
14
|
+
status: string;
|
|
15
|
+
durationMs: number | null;
|
|
16
|
+
drivers: RowDriver[];
|
|
17
|
+
/** Score delta compared to previous run (e.g. +0.05 or -0.12), or null for the first run. */
|
|
18
|
+
delta: number | null;
|
|
19
|
+
}
|
|
20
|
+
export interface LoadScoreHistoryParams {
|
|
21
|
+
provider: IMetadataProvider;
|
|
22
|
+
user?: UserInfo;
|
|
23
|
+
entityId?: string | null;
|
|
24
|
+
recordId: string;
|
|
25
|
+
modelId?: string | null;
|
|
26
|
+
maxRuns?: number;
|
|
27
|
+
outcomeConfig?: OutcomeConfig | null;
|
|
28
|
+
problemType?: string | null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Service for retrieving and formatting the complete historical trendline of model prediction
|
|
32
|
+
* results for a specific entity record from `MJ: Process Run Details`.
|
|
33
|
+
*/
|
|
34
|
+
export declare class PredictiveStudioScoreHistoryService {
|
|
35
|
+
/**
|
|
36
|
+
* Load the history of predictions for a specific record across all runs (ordered oldest to newest).
|
|
37
|
+
*/
|
|
38
|
+
LoadRecordScoreHistory(params: LoadScoreHistoryParams): Promise<ModelScoreHistoryPoint[]>;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PredictiveStudioScoreHistoryService, never>;
|
|
40
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PredictiveStudioScoreHistoryService>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=predictive-studio-score-history.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predictive-studio-score-history.service.d.ts","sourceRoot":"","sources":["../../src/PredictiveStudio/predictive-studio-score-history.service.ts"],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@@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { RunView } from '@memberjunction/core';
|
|
3
|
+
import { UUIDsEqual } from '@memberjunction/global';
|
|
4
|
+
import { parseRowDrivers } from './at-risk.view-models';
|
|
5
|
+
import { formatPredictionScore, resolveScoreBand, } from '@memberjunction/predictive-studio-core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
function bandForScore(score) {
|
|
8
|
+
return score >= 0.7 ? 'high' : score >= 0.4 ? 'medium' : 'low';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Service for retrieving and formatting the complete historical trendline of model prediction
|
|
12
|
+
* results for a specific entity record from `MJ: Process Run Details`.
|
|
13
|
+
*/
|
|
14
|
+
export class PredictiveStudioScoreHistoryService {
|
|
15
|
+
/**
|
|
16
|
+
* Load the history of predictions for a specific record across all runs (ordered oldest to newest).
|
|
17
|
+
*/
|
|
18
|
+
async LoadRecordScoreHistory(params) {
|
|
19
|
+
const { provider, user, entityId, recordId, modelId, maxRuns = 50, outcomeConfig, problemType } = params;
|
|
20
|
+
if (!recordId)
|
|
21
|
+
return [];
|
|
22
|
+
let extraFilter = `RecordID = '${recordId.replace(/'/g, "''")}'`;
|
|
23
|
+
if (entityId) {
|
|
24
|
+
extraFilter += ` AND EntityID = '${entityId.replace(/'/g, "''")}'`;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
const rv = RunView.FromMetadataProvider(provider);
|
|
28
|
+
const res = await rv.RunView({
|
|
29
|
+
EntityName: 'MJ: Process Run Details',
|
|
30
|
+
ExtraFilter: extraFilter,
|
|
31
|
+
OrderBy: '__mj_CreatedAt ASC',
|
|
32
|
+
MaxRows: maxRuns,
|
|
33
|
+
ResultType: 'entity_object',
|
|
34
|
+
}, user);
|
|
35
|
+
if (!res.Success || !res.Results)
|
|
36
|
+
return [];
|
|
37
|
+
const points = [];
|
|
38
|
+
let previousScore = null;
|
|
39
|
+
for (const d of res.Results) {
|
|
40
|
+
if (!d.ResultPayload)
|
|
41
|
+
continue;
|
|
42
|
+
let parsed;
|
|
43
|
+
try {
|
|
44
|
+
parsed = JSON.parse(d.ResultPayload);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const p = parsed.output ?? parsed;
|
|
50
|
+
if (typeof p.score !== 'number' || !Number.isFinite(p.score))
|
|
51
|
+
continue;
|
|
52
|
+
const effectiveModelId = p.modelId ?? parsed.modelId;
|
|
53
|
+
if (modelId && effectiveModelId && !UUIDsEqual(effectiveModelId, modelId)) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const score = p.score;
|
|
57
|
+
const delta = previousScore !== null ? score - previousScore : null;
|
|
58
|
+
previousScore = score;
|
|
59
|
+
const runDate = d.CompletedAt ?? d.__mj_CreatedAt ?? new Date();
|
|
60
|
+
const resolvedBand = outcomeConfig ? resolveScoreBand(score, outcomeConfig) : null;
|
|
61
|
+
points.push({
|
|
62
|
+
runId: d.ProcessRunID,
|
|
63
|
+
runDate: runDate instanceof Date ? runDate : new Date(runDate),
|
|
64
|
+
score,
|
|
65
|
+
scoreFormatted: formatPredictionScore(score, outcomeConfig, problemType),
|
|
66
|
+
riskPct: Math.round(score * 100),
|
|
67
|
+
class: p.class ?? null,
|
|
68
|
+
band: resolvedBand?.Key ?? bandForScore(score),
|
|
69
|
+
status: resolvedBand?.Label ?? d.Status ?? 'Completed',
|
|
70
|
+
durationMs: d.DurationMs ?? null,
|
|
71
|
+
drivers: parseRowDrivers(p.drivers) ?? [],
|
|
72
|
+
delta,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return points;
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
static ɵfac = function PredictiveStudioScoreHistoryService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PredictiveStudioScoreHistoryService)(); };
|
|
82
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: PredictiveStudioScoreHistoryService, factory: PredictiveStudioScoreHistoryService.ɵfac, providedIn: 'root' });
|
|
83
|
+
}
|
|
84
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PredictiveStudioScoreHistoryService, [{
|
|
85
|
+
type: Injectable,
|
|
86
|
+
args: [{
|
|
87
|
+
providedIn: 'root',
|
|
88
|
+
}]
|
|
89
|
+
}], null, null); })();
|
|
90
|
+
//# sourceMappingURL=predictive-studio-score-history.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predictive-studio-score-history.service.js","sourceRoot":"","sources":["../../src/PredictiveStudio/predictive-studio-score-history.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAoC,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAkB,MAAM,uBAAuB,CAAC;AACxE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GAEjB,MAAM,wCAAwC,CAAC;;AA6BhD,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;AACjE,CAAC;AAED;;;GAGG;AAIH,MAAM,OAAO,mCAAmC;IAC9C;;OAEG;IACI,KAAK,CAAC,sBAAsB,CAAC,MAA8B;QAChE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QACzG,IAAI,CAAC,QAAQ;YAAE,OAAO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ED,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;6HApFU,mCAAmC;gEAAnC,mCAAmC,WAAnC,mCAAmC,mBAFlC,MAAM;;iFAEP,mCAAmC;cAH/C,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { RunView, UserInfo, type IMetadataProvider } from '@memberjunction/core';\nimport { MJProcessRunDetailEntity } from '@memberjunction/core-entities';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { parseRowDrivers, type RowDriver } from './at-risk.view-models';\nimport {\n formatPredictionScore,\n resolveScoreBand,\n type OutcomeConfig,\n} from '@memberjunction/predictive-studio-core';\n\n/** One historical score point for an entity record produced by a model run. */\nexport interface ModelScoreHistoryPoint {\n runId: string;\n runDate: Date;\n score: number;\n scoreFormatted: string;\n riskPct: number;\n class: string | null;\n band: 'high' | 'medium' | 'low' | string;\n status: string;\n durationMs: number | null;\n drivers: RowDriver[];\n /** Score delta compared to previous run (e.g. +0.05 or -0.12), or null for the first run. */\n delta: number | null;\n}\n\nexport interface LoadScoreHistoryParams {\n provider: IMetadataProvider;\n user?: UserInfo;\n entityId?: string | null;\n recordId: string;\n modelId?: string | null;\n maxRuns?: number;\n outcomeConfig?: OutcomeConfig | null;\n problemType?: string | null;\n}\n\nfunction bandForScore(score: number): 'high' | 'medium' | 'low' {\n return score >= 0.7 ? 'high' : score >= 0.4 ? 'medium' : 'low';\n}\n\n/**\n * Service for retrieving and formatting the complete historical trendline of model prediction\n * results for a specific entity record from `MJ: Process Run Details`.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class PredictiveStudioScoreHistoryService {\n /**\n * Load the history of predictions for a specific record across all runs (ordered oldest to newest).\n */\n public async LoadRecordScoreHistory(params: LoadScoreHistoryParams): Promise<ModelScoreHistoryPoint[]> {\n const { provider, user, entityId, recordId, modelId, maxRuns = 50, outcomeConfig, problemType } = params;\n if (!recordId) return [];\n\n let extraFilter = `RecordID = '${recordId.replace(/'/g, \"''\")}'`;\n if (entityId) {\n extraFilter += ` AND EntityID = '${entityId.replace(/'/g, \"''\")}'`;\n }\n\n try {\n const rv = RunView.FromMetadataProvider(provider);\n const res = await rv.RunView<MJProcessRunDetailEntity>(\n {\n EntityName: 'MJ: Process Run Details',\n ExtraFilter: extraFilter,\n OrderBy: '__mj_CreatedAt ASC',\n MaxRows: maxRuns,\n ResultType: 'entity_object',\n },\n user,\n );\n\n if (!res.Success || !res.Results) return [];\n\n const points: ModelScoreHistoryPoint[] = [];\n let previousScore: number | null = null;\n\n for (const d of res.Results) {\n if (!d.ResultPayload) continue;\n\n let parsed: {\n modelId?: string;\n score?: number;\n class?: string;\n drivers?: unknown;\n scoredAt?: string;\n output?: { modelId?: string; score?: number; class?: string; drivers?: unknown; scoredAt?: string };\n };\n\n try {\n parsed = JSON.parse(d.ResultPayload);\n } catch {\n continue;\n }\n\n const p = parsed.output ?? parsed;\n if (typeof p.score !== 'number' || !Number.isFinite(p.score)) continue;\n\n const effectiveModelId = p.modelId ?? parsed.modelId;\n if (modelId && effectiveModelId && !UUIDsEqual(effectiveModelId, modelId)) {\n continue;\n }\n\n const score = p.score;\n const delta = previousScore !== null ? score - previousScore : null;\n previousScore = score;\n\n const runDate = d.CompletedAt ?? d.__mj_CreatedAt ?? new Date();\n\n const resolvedBand = outcomeConfig ? resolveScoreBand(score, outcomeConfig) : null;\n\n points.push({\n runId: d.ProcessRunID,\n runDate: runDate instanceof Date ? runDate : new Date(runDate),\n score,\n scoreFormatted: formatPredictionScore(score, outcomeConfig, problemType),\n riskPct: Math.round(score * 100),\n class: p.class ?? null,\n band: resolvedBand?.Key ?? bandForScore(score),\n status: resolvedBand?.Label ?? d.Status ?? 'Completed',\n durationMs: d.DurationMs ?? null,\n drivers: parseRowDrivers(p.drivers) ?? [],\n delta,\n });\n }\n\n return points;\n } catch {\n return [];\n }\n }\n}\n"]}
|
|
@@ -77,12 +77,22 @@ export declare function parseMetrics(json: string | null | undefined): PSMetricM
|
|
|
77
77
|
export declare function canonicalMetricKey(rawKey: string): PSMetricKey | null;
|
|
78
78
|
/** The primary AUC/score of a model: holdout AUC preferred, else training AUC, else null. */
|
|
79
79
|
export declare function primaryAuc(model: Pick<PSModelRow, 'Metrics' | 'HoldoutMetrics'>): number | null;
|
|
80
|
+
/** The primary metric score of a model: holdout preferred, else training. Inspects ProblemType and selects R² for regression, AUC for classification. */
|
|
81
|
+
export declare function primaryModelScore(model: Pick<PSModelRow, 'Metrics' | 'HoldoutMetrics'> & {
|
|
82
|
+
ProblemType?: string | null;
|
|
83
|
+
}): {
|
|
84
|
+
key: PSMetricKey;
|
|
85
|
+
label: string;
|
|
86
|
+
value: number;
|
|
87
|
+
} | null;
|
|
80
88
|
/** A labeled metric ready for display (value formatted to a sensible precision). */
|
|
81
89
|
export interface PSMetricDisplay {
|
|
82
90
|
key: PSMetricKey;
|
|
83
91
|
label: string;
|
|
84
92
|
value: string;
|
|
85
93
|
}
|
|
94
|
+
/** Human labels for the canonical metric keys. */
|
|
95
|
+
export declare const METRIC_LABELS: Record<PSMetricKey, string>;
|
|
86
96
|
/**
|
|
87
97
|
* Turn a metric map into an ordered, formatted display list (canonical order, only present keys).
|
|
88
98
|
* AUC is excluded by default since the panels surface it as a hero number separately.
|
|
@@ -96,10 +106,12 @@ export declare function metricsToDisplay(metrics: PSMetricMap, options?: {
|
|
|
96
106
|
/** Format a metric value: 3 decimals for ratio metrics, 2 for the rest. */
|
|
97
107
|
export declare function formatMetricValue(key: PSMetricKey, value: number): string;
|
|
98
108
|
/**
|
|
99
|
-
* The train-vs-holdout overfit gap (train
|
|
109
|
+
* The train-vs-holdout overfit gap (train metric − holdout metric), or null when either is missing.
|
|
100
110
|
* Positive means the model does better in-sample than out-of-sample (the expected direction).
|
|
101
111
|
*/
|
|
102
|
-
export declare function overfitGap(model: Pick<PSModelRow, 'Metrics' | 'HoldoutMetrics'>
|
|
112
|
+
export declare function overfitGap(model: Pick<PSModelRow, 'Metrics' | 'HoldoutMetrics'> & {
|
|
113
|
+
ProblemType?: string | null;
|
|
114
|
+
}, preferredKey?: PSMetricKey): number | null;
|
|
103
115
|
/** The dominance threshold above which a single feature's share triggers the leakage guard. */
|
|
104
116
|
export declare const PS_FEATURE_DOMINANCE_THRESHOLD = 0.6;
|
|
105
117
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predictive-studio.view-models.d.ts","sourceRoot":"","sources":["../../src/PredictiveStudio/predictive-studio.view-models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAO9F,6EAA6E;AAC7E,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,kGAAkG;AAClG,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAA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MAAM,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"predictive-studio.view-models.d.ts","sourceRoot":"","sources":["../../src/PredictiveStudio/predictive-studio.view-models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAO9F,6EAA6E;AAC7E,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,kGAAkG;AAClG,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,C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E,OAAO,SAAI,GAAG,eAAe,EAAE,CAkBjG;AAED,sFAAsF;AACtF,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,kBAAkB,EAAE,CAkBvF;AAoBD,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAShE"}
|
|
@@ -99,8 +99,33 @@ export function primaryAuc(model) {
|
|
|
99
99
|
const train = parseMetrics(model.Metrics);
|
|
100
100
|
return train.AUC ?? null;
|
|
101
101
|
}
|
|
102
|
+
/** The primary metric score of a model: holdout preferred, else training. Inspects ProblemType and selects R² for regression, AUC for classification. */
|
|
103
|
+
export function primaryModelScore(model) {
|
|
104
|
+
const isReg = (model.ProblemType ?? '').toLowerCase() === 'regression';
|
|
105
|
+
const holdout = parseMetrics(model.HoldoutMetrics);
|
|
106
|
+
const train = parseMetrics(model.Metrics);
|
|
107
|
+
if (isReg) {
|
|
108
|
+
for (const k of ['R2', 'RMSE', 'MAE']) {
|
|
109
|
+
if (holdout[k] != null)
|
|
110
|
+
return { key: k, label: METRIC_LABELS[k], value: holdout[k] };
|
|
111
|
+
}
|
|
112
|
+
for (const k of ['R2', 'RMSE', 'MAE']) {
|
|
113
|
+
if (train[k] != null)
|
|
114
|
+
return { key: k, label: METRIC_LABELS[k], value: train[k] };
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
for (const k of ['AUC', 'Accuracy', 'F1', 'R2', 'RMSE']) {
|
|
118
|
+
if (holdout[k] != null)
|
|
119
|
+
return { key: k, label: METRIC_LABELS[k], value: holdout[k] };
|
|
120
|
+
}
|
|
121
|
+
for (const k of ['AUC', 'Accuracy', 'F1', 'R2', 'RMSE']) {
|
|
122
|
+
if (train[k] != null)
|
|
123
|
+
return { key: k, label: METRIC_LABELS[k], value: train[k] };
|
|
124
|
+
}
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
102
127
|
/** Human labels for the canonical metric keys. */
|
|
103
|
-
const METRIC_LABELS = {
|
|
128
|
+
export const METRIC_LABELS = {
|
|
104
129
|
AUC: 'AUC',
|
|
105
130
|
Accuracy: 'Accuracy',
|
|
106
131
|
Precision: 'Precision',
|
|
@@ -138,12 +163,23 @@ export function formatMetricValue(key, value) {
|
|
|
138
163
|
return value.toFixed(threeDecimals.includes(key) ? 3 : 2);
|
|
139
164
|
}
|
|
140
165
|
/**
|
|
141
|
-
* The train-vs-holdout overfit gap (train
|
|
166
|
+
* The train-vs-holdout overfit gap (train metric − holdout metric), or null when either is missing.
|
|
142
167
|
* Positive means the model does better in-sample than out-of-sample (the expected direction).
|
|
143
168
|
*/
|
|
144
|
-
export function overfitGap(model) {
|
|
145
|
-
const
|
|
146
|
-
const
|
|
169
|
+
export function overfitGap(model, preferredKey) {
|
|
170
|
+
const trainMetrics = parseMetrics(model.Metrics);
|
|
171
|
+
const holdoutMetrics = parseMetrics(model.HoldoutMetrics);
|
|
172
|
+
const key = preferredKey ??
|
|
173
|
+
((model.ProblemType ?? '').toLowerCase() === 'regression'
|
|
174
|
+
? (trainMetrics.R2 != null && holdoutMetrics.R2 != null ? 'R2' : null)
|
|
175
|
+
: null) ??
|
|
176
|
+
(trainMetrics.AUC != null && holdoutMetrics.AUC != null ? 'AUC' : null) ??
|
|
177
|
+
(trainMetrics.Accuracy != null && holdoutMetrics.Accuracy != null ? 'Accuracy' : null) ??
|
|
178
|
+
(trainMetrics.R2 != null && holdoutMetrics.R2 != null ? 'R2' : null);
|
|
179
|
+
if (!key)
|
|
180
|
+
return null;
|
|
181
|
+
const train = trainMetrics[key];
|
|
182
|
+
const holdout = holdoutMetrics[key];
|
|
147
183
|
if (train == null || holdout == null)
|
|
148
184
|
return null;
|
|
149
185
|
return train - holdout;
|