From 39fc1f0cc9871b4436b839acb6ce4260e6c33931 Mon Sep 17 00:00:00 2001 From: TAMARA JERINIC Date: Wed, 30 Mar 2022 23:09:01 +0200 Subject: Omogućeno je sortiranje padajuće liste za izbor funkcije gubitka u zavisnosti od tipa problema. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/_pages/add-model/add-model.component.ts | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'frontend/src/app/_pages/add-model/add-model.component.ts') diff --git a/frontend/src/app/_pages/add-model/add-model.component.ts b/frontend/src/app/_pages/add-model/add-model.component.ts index b12ff825..ead9049b 100644 --- a/frontend/src/app/_pages/add-model/add-model.component.ts +++ b/frontend/src/app/_pages/add-model/add-model.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import Model, { NullValReplacer, ReplaceWith } from 'src/app/_data/Model'; +import Model, { LossFunctionBinaryClassification, LossFunctionMultiClassification, LossFunctionRegression, NullValReplacer, ReplaceWith } from 'src/app/_data/Model'; import { ProblemType, Encoding, ActivationFunction, LossFunction, Optimizer, NullValueOptions } from 'src/app/_data/Model'; import { DatasetLoadComponent } from 'src/app/_elements/dataset-load/dataset-load.component'; import { ModelsService } from 'src/app/_services/models.service'; @@ -26,7 +26,9 @@ export class AddModelComponent implements OnInit { ProblemType = ProblemType; Encoding = Encoding; ActivationFunction = ActivationFunction; + activationFunction:any=ActivationFunction LossFunction = LossFunction; + lossFunction : any = LossFunction; Optimizer = Optimizer; NullValueOptions = NullValueOptions; ReplaceWith = ReplaceWith; @@ -50,6 +52,9 @@ export class AddModelComponent implements OnInit { //accepted: Boolean; term: string = ""; + selectedProblemType:string=''; + + constructor(private models: ModelsService, private datasets: DatasetsService, private csv: CsvParseService) { this.newModel = new Model(); @@ -62,6 +67,7 @@ export class AddModelComponent implements OnInit { (document.getElementById("btnMyDataset")).focus(); } + viewMyDatasetsForm() { this.showMyDatasets = true; this.resetSelectedDataset(); @@ -466,4 +472,24 @@ export class AddModelComponent implements OnInit { } arrayColumn = (arr: any[][], n: number) => [...new Set(arr.map(x => x[n]))]; + + problemtype:string=''; + + filterOptions(){ + switch(this.problemtype){ + case 'regresioni': + this.lossFunction=LossFunctionRegression; + break; + case 'binarni-klasifikacioni': + this.lossFunction=LossFunctionBinaryClassification; + break; + case 'multi-klasifikacioni': + this.lossFunction=LossFunctionMultiClassification; + break; + default: + break; + } + } + + } -- cgit v1.2.3