From a8a04c45c8941afde34ec0765a0e5f4051fe1f02 Mon Sep 17 00:00:00 2001 From: Sonja Galovic Date: Tue, 26 Apr 2022 22:47:39 +0200 Subject: Dodat poziv back-u za deo fajla sa podacima (planirano stranicenje). Prikaz podataka iz dataseta u okviru glavne tabele. Uredjeni grafici za statistiku. --- .../_charts/box-plot/box-plot.component.ts | 62 ++++++++++++++-------- .../_charts/pie-chart/pie-chart.component.ts | 15 ++++-- .../column-table/column-table.component.html | 31 ++++++----- .../column-table/column-table.component.ts | 12 ++++- 4 files changed, 76 insertions(+), 44 deletions(-) (limited to 'frontend/src/app/_elements') diff --git a/frontend/src/app/_elements/_charts/box-plot/box-plot.component.ts b/frontend/src/app/_elements/_charts/box-plot/box-plot.component.ts index 078e7176..45e83e83 100644 --- a/frontend/src/app/_elements/_charts/box-plot/box-plot.component.ts +++ b/frontend/src/app/_elements/_charts/box-plot/box-plot.component.ts @@ -16,33 +16,32 @@ Chart.register(BoxPlotController, BoxAndWiskers, LinearScale, CategoryScale); }) export class BoxPlotComponent implements AfterViewInit { - @Input()width: number = 800; - @Input()height: number = 450; + @Input()width: number = 600; + @Input()height: number = 800; @ViewChild('boxplot') chartRef!: ElementRef; constructor() { } boxplotData = { // define label tree - labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], - datasets: [{ - label: 'Dataset 1', - backgroundColor: 'rgba(255,0,0,0.5)', - borderColor: 'red', - borderWidth: 1, - outlierColor: '#999999', - padding: 10, - itemRadius: 0, - data: [ - randomValues(100, 0, 100), - randomValues(100, 0, 20), - randomValues(100, 20, 70), - randomValues(100, 60, 100), - randomValues(40, 50, 100), - randomValues(100, 60, 120), - randomValues(100, 80, 100) - ] - }, { + labels: ['January'/*, 'February', 'March', 'April', 'May', 'June', 'July'*/], + datasets: [{ + label: 'Dataset 1', + backgroundColor: 'rgba(255,0,0,0.5)', + borderColor: 'red', + borderWidth: 1, + outlierColor: '#999999', + padding: 10, + itemRadius: 0, + data: [ + randomValues(100, 0, 100), + /*randomValues(100, 0, 20), + randomValues(100, 20, 70), + randomValues(100, 60, 100), + randomValues(40, 50, 100), + randomValues(100, 60, 120), + randomValues(100, 80, 100)*/ + ]}/*, { label: 'Dataset 2', backgroundColor: 'rgba(0,0,255,0.5)', borderColor: 'blue', @@ -59,12 +58,29 @@ export class BoxPlotComponent implements AfterViewInit { randomValues(100, 20, 100), randomValues(100, 80, 100) ] - }] + }*/] }; ngAfterViewInit(): void { const myChart = new Chart(this.chartRef.nativeElement, { type: "boxplot", - data: this.boxplotData + data: this.boxplotData, + options: { + /*title: { + display: true, + text: 'Predicted world population (millions) in 2050' + }*/ + plugins:{ + legend: { + display: false + }, + }, + scales : { + y : { + min: -50, + max: 200 + } + } + } }); } diff --git a/frontend/src/app/_elements/_charts/pie-chart/pie-chart.component.ts b/frontend/src/app/_elements/_charts/pie-chart/pie-chart.component.ts index 3f2dbfaf..248c9aa8 100644 --- a/frontend/src/app/_elements/_charts/pie-chart/pie-chart.component.ts +++ b/frontend/src/app/_elements/_charts/pie-chart/pie-chart.component.ts @@ -8,7 +8,7 @@ import {Chart} from 'chart.js'; }) export class PieChartComponent implements AfterViewInit { - @Input()width: number = 800; + @Input()width: number = 600; @Input()height: number = 450; @ViewChild('piechart') chartRef!: ElementRef; @@ -25,12 +25,17 @@ export class PieChartComponent implements AfterViewInit { data: [2478,5267,734,784,433] }] }, - /*options: { - title: { + options: { + /*title: { display: true, text: 'Predicted world population (millions) in 2050' - } - }*/ + }*/ + plugins:{ + legend: { + display: false + }, + } + } }); } 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 1a5a5e81..8551f710 100644 --- a/frontend/src/app/_elements/column-table/column-table.component.html +++ b/frontend/src/app/_elements/column-table/column-table.component.html @@ -23,9 +23,8 @@ Grafik - + + @@ -48,8 +47,8 @@ - - Enkoding  + + Enkoding settings @@ -99,24 +98,28 @@ - - Vrednosti + + Vrednosti + - - ok + +
+ {{col}} +
-
+
{{testSetDistribution}}% : {{100-testSetDistribution}}%
-
TreningTest
- +
Trening + Test
+
- +
Tip problema @@ -128,7 +131,7 @@
- + Izlazna kolona {{item.columnName}} 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 f3aedd1b..9cb038bc 100644 --- a/frontend/src/app/_elements/column-table/column-table.component.ts +++ b/frontend/src/app/_elements/column-table/column-table.component.ts @@ -8,6 +8,7 @@ import { MissingvaluesDialogComponent } from 'src/app/_modals/missingvalues-dial import { MatSliderChange } from '@angular/material/slider'; import { MatCheckboxChange } from '@angular/material/checkbox'; import { MatMenuItem, MatMenuTrigger } from '@angular/material/menu'; +import { CsvParseService } from 'src/app/_services/csv-parse.service'; @Component({ selector: 'app-column-table', @@ -24,9 +25,10 @@ export class ColumnTableComponent implements AfterViewInit { Encoding = Encoding; NullValueOptions = NullValueOptions; tableData?: any[][]; + nesto = 10; testSetDistribution:number=70; - constructor(private datasetService: DatasetsService, public dialog: MatDialog) { + constructor(private datasetService: DatasetsService, public csvParseService: CsvParseService, public dialog: MatDialog) { //ovo mi nece trebati jer primam dataset iz druge komponente } @@ -41,11 +43,17 @@ export class ColumnTableComponent implements AfterViewInit { this.resetColumnEncodings(Encoding.Label); this.setDeleteColumnsForMissingValTreatment(); - /*this.tableData = this.datasetService.getDatasetFile(this.dataset._id).subscribe((file: string | undefined) => { + /*this.datasetService.getDatasetFile(this.dataset._id).subscribe((file: string | undefined) => { if (file) { //this.tableData = this.csv.csvToArray(file, (dataset.delimiter == "razmak") ? " " : (dataset.delimiter == "") ? "," : dataset.delimiter); } });*/ + this.datasetService.getDatasetFilePartial(this.dataset.fileId, 0, 10).subscribe((response: string | undefined) => { + if (response && this.dataset != undefined) { + this.tableData = this.csvParseService.csvToArray(response, (this.dataset.delimiter == "razmak") ? " " : (this.dataset.delimiter == "") ? "," : this.dataset.delimiter); + console.log(this.tableData); + } + }); }); } -- cgit v1.2.3 From 6196023a54bcf0ac5a81c64aff0bcf55f22e0ef8 Mon Sep 17 00:00:00 2001 From: TAMARA JERINIC Date: Tue, 26 Apr 2022 22:54:07 +0200 Subject: Parametri su povezani. --- frontend/src/app/_data/Model.ts | 29 ++++++- .../_elements/form-model/form-model.component.css | 10 ++- .../_elements/form-model/form-model.component.html | 93 +++++++++------------- .../_elements/form-model/form-model.component.ts | 10 ++- 4 files changed, 80 insertions(+), 62 deletions(-) (limited to 'frontend/src/app/_elements') diff --git a/frontend/src/app/_data/Model.ts b/frontend/src/app/_data/Model.ts index 094378f3..a3b86bdf 100644 --- a/frontend/src/app/_data/Model.ts +++ b/frontend/src/app/_data/Model.ts @@ -21,7 +21,7 @@ export default class Model { public metrics: string[] = [], // TODO add to add-model form public epochs: number = 5, // TODO add to add-model form public inputColNum:number=5, - public learningRate:number=0.01, + public learningRate:LearningRate=LearningRate.LR1, public layers:Layer[]=[new Layer()] ) { } @@ -32,16 +32,41 @@ export class Layer{ public activationFunction:ActivationFunction=ActivationFunction.Sigmoid, public neurons:number=1, public regularisation:Regularisation=Regularisation.L1, - public regularisationRate:number=0.01 + public regularisationRate:RegularisationRate=RegularisationRate.RR1, ) {} } +export enum LearningRate{ + LR1='0.00001', + LR2='0.0001', + LR3='0.001', + LR4='0.003', + LR5='0.01', + LR6='0.03', + LR7='0.1', + LR8='0.3', + LR9='1', + LR10='3', + LR11='10', +} export enum Regularisation{ L1='l1', L2='l2' } +export enum RegularisationRate{ + RR1='0', + RR2='0.001', + RR3='0.003', + RR4='0.01', + RR5='0.03', + RR6='0.1', + RR7='0.3', + RR8='1', + RR9='3', + RR10='10', +} export enum ProblemType { Regression = 'regresioni', BinaryClassification = 'binarni-klasifikacioni', 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 f4d085ea..051e23fc 100644 --- a/frontend/src/app/_elements/form-model/form-model.component.css +++ b/frontend/src/app/_elements/form-model/form-model.component.css @@ -12,8 +12,10 @@ mat-form-field{ padding: 0; } hr{ - color: var(--offwhite) !important; - margin-bottom: 30px;; + color:var(--ns-primary) 100%; + margin-bottom: 30px; + height: 2px; + } .row{ margin: 0; @@ -29,7 +31,7 @@ mat-icon{ .neuron{ text-align: justify; - border: 1px solid white; + border: 1px solid var(--ns-primary); border-radius: 5px; padding: 0; color: white!important; @@ -39,7 +41,7 @@ mat-icon{ } mat-form-field{ - font-size: 12px; + font-size: 15px; } col-1{ text-align: center; 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 ac5ca9ab..6435b8d6 100644 --- a/frontend/src/app/_elements/form-model/form-model.component.html +++ b/frontend/src/app/_elements/form-model/form-model.component.html @@ -4,28 +4,20 @@
Naziv - - - Unesite naziv - - - Naziv je obavezan - +
Tip problema - + {{ optionName }} - - Obavezno polje - +
@@ -33,31 +25,27 @@
Optimizacija - + {{ optionName }} - - Obavezno polje - +
Funkcija troška - + {{ optionName }} - - Obavezno polje - +
@@ -66,32 +54,28 @@ Funkcija aktivacije izlaznog sloja - + {{ optionName }} - - Obavezno polje - +
- Funkcija troška - + Stopa učenja + {{ optionName }} - - Obavezno polje - +
@@ -130,19 +114,19 @@ {{item}}
- +
Aktivaciona funkcija - - Relu - Sigmoid - Softmax - - - Obavezno polje - + + + {{ optionName }} + + +
@@ -155,26 +139,27 @@
Regularizacija - - L1 - L2 - - - Obavezno polje - + + + {{ optionName }} + + +
Stopa regularizacije - - 0.001 - 0.01 - 0.1 - - - Obavezno polje - + + + {{ optionName }} + + +
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 40bc30ea..c3c73b3e 100644 --- a/frontend/src/app/_elements/form-model/form-model.component.ts +++ b/frontend/src/app/_elements/form-model/form-model.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit ,Input, ViewChild, Output, EventEmitter} from '@angul import {FormControl, Validators} from '@angular/forms'; import Shared from 'src/app/Shared'; import Experiment from 'src/app/_data/Experiment'; -import Model, {Layer, ActivationFunction, LossFunction, LossFunctionBinaryClassification, LossFunctionMultiClassification, LossFunctionRegression, Metrics, MetricsBinaryClassification, MetricsMultiClassification, MetricsRegression, NullValueOptions, Optimizer, ProblemType } from 'src/app/_data/Model'; +import Model, {Layer, ActivationFunction, LossFunction,LearningRate, LossFunctionBinaryClassification, LossFunctionMultiClassification, LossFunctionRegression, Metrics, MetricsBinaryClassification, MetricsMultiClassification, MetricsRegression, NullValueOptions, Optimizer, ProblemType ,Regularisation,RegularisationRate} from 'src/app/_data/Model'; import { GraphComponent } from '../graph/graph.component'; import {FormGroupDirective, NgForm} from '@angular/forms'; import {ErrorStateMatcher} from '@angular/material/core'; @@ -35,19 +35,25 @@ export class FormModelComponent implements OnInit { selectActivationFormControl = new FormControl('', Validators.required); selectRegularisationFormControl = new FormControl('', Validators.required); selectRRateFormControl = new FormControl('', Validators.required); + newModel: Model = new Model(); myModels?: Model[]; + selectedModel?: Model; ProblemType = ProblemType; ActivationFunction = ActivationFunction; + RegularisationRate=RegularisationRate; + Regularisation=Regularisation; metrics: any = Metrics; LossFunction = LossFunction; Optimizer = Optimizer; Object = Object; document = document; shared = Shared; - + LearningRate=LearningRate; + Layer=Layer; + term: string = ""; selectedMetrics = []; lossFunction: any = LossFunction; -- cgit v1.2.3