diff options
-rw-r--r-- | backend/api/api/Models/Dataset.cs | 1 | ||||
-rw-r--r-- | backend/api/api/Models/Experiment.cs | 3 | ||||
-rw-r--r-- | backend/api/api/Models/Model.cs | 3 | ||||
-rw-r--r-- | backend/api/api/Services/FillAnEmptyDb.cs | 70 | ||||
-rw-r--r-- | frontend/src/app/_data/Dataset.ts | 6 | ||||
-rw-r--r-- | frontend/src/app/_data/Experiment.ts | 5 | ||||
-rw-r--r-- | frontend/src/app/_data/Model.ts | 7 | ||||
-rw-r--r-- | frontend/src/app/_elements/column-table/column-table.component.css | 24 | ||||
-rw-r--r-- | frontend/src/app/_elements/column-table/column-table.component.html | 41 | ||||
-rw-r--r-- | frontend/src/app/_elements/column-table/column-table.component.ts | 22 | ||||
-rw-r--r-- | frontend/src/app/_elements/form-model/form-model.component.css | 10 | ||||
-rw-r--r-- | frontend/src/app/_elements/form-model/form-model.component.html | 19 | ||||
-rw-r--r-- | frontend/src/app/_elements/form-model/form-model.component.ts | 7 |
13 files changed, 156 insertions, 62 deletions
diff --git a/backend/api/api/Models/Dataset.cs b/backend/api/api/Models/Dataset.cs index 6bcb0c16..7acd4382 100644 --- a/backend/api/api/Models/Dataset.cs +++ b/backend/api/api/Models/Dataset.cs @@ -22,7 +22,6 @@ namespace api.Models public DateTime dateCreated { get; set; } public DateTime lastUpdated { get; set; } public string delimiter { get; set; } - public ColumnInfo[] columnInfo { get; set; } public int rowCount { get; set; } public int nullCols { get; set; } diff --git a/backend/api/api/Models/Experiment.cs b/backend/api/api/Models/Experiment.cs index f7bec083..cfff337c 100644 --- a/backend/api/api/Models/Experiment.cs +++ b/backend/api/api/Models/Experiment.cs @@ -16,9 +16,6 @@ namespace api.Models public string uploaderId { get; set; } public string[] inputColumns { get; set; } public string outputColumn { get; set; } - public bool randomOrder { get; set; } - public bool randomTestSet { get; set; } - public float randomTestSetDistribution { get; set; } public string nullValues { get; set; } public NullValues[] nullValuesReplacers { get; set; } public ColumnEncoding[] encodings { get; set; } diff --git a/backend/api/api/Models/Model.cs b/backend/api/api/Models/Model.cs index a9dbfbdd..f89c8e56 100644 --- a/backend/api/api/Models/Model.cs +++ b/backend/api/api/Models/Model.cs @@ -38,5 +38,8 @@ namespace api.Models public int epochs { get; set; } //public bool isTrained { get; set; } //public NullValues[] nullValues { get; set; } + public bool randomOrder { get; set; } + public bool randomTestSet { get; set; } + public float randomTestSetDistribution { get; set; } } } diff --git a/backend/api/api/Services/FillAnEmptyDb.cs b/backend/api/api/Services/FillAnEmptyDb.cs index 7ae70a33..2020d40e 100644 --- a/backend/api/api/Services/FillAnEmptyDb.cs +++ b/backend/api/api/Services/FillAnEmptyDb.cs @@ -62,9 +62,14 @@ namespace api.Services dataset.dateCreated = DateTime.Now; dataset.lastUpdated = DateTime.Now; dataset.delimiter = ""; +<<<<<<< HEAD +======= + //dataset.hasHeader = true; +>>>>>>> f9b96fc9234802ba78a64be094ebc4b4525cde8e dataset.columnInfo = new ColumnInfo[] { }; - dataset.columnInfo = new[] + /*dataset.columnInfo = new[] { +<<<<<<< HEAD new ColumnInfo( "PassengerId", "columnType", true, 0, 446, 1, 891, 446, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), new ColumnInfo( "Survived", "columnType", true, 0, 0.38383838534355164f, 0, 1, 0, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), new ColumnInfo( "Pclass", "columnType", true, 0, 2.3086419105529785f, 1, 3, 3, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), @@ -78,6 +83,21 @@ namespace api.Services new ColumnInfo( "Cabin", "columnType", false, 687, 0, 0, 0, 0, new string[]{ "B96 B98", "G6", "C23 C25 C27", "C22 C26", "F33", "F2", "E101", "D", "C78", "C93" }, new int[] {}, new float[] {}, 0.01f,0.1f ), new ColumnInfo( "Embarked", "columnType", false, 2, 0.3815937042236328f, 0, 6, 0, new string[]{ "S", "C", "Q" }, new int[] {}, new float[] {}, 0.01f,0.1f ), }; +======= + new ColumnInfo( "PassengerId", true, 0, 446, 1, 891, 446, new string[]{ }), + new ColumnInfo( "Survived", true, 0, 0.38383838534355164f, 0, 1, 0, new string[]{ }), + new ColumnInfo( "Pclass", true, 0, 2.3086419105529785f, 1, 3, 3, new string[]{ }), + new ColumnInfo( "Name", false, 0, 0, 0, 0, 0, new string[]{"Braund, Mr. Owen Harris", "Boulos, Mr. Hanna", "Frolicher-Stehli, Mr. Maxmillian", "Gilinski, Mr. Eliezer", "Murdlin, Mr. Joseph", "Rintamaki, Mr. Matti", "Stephenson, Mrs. Walter Bertram (Martha Eustis)", "Elsbury, Mr. William James", "Bourke, Miss. Mary", "Chapman, Mr. John Henry"}), + new ColumnInfo( "Sex", false, 0, 0, 0, 0, 0, new string[]{ "male", "female" }), + new ColumnInfo( "Age", true, 177, 29.69911766052246f, 0.41999998688697815f, 80, 28, new string[]{ }), + new ColumnInfo( "SibSp", true, 0, 0.523007869720459f, 0, 8, 0, new string[]{ }), + new ColumnInfo( "Parch", true, 0, 0.3815937042236328f, 0, 6, 0, new string[]{ }), + new ColumnInfo( "Ticket", false, 0, 0, 0, 0, 0, new string[]{ "347082", "CA. 2343", "1601", "3101295", "CA 2144", "347088", "S.O.C. 14879", "382652", "LINE", "PC 17757" }), + new ColumnInfo( "Fare", true, 0, 32.20420837402344f, 0, 512.3292236328125f, 14.45419979095459f, new string[]{ }), + new ColumnInfo( "Cabin", false, 687, 0, 0, 0, 0, new string[]{ "B96 B98", "G6", "C23 C25 C27", "C22 C26", "F33", "F2", "E101", "D", "C78", "C93" }), + new ColumnInfo( "Embarked", false, 2, 0.3815937042236328f, 0, 6, 0, new string[]{ "S", "C", "Q" }), + };*/ +>>>>>>> f9b96fc9234802ba78a64be094ebc4b4525cde8e dataset.rowCount = 891; dataset.nullCols = 3; dataset.nullRows = 708; @@ -119,9 +139,9 @@ namespace api.Services experiment.uploaderId = "000000000000000000000000"; experiment.inputColumns = new string[] { "Embarked" }; experiment.outputColumn = "Survived"; - experiment.randomOrder = true; - experiment.randomTestSet = true; - experiment.randomTestSetDistribution = 0.30000001192092896f; + //experiment.randomOrder = true; + //experiment.randomTestSet = true; + //experiment.randomTestSetDistribution = 0.30000001192092896f; experiment.nullValues = "delete_rows"; experiment.nullValuesReplacers = new NullValues[] { }; experiment.encodings = new[] @@ -177,6 +197,7 @@ namespace api.Services dataset.dateCreated = DateTime.Now; dataset.lastUpdated = DateTime.Now; dataset.delimiter = ""; +<<<<<<< HEAD dataset.columnInfo = new[] { new ColumnInfo( "Unnamed: 0", "columnType", true, 0, 26969.5f, 0, 53939, 26969.5f, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), @@ -191,6 +212,23 @@ namespace api.Services new ColumnInfo( "y", "columnType", true, 0, 5.73452615737915f, 0, 58.900001525878906f, 5.710000038146973f, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), new ColumnInfo( "z", "columnType", true, 0, 3.538733720779419f, 0, 31.799999237060547f, 3.5299999713897705f, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ) }; +======= + //dataset.hasHeader = true; + /*dataset.columnInfo = new[] + { + new ColumnInfo( "Unnamed: 0", true, 0, 26969.5f, 0, 53939, 26969.5f, new string[]{ }), + new ColumnInfo( "carat", true, 0, 0.7979397773742676f, 0.20000000298023224f, 5.010000228881836f, 0.699999988079071f, new string[]{ }), + new ColumnInfo( "cut", false, 0, 0, 0, 0, 0, new string[]{ "Ideal", "Premium", "Very Good", "Good", "Fair" }), + new ColumnInfo( "color", false, 0, 0, 0, 0, 0, new string[]{"G", "E", "F", "H", "D", "I", "I", "J"}), + new ColumnInfo( "clarity", false, 0, 0, 0, 0, 0, new string[]{ "SI1", "VS2","SI2", "VS1", "VVS2", "VVS1", "IF", "I1" }), + new ColumnInfo( "depth", true, 0, 61.74940490722656f, 43, 79, 61.79999923706055f, new string[]{ }), + new ColumnInfo( "table", true, 0, 57.457183837890625f, 43, 95, 57, new string[]{ }), + new ColumnInfo( "price", true, 0, 3932.7998046875f, 326, 18823, 2401, new string[]{ }), + new ColumnInfo( "x", true, 0, 5.731157302856445f, 0, 10.739999771118164f, 5.699999809265137f, new string[]{ }), + new ColumnInfo( "y", true, 0, 5.73452615737915f, 0, 58.900001525878906f, 5.710000038146973f, new string[]{ }), + new ColumnInfo( "z", true, 0, 3.538733720779419f, 0, 31.799999237060547f, 3.5299999713897705f, new string[]{ }) + };*/ +>>>>>>> f9b96fc9234802ba78a64be094ebc4b4525cde8e dataset.rowCount = 53940; dataset.nullCols = 0; dataset.nullRows = 0; @@ -233,9 +271,9 @@ namespace api.Services experiment.uploaderId = "000000000000000000000000"; experiment.inputColumns = new string[] { "Unnamed: 0", "carat", "cut", "color", "clarity", "depth", "table", "x", "y", "z" }; experiment.outputColumn = "price"; - experiment.randomOrder = true; - experiment.randomTestSet = true; - experiment.randomTestSetDistribution = 0.30000001192092896f; + //experiment.randomOrder = true; + //experiment.randomTestSet = true; + //experiment.randomTestSetDistribution = 0.30000001192092896f; experiment.nullValues = "delete_rows"; experiment.nullValuesReplacers = new NullValues[] { }; experiment.encodings = new[] @@ -294,6 +332,7 @@ namespace api.Services dataset.dateCreated = DateTime.Now; dataset.lastUpdated = DateTime.Now; dataset.delimiter = ""; +<<<<<<< HEAD dataset.columnInfo = new[] { new ColumnInfo( "sepal_length", "columnType", true, 0, 5.8433332443237305f, 4.300000190734863f, 7.900000095367432f, 5.800000190734863f, new string[]{ }, new int[] {}, new float[] {}, 0.01f, 0.1f ), @@ -302,6 +341,17 @@ namespace api.Services new ColumnInfo( "petal_width", "columnType", true, 0, 1.1986666917800903f, 0.10000000149011612f, 2.5f, 1.2999999523162842f, new string[]{}, new int[] {}, new float[] {}, 0.01f,0.1f ), new ColumnInfo( "class", "columnType", false, 0, 0, 0, 0, 0, new string[]{ "Iris-setosa", "Iris-versicolor", "Iris-virginica" }, new int[] {}, new float[] {}, 0.01f,0.1f ), }; +======= + //dataset.hasHeader = true; + /*dataset.columnInfo = new[] + { + new ColumnInfo( "sepal_length", true, 0, 5.8433332443237305f, 4.300000190734863f, 7.900000095367432f, 5.800000190734863f, new string[]{ }), + new ColumnInfo( "sepal_width", true, 0, 3.053999900817871f, 2, 4.400000095367432f, 3, new string[]{ }), + new ColumnInfo( "petal_length", true, 0, 3.758666753768921f, 1, 6.900000095367432f, 4.349999904632568f, new string[]{ }), + new ColumnInfo( "petal_width", true, 0, 1.1986666917800903f, 0.10000000149011612f, 2.5f, 1.2999999523162842f, new string[]{}), + new ColumnInfo( "class", false, 0, 0, 0, 0, 0, new string[]{ "Iris-setosa", "Iris-versicolor", "Iris-virginica" }), + };*/ +>>>>>>> f9b96fc9234802ba78a64be094ebc4b4525cde8e dataset.nullCols = 150; dataset.nullRows = 0; dataset.isPreProcess = true; @@ -342,9 +392,9 @@ namespace api.Services experiment.uploaderId = "000000000000000000000000"; experiment.inputColumns = new string[] { "sepal_length", "sepal_width", "petal_length", "petal_width" }; experiment.outputColumn = "class"; - experiment.randomOrder = true; - experiment.randomTestSet = true; - experiment.randomTestSetDistribution = 0.20000000298023224f; + //experiment.randomOrder = true; + //experiment.randomTestSet = true; + //experiment.randomTestSetDistribution = 0.20000000298023224f; experiment.nullValues = "delete_rows"; experiment.nullValuesReplacers = new NullValues[] { }; experiment.encodings = new[] diff --git a/frontend/src/app/_data/Dataset.ts b/frontend/src/app/_data/Dataset.ts index c3e9056b..21b4b9ef 100644 --- a/frontend/src/app/_data/Dataset.ts +++ b/frontend/src/app/_data/Dataset.ts @@ -40,10 +40,10 @@ export class ColumnInfo { public q1?:number, public q3?:number, ) { - if (isNumber) - columnType = ColumnType.numerical; + /*if (isNumber) + this.columnType = ColumnType.numerical; else - columnType = ColumnType.categorical; + this.columnType = ColumnType.categorical;*/ } } diff --git a/frontend/src/app/_data/Experiment.ts b/frontend/src/app/_data/Experiment.ts index 23fd77d4..ab87e3ca 100644 --- a/frontend/src/app/_data/Experiment.ts +++ b/frontend/src/app/_data/Experiment.ts @@ -13,10 +13,7 @@ export default class Experiment { public lastUpdated: Date = new Date(), public modelIds: string[] = [], - // Test set settings - public randomOrder: boolean = true, - public randomTestSet: boolean = true, - public randomTestSetDistribution: number = 0.1, //0.1-0.9 (10% - 90%) JESTE OVDE ZAKUCANO 10, AL POSLATO JE KAO 0.1 BACK-U + public encodings: ColumnEncoding[] = []//[{columnName: "", columnEncoding: Encoding.Label}] ) { } diff --git a/frontend/src/app/_data/Model.ts b/frontend/src/app/_data/Model.ts index 6281748c..185e2257 100644 --- a/frontend/src/app/_data/Model.ts +++ b/frontend/src/app/_data/Model.ts @@ -23,7 +23,12 @@ export default class Model extends FolderFile { public epochs: number = 5, // TODO add to add-model form public inputColNum: number = 5, public learningRate: LearningRate = LearningRate.LR1, - public layers: Layer[] = [new Layer()] + public layers: Layer[] = [new Layer()], + + // Test set settings + public randomOrder: boolean = true, + public randomTestSet: boolean = true, + public randomTestSetDistribution: number = 0.1 //0.1-0.9 (10% - 90%) JESTE OVDE ZAKUCANO 10, AL POSLATO JE KAO 0.1 BACK-U ) { super(name, dateCreated, lastUpdated); diff --git a/frontend/src/app/_elements/column-table/column-table.component.css b/frontend/src/app/_elements/column-table/column-table.component.css index 5dc2e9ec..c3f5e4e8 100644 --- a/frontend/src/app/_elements/column-table/column-table.component.css +++ b/frontend/src/app/_elements/column-table/column-table.component.css @@ -55,8 +55,8 @@ mat-slider { } #missingValuesHeader { - font-size: 12px; - line-height: 110% !important; + font-size: 13px; + line-height: 140% !important; } .verticalAlign { @@ -242,4 +242,24 @@ col:not(.col-disabled) { .col-first { background-color: rgb(1, 56, 86) !important; +} + + +/* mat-icon rotate */ + +.rotate { + animation: rotation 3s infinite linear; +} + +.rotate:hover { + cursor: pointer; +} + +@keyframes rotation { + from { + transform: rotate(0deg); + } + to { + transform: rotate(359deg); + } }
\ No newline at end of file diff --git a/frontend/src/app/_elements/column-table/column-table.component.html b/frontend/src/app/_elements/column-table/column-table.component.html index 42c43138..fac82bc2 100644 --- a/frontend/src/app/_elements/column-table/column-table.component.html +++ b/frontend/src/app/_elements/column-table/column-table.component.html @@ -100,10 +100,11 @@ <tr> <th>Tip</th> <td *ngFor="let colInfo of dataset.columnInfo; let i = index" class="pad-fix" [ngClass]="{'text-disabled' : !columnsChecked[i]}"> - <mat-form-field> - <mat-select matNativeControl [(value)]="colInfo.isNumber" [disabled]="!columnsChecked[i]"> - <mat-option [value]="false">Kategorijski</mat-option> - <mat-option [value]="true">Numerički</mat-option> + <p class="verticalAlign text-left" style="font-size:13px;" *ngIf="!colInfo.isNumber">Kategorijski</p> + <mat-form-field *ngIf="colInfo.isNumber"> + <mat-select matNativeControl [(value)]="colInfo.columnType" [disabled]="!columnsChecked[i]"> + <mat-option [value]="ColumnType.categorical">Kategorijski</mat-option> + <mat-option [value]="ColumnType.numerical">Numerički</mat-option> </mat-select> </mat-form-field> </td> @@ -111,14 +112,14 @@ <tr class="graphics-row"> <th class="no-pad">Grafik</th> <td class="no-pad" *ngFor="let colInfo of dataset.columnInfo; let i = index" [ngClass]="{'graphic-class' : !columnsChecked[i]}"> - <app-box-plot *ngIf="colInfo.isNumber" [width]="150" [height]="150"></app-box-plot> - <app-pie-chart *ngIf="!colInfo.isNumber" [width]="150" [height]="150"></app-pie-chart> + <app-box-plot *ngIf="colInfo.columnType == ColumnType.numerical" [width]="150" [height]="150"></app-box-plot> + <app-pie-chart *ngIf="colInfo.columnType == ColumnType.categorical" [width]="150" [height]="150"></app-pie-chart> </td> </tr> <tr> <th class="border-bottom">Statistika</th> <td *ngFor="let colInfo of dataset.columnInfo; let i = index" [ngClass]="{'text-disabled' : !columnsChecked[i]}"> - <span *ngIf="colInfo.isNumber"> + <span *ngIf="colInfo.columnType == ColumnType.numerical"> Mean: {{colInfo.mean}}<br> Median: {{colInfo.median}}<br> Min: {{colInfo.min}}<br> @@ -128,7 +129,7 @@ Q3: {{colInfo.q3}}<br> --> </span> - <div class="text-overflow" *ngIf="!colInfo.isNumber"> + <div class="text-overflow" *ngIf="colInfo.columnType == ColumnType.categorical"> <span *ngFor="let uniqueValue of colInfo.uniqueValues | slice:0:6; let i = index"> {{uniqueValue}}<br><!-- TODO na ML-u: broj ponavljanja unique values-a u zagradi nek pise --> </span> @@ -138,7 +139,7 @@ <tr style="padding: 0"> <th class="brighter cell-align long" (click)="openEncodingDialog()"> <span class="verticalAlign">Enkodiranje</span> - <span class="material-icons-round verticalAlign">settings</span> + <span class="material-icons-round verticalAlign rotate">settings</span> </th> <td *ngFor="let colInfo of dataset.columnInfo; let i = index" class="pad-fix" [ngClass]="{'text-disabled' : !columnsChecked[i]}"> <mat-form-field> @@ -152,8 +153,8 @@ </tr> <tr> <th class="brighter cell-align" (click)="openMissingValuesDialog()"> - <div id="missingValuesHeader">Regulisanje<br>nedostajućih<br>vrednosti<br></div> - <span class="material-icons-round">settings</span> + <div id="missingValuesHeader">Nedostajuće<br>vrednosti<br></div> + <span class="material-icons-round rotate">settings</span> </th> <td *ngFor="let colInfo of dataset.columnInfo; let i = index" [ngClass]="{'text-disabled' : !columnsChecked[i]}"> @@ -164,9 +165,9 @@ </div> </button> <mat-menu #menu="matMenu"> - <button mat-menu-item (click)="MissValsDeleteClicked($event, NullValueOptions.DeleteColumns, i)" value={{colInfo.columnName}}>Obriši kolonu</button> + <!--<button mat-menu-item (click)="MissValsDeleteClicked($event, NullValueOptions.DeleteColumns, i)" value={{colInfo.columnName}}>Obriši kolonu</button>--> <button mat-menu-item (click)="MissValsDeleteClicked($event, NullValueOptions.DeleteRows, i)" value={{colInfo.columnName}}>Obriši redove</button> - <button mat-menu-item [matMenuTriggerFor]="fillWith">Popuni sa ____</button> + <button mat-menu-item [matMenuTriggerFor]="fillWith">Popuni sa</button> </mat-menu> <mat-menu #fillWith="matMenu"> @@ -209,20 +210,6 @@ <div class="container-fluid text-offwhite belowColumn mt-3"> <div class="ns-row"> - <div class="ns-col slider rounded" style="border:1px solid var(--ns-primary)"> - - <div class="text-center pt-3 pb-0 mb-0"><b>{{testSetDistribution}}%</b> : <b>{{100-testSetDistribution}}%</b></div> - <div class="text-center pt-0 mt-0">Trening - <mat-slider min="10" max="90" step="10" [(ngModel)]="testSetDistribution" (input)="updateTestSet($event)"></mat-slider> - Test</div> - - </div> - <div class="ns-col slider rounded" style="border:1px solid var(--ns-primary);margin-left: 10px;"> - <div class="text-center text-offwhite justify-content-center align-items-center"> - <mat-checkbox class="pt-4" color="accent">Nasumični redosled podataka</mat-checkbox> - </div> - </div> - <div class="break-2"></div> <div class="ns-col rounded"> diff --git a/frontend/src/app/_elements/column-table/column-table.component.ts b/frontend/src/app/_elements/column-table/column-table.component.ts index 4499196c..1946c1f1 100644 --- a/frontend/src/app/_elements/column-table/column-table.component.ts +++ b/frontend/src/app/_elements/column-table/column-table.component.ts @@ -1,11 +1,10 @@ import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChildren } from '@angular/core'; -import Dataset from 'src/app/_data/Dataset'; +import Dataset, { ColumnType } from 'src/app/_data/Dataset'; import Experiment, { ColumnEncoding, Encoding, NullValReplacer, NullValueOptions } from 'src/app/_data/Experiment'; import { DatasetsService } from 'src/app/_services/datasets.service'; import { EncodingDialogComponent } from 'src/app/_modals/encoding-dialog/encoding-dialog.component'; import { MatDialog } from '@angular/material/dialog'; import { MissingvaluesDialogComponent } from 'src/app/_modals/missingvalues-dialog/missingvalues-dialog.component'; -import { MatSliderChange } from '@angular/material/slider'; import { MatCheckboxChange } from '@angular/material/checkbox'; import { CsvParseService } from 'src/app/_services/csv-parse.service'; @@ -23,19 +22,22 @@ export class ColumnTableComponent implements AfterViewInit { Object = Object; Encoding = Encoding; NullValueOptions = NullValueOptions; + ColumnType = ColumnType; tableData?: any[][]; nullValOption: string[] = []; columnsChecked: boolean[] = []; //niz svih kolona - testSetDistribution: number = 70; + constructor(private datasetService: DatasetsService, public csvParseService: CsvParseService, public dialog: MatDialog) { //ovo mi nece trebati jer primam dataset iz druge komponente } ngAfterViewInit(): void { this.datasetService.getMyDatasets().subscribe((datasets) => { - this.dataset = datasets[0]; + this.dataset = datasets[1]; + + this.setColumnTypeInitial(); this.experiment = new Experiment(); this.dataset.columnInfo.forEach(column => { this.columnsChecked.push(true); @@ -57,6 +59,14 @@ export class ColumnTableComponent implements AfterViewInit { }); } + setColumnTypeInitial() { + if (this.dataset != undefined) { + for (let i = 0; i < this.dataset.columnInfo.length; i++) { + this.dataset.columnInfo[i].columnType = (this.dataset.columnInfo[i].isNumber) ? ColumnType.numerical : ColumnType.categorical; + } + } + } + setDeleteColumnsForMissingValTreatment() { if (this.experiment != undefined) { this.experiment.nullValues = NullValueOptions.DeleteRows; @@ -145,9 +155,7 @@ export class ColumnTableComponent implements AfterViewInit { this.resetMissingValuesTreatment(selectedMissingValuesOption); }); } - updateTestSet(event: MatSliderChange) { - this.testSetDistribution = event.value!; - } + MissValsDeleteClicked(event: Event, replacementType: NullValueOptions, index: number) { diff --git a/frontend/src/app/_elements/form-model/form-model.component.css b/frontend/src/app/_elements/form-model/form-model.component.css index 8c279523..9b55a814 100644 --- a/frontend/src/app/_elements/form-model/form-model.component.css +++ b/frontend/src/app/_elements/form-model/form-model.component.css @@ -84,4 +84,12 @@ hr { .m-2 { max-height: 20 rem; -}
\ No newline at end of file +} + +mat-slider { + width: 40%; +} + +.slider { + background-color: var(--ns-bg-dark-100); +} diff --git a/frontend/src/app/_elements/form-model/form-model.component.html b/frontend/src/app/_elements/form-model/form-model.component.html index 76601465..e51c2cac 100644 --- a/frontend/src/app/_elements/form-model/form-model.component.html +++ b/frontend/src/app/_elements/form-model/form-model.component.html @@ -85,7 +85,23 @@ </div> </div> +<div> + <div class="ns-row" style="margin-top: 10px;"> + <div class="ns-col slider rounded" style="border:1px solid var(--ns-primary);margin-left: 10px;"> + + <div class="text-center pt-3 pb-0 mb-0"><b>{{testSetDistribution}}%</b> : <b>{{100-testSetDistribution}}%</b></div> + <div class="text-center pt-0 mt-0">Trening + <mat-slider min="10" max="90" step="10" [(ngModel)]="testSetDistribution" (input)="updateTestSet($event)"></mat-slider> + Test</div> + + </div> + <div class="ns-col slider rounded text-offwhite justify-content-center align-items-center" style="border:1px solid var(--ns-primary);margin-left: 10px;"> + <mat-checkbox class="pt-4" color="accent">Nasumični redosled podataka</mat-checkbox> + </div> + + </div> +</div> <!--kraj unosa parametara--> <hr> @@ -199,4 +215,5 @@ </mat-select> </mat-form-field> </div> -</div>
\ No newline at end of file +</div> + diff --git a/frontend/src/app/_elements/form-model/form-model.component.ts b/frontend/src/app/_elements/form-model/form-model.component.ts index 2c78cd56..d5c497aa 100644 --- a/frontend/src/app/_elements/form-model/form-model.component.ts +++ b/frontend/src/app/_elements/form-model/form-model.component.ts @@ -4,7 +4,7 @@ import Shared from 'src/app/Shared'; import Experiment from 'src/app/_data/Experiment'; import Model, { Layer, ActivationFunction, LossFunction, LearningRate, LossFunctionBinaryClassification, LossFunctionMultiClassification, LossFunctionRegression, Metrics, MetricsBinaryClassification, MetricsMultiClassification, MetricsRegression, NullValueOptions, Optimizer, ProblemType, Regularisation, RegularisationRate, BatchSize } from 'src/app/_data/Model'; import { GraphComponent } from '../graph/graph.component'; - +import { MatSliderChange } from '@angular/material/slider'; @Component({ selector: 'app-form-model', @@ -15,7 +15,7 @@ export class FormModelComponent implements AfterViewInit { @ViewChild(GraphComponent) graph!: GraphComponent; @Input() forExperiment?: Experiment; @Output() selectedModelChangeEvent = new EventEmitter<Model>(); - + testSetDistribution: number = 70; constructor() { } ngAfterViewInit(): void { @@ -132,6 +132,9 @@ export class FormModelComponent implements AfterViewInit { this.updateGraph(); } } + updateTestSet(event: MatSliderChange) { + this.testSetDistribution = event.value!; + } |