From e22b83919e6442dfb55d7953d9227268c850adf8 Mon Sep 17 00:00:00 2001 From: Danijel Andjelkovic Date: Thu, 17 Mar 2022 00:32:49 +0100 Subject: Napravio neophodne izmene tako da backend i frontend komuniciraju uspesno. --- backend/api/api/Data/UserStoreDatabaseSettings.cs | 1 + backend/api/api/Interfaces/IUserStoreDatabaseSettings.cs | 3 ++- backend/api/api/Models/Dataset.cs | 2 +- backend/api/api/Models/Model.cs | 8 ++++---- backend/api/api/Models/Predictor.cs | 1 - backend/api/api/Services/ModelService.cs | 2 +- backend/api/api/api.csproj | 1 + 7 files changed, 10 insertions(+), 8 deletions(-) (limited to 'backend') diff --git a/backend/api/api/Data/UserStoreDatabaseSettings.cs b/backend/api/api/Data/UserStoreDatabaseSettings.cs index 6841a3e0..e83d2b54 100644 --- a/backend/api/api/Data/UserStoreDatabaseSettings.cs +++ b/backend/api/api/Data/UserStoreDatabaseSettings.cs @@ -11,6 +11,7 @@ namespace api.Data public string CollectionName { get; set; } = String.Empty; public string DatasetCollectionName { get; set; } = String.Empty; public string PredictorCollectionName { get; set; } = String.Empty; + public string ModelCollectionName { get; set; } = String.Empty; public string FilesCollectionName { get; set; } = String.Empty; } } diff --git a/backend/api/api/Interfaces/IUserStoreDatabaseSettings.cs b/backend/api/api/Interfaces/IUserStoreDatabaseSettings.cs index 94d3e1fc..a5b5f5eb 100644 --- a/backend/api/api/Interfaces/IUserStoreDatabaseSettings.cs +++ b/backend/api/api/Interfaces/IUserStoreDatabaseSettings.cs @@ -6,7 +6,8 @@ string DatabaseName { get; set; } string CollectionName { get; set; } string DatasetCollectionName { get; set; } - string PredictorCollectionName { get; } + string PredictorCollectionName { get; set; } + string ModelCollectionName { get; set; } string FilesCollectionName { get; set; } } } diff --git a/backend/api/api/Models/Dataset.cs b/backend/api/api/Models/Dataset.cs index 70092bd2..d4649c17 100644 --- a/backend/api/api/Models/Dataset.cs +++ b/backend/api/api/Models/Dataset.cs @@ -6,7 +6,7 @@ namespace api.Models { public class Dataset { - public string username; + public string username { get; set; } [BsonId] [BsonRepresentation(BsonType.ObjectId)]//mongo data type to .net diff --git a/backend/api/api/Models/Model.cs b/backend/api/api/Models/Model.cs index 7b22ded8..dfc4336a 100644 --- a/backend/api/api/Models/Model.cs +++ b/backend/api/api/Models/Model.cs @@ -21,11 +21,11 @@ namespace api.Models public string datasetId { get; set; } //Test set settings - public int[] inputColumns { get; set; } - public int columnToPredict { get; set; } - public bool radnomOrder {get;set;} + public string[] inputColumns { get; set; } + public string columnToPredict { get; set; } + public bool randomOrder {get;set;} public bool randomTestSet { get; set; } - public int randomTestSetDistribution { get; set; } + public float randomTestSetDistribution { get; set; } //Neural net training public string type { get; set; } diff --git a/backend/api/api/Models/Predictor.cs b/backend/api/api/Models/Predictor.cs index 638495bd..cd2f4557 100644 --- a/backend/api/api/Models/Predictor.cs +++ b/backend/api/api/Models/Predictor.cs @@ -10,7 +10,6 @@ namespace api.Models [BsonRepresentation(BsonType.ObjectId)]//mongo data type to .net public string _id { get; set; } public string username { get; set; } - public string name { get; set; } public string description { get; set; } public string[] inputs { get; set; } diff --git a/backend/api/api/Services/ModelService.cs b/backend/api/api/Services/ModelService.cs index a3939b29..2ba3c54d 100644 --- a/backend/api/api/Services/ModelService.cs +++ b/backend/api/api/Services/ModelService.cs @@ -13,7 +13,7 @@ namespace api.Services public ModelService(IUserStoreDatabaseSettings settings, IMongoClient mongoClient) { var database = mongoClient.GetDatabase(settings.DatabaseName); - _model = database.GetCollection(settings.PredictorCollectionName); + _model = database.GetCollection(settings.ModelCollectionName); } public Model Create(Model model) diff --git a/backend/api/api/api.csproj b/backend/api/api/api.csproj index f38621ca..f63407ca 100644 --- a/backend/api/api/api.csproj +++ b/backend/api/api/api.csproj @@ -22,6 +22,7 @@ + -- cgit v1.2.3