170 lines
6.4 KiB
HTML
170 lines
6.4 KiB
HTML
<h2 mat-dialog-title class="title">
|
|
{{ title }}
|
|
@if (lineage(); as l) {
|
|
<app-model-status [status]="l.model_version.status"></app-model-status>
|
|
}
|
|
</h2>
|
|
|
|
<mat-dialog-content class="content">
|
|
@if (busy()) {
|
|
<mat-progress-bar mode="indeterminate" aria-label="Cargando"></mat-progress-bar>
|
|
}
|
|
@if (error(); as message) {
|
|
<p class="alert" role="alert"><mat-icon aria-hidden="true">error</mat-icon>{{ message }}</p>
|
|
}
|
|
|
|
@if (lineage(); as l) {
|
|
@let v = l.model_version;
|
|
<section class="summary">
|
|
<dl>
|
|
<dt>Dominio · escenario</dt>
|
|
<dd>{{ v.tags.domain }} · {{ v.tags.scenario }}</dd>
|
|
<dt>Entorno</dt>
|
|
<dd>{{ v.tags.environment }}</dd>
|
|
<dt>Creada</dt>
|
|
<dd>{{ v.created_at | date: 'medium' }}</dd>
|
|
@if (v.tags.promovida_en) {
|
|
<dt>Promovida</dt>
|
|
<dd>{{ v.tags.promovida_en | date: 'medium' }}</dd>
|
|
}
|
|
<dt>Predicciones registradas</dt>
|
|
<dd>{{ l.predictions | number }}</dd>
|
|
</dl>
|
|
@if (metrics(v).length) {
|
|
<dl class="metrics">
|
|
@for (metric of metrics(v); track metric[0]) {
|
|
<dt>{{ metric[0] }}</dt>
|
|
<dd>{{ metric[1] }}</dd>
|
|
}
|
|
</dl>
|
|
}
|
|
</section>
|
|
|
|
<section aria-labelledby="checks-title">
|
|
<h3 id="checks-title">Requisitos para producción</h3>
|
|
<ul class="checks">
|
|
@for (check of l.checks; track $index) {
|
|
<li [class.checks__fail]="!check.passed">
|
|
<mat-icon aria-hidden="true">{{ check.passed ? 'check_circle' : 'cancel' }}</mat-icon>
|
|
<span class="checks__code">{{ check.code }}</span>
|
|
<span>{{ check.requirement }}</span>
|
|
@if (check.detail) {
|
|
<span class="checks__detail">{{ check.detail }}</span>
|
|
}
|
|
</li>
|
|
}
|
|
</ul>
|
|
</section>
|
|
|
|
<section aria-labelledby="cohort-title">
|
|
<h3 id="cohort-title">Cohorte de entrenamiento</h3>
|
|
@if (l.cohorte_armado; as armado) {
|
|
<p>
|
|
{{ armado.url }} · versión {{ armado.version }} · {{ armado.n_miembros | number }} miembros ·
|
|
datos al {{ armado.datos_as_of | date: 'mediumDate' }}
|
|
</p>
|
|
<p class="hash" [matTooltip]="armado.huella">huella {{ armado.huella.slice(0, 12) }}… · armado {{ armado.armado_id }}</p>
|
|
@if (l.cohorte_exclusiones.length) {
|
|
<table class="exclusions">
|
|
<thead>
|
|
<tr><th>#</th><th>Paso</th><th>Quedan</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
@for (paso of l.cohorte_exclusiones; track paso.orden) {
|
|
<tr><td>{{ paso.orden }}</td><td>{{ paso.paso }}</td><td>{{ paso.n | number }}</td></tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
} @else {
|
|
<p class="muted">Sin cohorte enlazada.</p>
|
|
}
|
|
</section>
|
|
|
|
<section aria-labelledby="routines-title">
|
|
<h3 id="routines-title">Rutinas del entrenamiento</h3>
|
|
<p class="muted">Lo que cada rutina hizo, registrado por la corrida mientras entrenaba (ML-01a).</p>
|
|
<ul class="artifacts">
|
|
@for (routine of routineKinds; track routine.kind) {
|
|
@let record = l.routines[routine.kind];
|
|
<li [class.checks__fail]="!record">
|
|
<mat-icon aria-hidden="true">{{ record ? 'check_circle' : 'cancel' }}</mat-icon>
|
|
<span class="artifacts__kind">{{ routine.label }}</span>
|
|
@if (record) {
|
|
<details class="routine">
|
|
<summary>{{ record['method'] ?? 'Ver registro' }}</summary>
|
|
<pre>{{ record | json }}</pre>
|
|
</details>
|
|
} @else {
|
|
<span class="muted">La corrida no la registró.</span>
|
|
}
|
|
</li>
|
|
}
|
|
</ul>
|
|
</section>
|
|
|
|
<section aria-labelledby="artifacts-title">
|
|
<h3 id="artifacts-title">Archivos de la corrida</h3>
|
|
<ul class="artifacts">
|
|
@for (file of files(l.artifacts); track file.path) {
|
|
<li>
|
|
<mat-icon aria-hidden="true">description</mat-icon>
|
|
<a class="artifacts__name" [href]="artifactUrl(file.path)" download>{{ file.label }}</a>
|
|
@if (file.size !== null) {
|
|
<span class="muted">{{ file.size | number }} B</span>
|
|
}
|
|
</li>
|
|
} @empty {
|
|
<li class="muted">Sin archivos.</li>
|
|
}
|
|
</ul>
|
|
<div class="upload">
|
|
<button mat-stroked-button type="button" (click)="tryInNotebook()">
|
|
<mat-icon aria-hidden="true">science</mat-icon>Probar en un notebook
|
|
</button>
|
|
<span class="muted">Corre un notebook propio sobre una cohorte, con esta versión cargada.</span>
|
|
</div>
|
|
</section>
|
|
|
|
<section aria-labelledby="reports-title">
|
|
<h3 id="reports-title">Reportes de validación</h3>
|
|
<form [formGroup]="reports" class="reports" (ngSubmit)="saveReports()">
|
|
<mat-form-field appearance="outline">
|
|
<mat-label>Pruebas técnicas (MLD-01)</mat-label>
|
|
<input matInput formControlName="technical_validation_report_uri" placeholder="Ruta o URL del reporte" />
|
|
</mat-form-field>
|
|
<mat-form-field appearance="outline">
|
|
<mat-label>Validación clínica (MLD-01b)</mat-label>
|
|
<input matInput formControlName="clinical_validation_report_uri" placeholder="Ruta o URL del reporte" />
|
|
</mat-form-field>
|
|
<mat-form-field appearance="outline">
|
|
<mat-label>Interpretabilidad (MLD-03)</mat-label>
|
|
<input matInput formControlName="interpretability_report_uri" placeholder="Ruta o URL del reporte" />
|
|
</mat-form-field>
|
|
<button mat-stroked-button type="submit" [disabled]="busy() || reports.pristine">Guardar reportes</button>
|
|
</form>
|
|
</section>
|
|
}
|
|
</mat-dialog-content>
|
|
|
|
<mat-dialog-actions align="end">
|
|
<button mat-button type="button" (click)="close()">Cerrar</button>
|
|
@if (lineage(); as l) {
|
|
@if (l.model_version.status === 'produccion') {
|
|
<button mat-stroked-button type="button" [disabled]="busy()" (click)="retire()">
|
|
<mat-icon aria-hidden="true">pause_circle</mat-icon>Retirar de producción
|
|
</button>
|
|
} @else {
|
|
<button
|
|
mat-flat-button
|
|
type="button"
|
|
[disabled]="busy() || !ready(l.checks)"
|
|
[matTooltip]="ready(l.checks) ? '' : 'Faltan requisitos para producción'"
|
|
(click)="promote()"
|
|
>
|
|
<mat-icon aria-hidden="true">rocket_launch</mat-icon>Promover a producción
|
|
</button>
|
|
}
|
|
}
|
|
</mat-dialog-actions>
|