aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_pages/add-model/add-model.component.html
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/app/_pages/add-model/add-model.component.html')
-rw-r--r--frontend/src/app/_pages/add-model/add-model.component.html130
1 files changed, 69 insertions, 61 deletions
diff --git a/frontend/src/app/_pages/add-model/add-model.component.html b/frontend/src/app/_pages/add-model/add-model.component.html
index 33066f80..afd4ceb4 100644
--- a/frontend/src/app/_pages/add-model/add-model.component.html
+++ b/frontend/src/app/_pages/add-model/add-model.component.html
@@ -3,9 +3,7 @@
</div>
<div id="wrapper">
-
<div id="container" class="container p-5" style="background-color: white; min-height: 100%;">
-
<div class="form-group row mt-3 mb-2 d-flex justify-content-center">
<!--justify-content-center-->
<h2 class="col-2"> Nov model: </h2>
@@ -38,42 +36,39 @@
</button>
<h3 class="mt-3 mx-3">ili</h3>
<button type="button" id="btnNewDataset" class="btn" (click)="viewNewDatasetForm()"
- [ngClass]="{'btnType1': !showMyDatasets, 'btnType2': showMyDatasets}">
+ [ngClass]="{'btnType1': !showMyDatasets, 'btnType2': showMyDatasets}">
Dodajte novi dataset
</button>
</div>
- <!-- POSTOJECI ILI NOVI DATASET -->
-
- <!-- POSTOJECI -->
- <div class="px-5">
- <div *ngIf="showMyDatasets" class="overflow-auto" style="max-height: 500px;">
- <ul class="list-group">
- <li class="list-group-item p-3" *ngFor="let dataset of myDatasets" [ngClass]="{'selectedDatasetClass': this.selectedDataset == dataset}">
- <app-item-dataset name="usersDataset" [dataset]="dataset" (click)="selectThisDataset(dataset)"></app-item-dataset>
- </li>
- </ul>
- </div>
+ <div class="px-5">
+ <div *ngIf="showMyDatasets" class="overflow-auto" style="max-height: 500px;">
+ <ul class="list-group">
+ <li class="list-group-item p-3" *ngFor="let dataset of myDatasets"
+ [ngClass]="{'selectedDatasetClass': this.selectedDataset == dataset}">
+ <app-item-dataset name="usersDataset" [dataset]="dataset"
+ (click)="selectThisDataset(dataset)"></app-item-dataset>
+ </li>
+ </ul>
</div>
-
- <!-- NOVI -->
- <app-dataset-load *ngIf="!showMyDatasets" id="dataset" (loaded)="datasetLoaded = true"></app-dataset-load>
- </div>
+ </div>
+ <app-dataset-load *ngIf="!showMyDatasets" id="dataset"
+ (loaded)="datasetLoaded = true; selectedDataset = datasetLoadComponent?.dataset; datasetFile = datasetLoadComponent?.csvRecords; datasetHasHeader = datasetLoadComponent?.hasHeader">
+ </app-dataset-load>
+ <app-datatable [data]="datasetFile" [hasHeader]="datasetHasHeader"></app-datatable>
+ </div>
- <!-- ULAZNE/IZLAZNE KOLONE - POSTOJECI DATASET -->
- <div *ngIf="showMyDatasets && this.selectedDataset" class="mt-4">
- <h2 class="text-center">
- Izabrali ste dataset: <span style="color: #003459; font-weight: bold">{{this.selectedDataset.name}}</span>
- </h2>
- <div class="row mt-5">
+ <!-- ULAZNE/IZLAZNE KOLONE -->
+ <div *ngIf="selectedDataset">
+ <div class="row">
<div class="col d-flex justify-content-center">
<h3>Izaberite ulazne kolone:</h3>
<div id="divInputs" class="form-check mt-2">
<br>
- <div *ngFor="let item of this.selectedDataset.header; let i = index">
- <input class="form-check-input" type="checkbox" value="{{item}}"
- id="cb_{{item}}" name="cbsExisting" checked [disabled]="this.selectedOutputColumnVal == item">&nbsp;
+ <div *ngFor="let item of selectedDataset.header; let i = index">
+ <input class="form-check-input" type="checkbox" value="{{item}}" id="cb_{{item}}"
+ name="cbsNew" checked [disabled]="this.selectedOutputColumnVal == item">&nbsp;
<label class="form-check-label" for="cb_{{item}}">
{{item}}
</label>
@@ -84,45 +79,57 @@
<h3>Izaberite izlaznu kolonu:</h3>
<div id="divOutputs" class="form-check mt-2">
<br>
- <div *ngFor="let item of this.selectedDataset.header; let i = index">
- <input class="form-check-input" type="radio" value="{{item}}"
- id="rb_{{item}}" name="rbsExisting" (change)="this.selectedOutputColumnVal = item">&nbsp;
+ <div *ngFor="let item of selectedDataset.header; let i = index">
+ <input class="form-check-input" type="radio" value="{{item}}" id="rb_{{item}}" name="rbsNew"
+ (change)="this.selectedOutputColumnVal = item">&nbsp;
<label class="form-check-label" for="rb_{{item}}">
{{item}}
</label>
</div>
</div>
</div>
- </div>
- </div>
- <!-- ULAZNE/IZLAZNE KOLONE - NOVI DATASET-->
- <div *ngIf="!showMyDatasets && datasetLoaded">
- <div *ngIf="datasetLoadComponent && datasetLoadComponent.files[0]" class="row">
- <div class="col d-flex justify-content-center">
- <h3>Izaberite ulazne kolone:</h3>
- <div id="divInputs" class="form-check mt-2">
- <br>
- <div *ngFor="let item of datasetLoadComponent.dataset.header; let i = index">
- <input class="form-check-input" type="checkbox" value="{{item}}"
- id="cb_{{item}}" name="cbsNew" checked [disabled]="this.selectedOutputColumnVal == item">&nbsp;
- <label class="form-check-label" for="cb_{{item}}">
- {{item}}
- </label>
- </div>
- </div>
- </div>
- <div class="col d-flex justify-content-left">
- <h3>Izaberite izlaznu kolonu:</h3>
- <div id="divOutputs" class="form-check mt-2">
- <br>
- <div *ngFor="let item of datasetLoadComponent.dataset.header; let i = index">
- <input class="form-check-input" type="radio" value="{{item}}"
- id="rb_{{item}}" name="rbsNew" (change)="this.selectedOutputColumnVal = item">&nbsp;
- <label class="form-check-label" for="rb_{{item}}">
- {{item}}
- </label>
+ <div class="my-2" *ngIf="datasetFile">
+ <h2>Popunjavanje nedostajućih vrednosti:</h2>
+ <div class="form-check">
+ <input type="radio" [(ngModel)]="newModel.nullValues" [value]="NullValueOptions.DeleteRows"
+ class="form-check-input" value="deleteRows" name="fillMissing" id="delRows" checked
+ data-bs-toggle="collapse" data-bs-target="#fillMissingCustom.show">
+ <label for="delRows" class="form-check-label">Obriši
+ redove sa nedostajućim vrednostima</label><br>
+ <input type="radio" [(ngModel)]="newModel.nullValues" [value]="NullValueOptions.DeleteColumns"
+ class="form-check-input" value="deleteCols" name="fillMissing" id="delCols"
+ data-bs-toggle="collapse" data-bs-target="#fillMissingCustom.show">
+ <label for="delCols" class="form-check-label">Obriši
+ kolone sa nedostajućim vrednostima</label><br>
+ <input type="radio" [(ngModel)]="newModel.nullValues" [value]="NullValueOptions.Replace"
+ class="form-check-input" name="fillMissing" id="replace" data-bs-toggle="collapse"
+ data-bs-target="#fillMissingCustom:not(.show)">
+ <label for="replace" class="form-check-label">Izabraću
+ vrednosti koje će da zamene nedostajuće vrednosti za svaku kolonu...</label><br><br>
+ <div class="collapse" id="fillMissingCustom">
+ <div>
+ <label for="columnReplacers" class="form-label">Unesite zamenu za svaku kolonu:</label>
+ <div id="columnReplacers">
+ <div *ngFor="let column of selectedDataset.header; let i = index" class="my-3">
+ <div class="input-group row" *ngIf="getInputById('cb_'+column).checked">
+ <span class="input-group-text col-4 text-center">
+ {{column}}
+ </span>
+ <input type="text" class="form-control col-4">
+ <select [id]="'replaceOptions'+i" class="form-control col-4"
+ *ngIf="isNumber(datasetFile[1][i])">
+ <option
+ *ngFor="let option of Object.keys(ReplaceWith); let optionName of Object.values(ReplaceWith)"
+ [value]="option">
+ {{ optionName }}
+ </option>
+ </select>
+ </div>
+ </div>
+ </div>
+ </div>
</div>
</div>
</div>
@@ -257,7 +264,8 @@
</div>
<div class="col-5">
<label for="splitYesNo" class="form-check-label">Podela test skupa:&nbsp;&nbsp;
- <input id="splitYesNo" class="form-check-input" type="checkbox" [checked]="newModel.randomTestSet"
+ <input id="splitYesNo" class="form-check-input" type="checkbox"
+ [checked]="newModel.randomTestSet"
(change)="newModel.randomTestSet = !newModel.randomTestSet">
</label>
</div>
@@ -288,8 +296,8 @@
<label for="percentage" class="form-label">Procenat podataka koji se uzima za trening skup:</label>
</div>
<div class="col-1">
- <input id="percentage" type="number" class="form-control" min="10" max="90" step="10" value="90" [(ngModel)]="tempTestSetDistribution"
- [disabled] = "!newModel.randomTestSet">
+ <input id="percentage" type="number" class="form-control" min="10" max="90" step="10" value="90"
+ [(ngModel)]="tempTestSetDistribution" [disabled]="!newModel.randomTestSet">
</div>
</div>