aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_data
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/app/_data')
-rw-r--r--frontend/src/app/_data/Dataset.ts37
-rw-r--r--frontend/src/app/_data/Experiment.ts27
-rw-r--r--frontend/src/app/_data/FolderFile.ts14
-rw-r--r--frontend/src/app/_data/Model.ts82
4 files changed, 125 insertions, 35 deletions
diff --git a/frontend/src/app/_data/Dataset.ts b/frontend/src/app/_data/Dataset.ts
index 766040a3..4ff0a471 100644
--- a/frontend/src/app/_data/Dataset.ts
+++ b/frontend/src/app/_data/Dataset.ts
@@ -1,25 +1,27 @@
-export default class Dataset {
+import { FolderFile } from "./FolderFile";
+
+export default class Dataset extends FolderFile {
_id: string = '';
constructor(
- public name: string = 'Novi izvor podataka',
+ name: string = 'Novi izvor podataka',
public description: string = '',
- public header: string[] = [],
public fileId?: number,
public extension: string = '.csv',
public isPublic: boolean = false,
public accessibleByLink: boolean = false,
- public dateCreated: Date = new Date(),
- public lastUpdated: Date = new Date(),
+ dateCreated: Date = new Date(),
+ lastUpdated: Date = new Date(),
public uploaderId: string = '',
- public delimiter: string = '',
- public hasHeader: boolean = true,
+ public delimiter: string = ',',
public columnInfo: ColumnInfo[] = [],
public rowCount: number = 0,
public nullRows: number = 0,
public nullCols: number = 0,
- public preview: string[][] = [[]]
- ) { }
+ public cMatrix: number[][] = []
+ ) {
+ super(name, dateCreated, lastUpdated);
+ }
}
export class ColumnInfo {
@@ -28,9 +30,20 @@ export class ColumnInfo {
public isNumber: boolean = false,
public numNulls: number = 0,
public uniqueValues?: string[],
+ public uniqueValuesCount?: number[],
+ public uniqueValuesPercent?: number[],
public median?: number,
public mean?: number,
public min?: number,
- public max?: number
- ) { }
-} \ No newline at end of file
+ public max?: number,
+ public q1?: number,
+ public q3?: number,
+ ) {
+ /*if (isNumber)
+ this.columnType = ColumnType.numerical;
+ else
+ this.columnType = ColumnType.categorical;*/
+ }
+
+}
+
diff --git a/frontend/src/app/_data/Experiment.ts b/frontend/src/app/_data/Experiment.ts
index 95ef6e1e..cff77535 100644
--- a/frontend/src/app/_data/Experiment.ts
+++ b/frontend/src/app/_data/Experiment.ts
@@ -5,6 +5,7 @@ export default class Experiment {
constructor(
public name: string = 'Novi eksperiment',
public description: string = '',
+ public type: ProblemType = ProblemType.Regression,
public datasetId: string = '',
public inputColumns: string[] = [],
public outputColumn: string = '',
@@ -13,15 +14,11 @@ export default class Experiment {
public dateCreated: Date = new Date(),
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[] = [],
- public type: ProblemType = ProblemType.Regression
+ public columnTypes: ColumnType[] = [],
+ public encodings: ColumnEncoding[] = []//[{columnName: "", columnEncoding: Encoding.Label}]
) { }
+
+ _columnsSelected: boolean = false;
}
export enum NullValueOptions {
@@ -47,11 +44,11 @@ export class NullValReplacer {
export enum Encoding {
Label = 'label',
OneHot = 'onehot',
- Ordinal = 'ordinal',
+ /*Ordinal = 'ordinal',
Hashing = 'hashing',
Binary = 'binary',
BaseN = 'baseN'
- /*
+
BackwardDifference = 'backward difference',
CatBoost = 'cat boost',
Count = 'count',
@@ -69,9 +66,13 @@ export enum Encoding {
}
export class ColumnEncoding {
- constructor (
+ constructor(
public columnName: string,
public encoding: Encoding
- )
- {}
+ ) { }
+}
+
+export enum ColumnType {
+ categorical = "categorical",
+ numerical = "numerical"
} \ No newline at end of file
diff --git a/frontend/src/app/_data/FolderFile.ts b/frontend/src/app/_data/FolderFile.ts
new file mode 100644
index 00000000..c228f25e
--- /dev/null
+++ b/frontend/src/app/_data/FolderFile.ts
@@ -0,0 +1,14 @@
+export class FolderFile {
+ constructor(
+ public name: string,
+ public dateCreated: Date,
+ public lastUpdated: Date
+ ) { }
+}
+
+
+export enum FolderType {
+ Dataset,
+ Model,
+ Experiment
+} \ No newline at end of file
diff --git a/frontend/src/app/_data/Model.ts b/frontend/src/app/_data/Model.ts
index 7d383584..526a8290 100644
--- a/frontend/src/app/_data/Model.ts
+++ b/frontend/src/app/_data/Model.ts
@@ -1,12 +1,13 @@
import { NgIf } from "@angular/common";
+import { FolderFile } from "./FolderFile";
-export default class Model {
+export default class Model extends FolderFile {
_id: string = '';
constructor(
- public name: string = 'Novi model',
+ name: string = 'Novi model',
public description: string = '',
- public dateCreated: Date = new Date(),
- public lastUpdated: Date = new Date(),
+ dateCreated: Date = new Date(),
+ lastUpdated: Date = new Date(),
//public experimentId: string = '',
// Neural net training settings
@@ -14,17 +15,65 @@ export default class Model {
public optimizer: Optimizer = Optimizer.Adam,
public lossFunction: LossFunction = LossFunction.MeanSquaredError,
public inputNeurons: number = 1,
- public hiddenLayerNeurons: number = 1,
public hiddenLayers: number = 1,
- public batchSize: number = 4,
- public hiddenLayerActivationFunctions: string[] = ['sigmoid'],
+ public batchSize: BatchSize = BatchSize.O3,
public outputLayerActivationFunction: ActivationFunction = ActivationFunction.Sigmoid,
public uploaderId: string = '',
public metrics: string[] = [], // TODO add to add-model form
- public epochs: number = 5 // TODO add to add-model form
+ public epochs: number = 5, // TODO add to add-model form
+ public inputColNum: number = 5,
+ public learningRate: LearningRate = LearningRate.LR1,
+ 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
+
+ public isPublic: boolean = false,
+ public accessibleByLink: boolean = false
+ ) {
+ super(name, dateCreated, lastUpdated);
+ }
+}
+export class Layer {
+ constructor(
+ public layerNumber: number = 0,
+ public activationFunction: ActivationFunction = ActivationFunction.Sigmoid,
+ public neurons: number = 3,
+ public regularisation: Regularisation = Regularisation.L1,
+ 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',
@@ -94,7 +143,7 @@ export enum LossFunctionBinaryClassification {
HingeLoss = 'hinge_loss',
}
export enum LossFunctionMultiClassification {
- //CategoricalCrossEntropy = 'categorical_crossentropy',
+ CategoricalCrossEntropy = 'categorical_crossentropy',
SparseCategoricalCrossEntropy = 'sparse_categorical_crossentropy',
KLDivergence = 'kullback_leibler_divergence',
}
@@ -157,3 +206,16 @@ export enum MetricsMultiClassification {
Recall = 'recall_score',
F1 = 'f1_score',
}
+
+export enum BatchSize {
+ O1 = '2',
+ O2 = '4',
+ O3 = '8',
+ O4 = '16',
+ O5 = '32',
+ O6 = '64',
+ O7 = '128',
+ O8 = '256',
+ O9 = '512',
+ O10 = '1024'
+} \ No newline at end of file