From 36c90f66c9e869f4f9b2ba4dd70a431c57a84999 Mon Sep 17 00:00:00 2001 From: Ivan Ljubisavljevic Date: Mon, 2 May 2022 23:31:29 +0200 Subject: Ispravljen backend --- backend/api/api/Controllers/FileController.cs | 9 ++-- backend/api/api/Interfaces/IAuthService.cs | 12 +++++ backend/api/api/Interfaces/IDatasetService.cs | 22 ++++++++ backend/api/api/Interfaces/IExperimentService.cs | 12 +++++ backend/api/api/Interfaces/IFileService.cs | 13 +++++ backend/api/api/Interfaces/IMLWebSocketService.cs | 7 +++ backend/api/api/Interfaces/IMlConnectionService.cs | 16 ++++++ backend/api/api/Interfaces/IModelService.cs | 23 +++++++++ backend/api/api/Interfaces/IPredictorService.cs | 16 ++++++ backend/api/api/Interfaces/IUserService.cs | 16 ++++++ backend/api/api/Models/ColumnInfo.cs | 12 ++--- backend/api/api/Models/Dataset.cs | 1 - backend/api/api/Services/FillAnEmptyDb.cs | 60 ++++++++++------------ backend/api/api/Services/IAuthService.cs | 12 ----- backend/api/api/Services/IDatasetService.cs | 22 -------- backend/api/api/Services/IExperimentService.cs | 12 ----- backend/api/api/Services/IFileService.cs | 13 ----- backend/api/api/Services/IMLWebSocketService.cs | 7 --- backend/api/api/Services/IMlConnectionService.cs | 16 ------ backend/api/api/Services/IModelService.cs | 23 --------- backend/api/api/Services/IPredictorService.cs | 16 ------ backend/api/api/Services/IUserService.cs | 16 ------ 22 files changed, 174 insertions(+), 182 deletions(-) create mode 100644 backend/api/api/Interfaces/IAuthService.cs create mode 100644 backend/api/api/Interfaces/IDatasetService.cs create mode 100644 backend/api/api/Interfaces/IExperimentService.cs create mode 100644 backend/api/api/Interfaces/IFileService.cs create mode 100644 backend/api/api/Interfaces/IMLWebSocketService.cs create mode 100644 backend/api/api/Interfaces/IMlConnectionService.cs create mode 100644 backend/api/api/Interfaces/IModelService.cs create mode 100644 backend/api/api/Interfaces/IPredictorService.cs create mode 100644 backend/api/api/Interfaces/IUserService.cs delete mode 100644 backend/api/api/Services/IAuthService.cs delete mode 100644 backend/api/api/Services/IDatasetService.cs delete mode 100644 backend/api/api/Services/IExperimentService.cs delete mode 100644 backend/api/api/Services/IFileService.cs delete mode 100644 backend/api/api/Services/IMLWebSocketService.cs delete mode 100644 backend/api/api/Services/IMlConnectionService.cs delete mode 100644 backend/api/api/Services/IModelService.cs delete mode 100644 backend/api/api/Services/IPredictorService.cs delete mode 100644 backend/api/api/Services/IUserService.cs (limited to 'backend/api') diff --git a/backend/api/api/Controllers/FileController.cs b/backend/api/api/Controllers/FileController.cs index 9baf6294..99d98a78 100644 --- a/backend/api/api/Controllers/FileController.cs +++ b/backend/api/api/Controllers/FileController.cs @@ -94,9 +94,9 @@ namespace api.Controllers return Ok(fileModel._id); } - [HttpGet("csvread/{hasHeader}/{fileId}/{skipRows}/{takeRows}")] + [HttpGet("csvread/{fileId}/{skipRows}/{takeRows}")] [Authorize(Roles = "User,Guest")] - public ActionResult CsvRead(bool hasHeader, string fileId, int skipRows = 0, int takeRows = 10) + public ActionResult CsvRead(string fileId, int skipRows = 0, int takeRows = 10) { string uploaderId = getUserId(); @@ -109,10 +109,7 @@ namespace api.Controllers - if (hasHeader) - return String.Join("\n", System.IO.File.ReadLines(filePath).Skip(skipRows+1).Take(takeRows)); - else - return String.Join("\n", System.IO.File.ReadLines(filePath).Skip(skipRows).Take(takeRows)); + return String.Join("\n", System.IO.File.ReadLines(filePath).Skip(skipRows+1).Take(takeRows)); } diff --git a/backend/api/api/Interfaces/IAuthService.cs b/backend/api/api/Interfaces/IAuthService.cs new file mode 100644 index 00000000..9a109208 --- /dev/null +++ b/backend/api/api/Interfaces/IAuthService.cs @@ -0,0 +1,12 @@ +using api.Models.Users; + +namespace api.Services +{ + public interface IAuthService + { + string Login(AuthRequest user); + string Register(RegisterRequest user); + string RenewToken(string token); + public string GuestToken(); + } +} \ No newline at end of file diff --git a/backend/api/api/Interfaces/IDatasetService.cs b/backend/api/api/Interfaces/IDatasetService.cs new file mode 100644 index 00000000..f493a2ec --- /dev/null +++ b/backend/api/api/Interfaces/IDatasetService.cs @@ -0,0 +1,22 @@ + +using api.Models; + +namespace api.Services +{ + public interface IDatasetService + { + Dataset GetOneDataset(string userId, string name); + Dataset GetOneDataset(string id); + List SearchDatasets(string name); + List GetMyDatasets(string userId); + List SortDatasets(string userId, bool ascdsc, int latest); + List GetPublicDatasets(); + Dataset Create(Dataset dataset); + void Update(string userId, string id, Dataset dataset); + void Delete(string userId, string id); + public List GetGuestDatasets(); + public void Update(Dataset dataset); + string GetDatasetId(string fileId); + //bool CheckDb(); + } +} diff --git a/backend/api/api/Interfaces/IExperimentService.cs b/backend/api/api/Interfaces/IExperimentService.cs new file mode 100644 index 00000000..47c86046 --- /dev/null +++ b/backend/api/api/Interfaces/IExperimentService.cs @@ -0,0 +1,12 @@ +using api.Models; + +namespace api.Services +{ + public interface IExperimentService + { + Experiment Create(Experiment experiment); + public Experiment Get(string id); + public List GetMyExperiments(string id); + public Experiment Get(string uploaderId, string name); + } +} \ No newline at end of file diff --git a/backend/api/api/Interfaces/IFileService.cs b/backend/api/api/Interfaces/IFileService.cs new file mode 100644 index 00000000..e061dfdb --- /dev/null +++ b/backend/api/api/Interfaces/IFileService.cs @@ -0,0 +1,13 @@ +using api.Models; + +namespace api.Services +{ + public interface IFileService + { + FileModel Create(FileModel file); + string GetFilePath(string id, string uploaderId); + public FileModel getFile(string id); + bool CheckDb(); + string GetFileId(string fullPath); + } +} \ No newline at end of file diff --git a/backend/api/api/Interfaces/IMLWebSocketService.cs b/backend/api/api/Interfaces/IMLWebSocketService.cs new file mode 100644 index 00000000..52efb7fc --- /dev/null +++ b/backend/api/api/Interfaces/IMLWebSocketService.cs @@ -0,0 +1,7 @@ +namespace api.Services +{ + public interface IMLWebSocketService + { + void Send(string message); + } +} diff --git a/backend/api/api/Interfaces/IMlConnectionService.cs b/backend/api/api/Interfaces/IMlConnectionService.cs new file mode 100644 index 00000000..d5dda9f2 --- /dev/null +++ b/backend/api/api/Interfaces/IMlConnectionService.cs @@ -0,0 +1,16 @@ + +using api.Models; + +namespace api.Services +{ + public interface IMlConnectionService + { + Task SendModelAsync(object model, object dataset); + Task PreProcess(Dataset dataset, string filePath,string id); + Task TrainModel(Model model, Experiment experiment, string filePath, Dataset dataset, string id); + + Task Predict(Predictor predictor, Experiment experiment, PredictorColumns[] inputs); + + //Task PreProcess(Dataset dataset, byte[] file, string filename); + } +} \ No newline at end of file diff --git a/backend/api/api/Interfaces/IModelService.cs b/backend/api/api/Interfaces/IModelService.cs new file mode 100644 index 00000000..00299979 --- /dev/null +++ b/backend/api/api/Interfaces/IModelService.cs @@ -0,0 +1,23 @@ +using System; +using api.Models; + +namespace api.Services +{ + public interface IModelService + { + Model GetOneModel(string userId, string name); + Model GetOneModel(string id); + List GetMyModels(string userId); + List GetMyModelsByType(string userId, string problemType); + List GetLatestModels(string userId); + //List GetPublicModels(); + Model Create(Model model); + Model Replace(Model model); + void Update(string userId, string name, Model model); + public void Update(string id, Model model); + void Delete(string userId, string name); + bool CheckHyperparameters(int inputNeurons, int hiddenLayerNeurons, int hiddenLayers, int outputNeurons); + bool CheckDb(); + } +} + diff --git a/backend/api/api/Interfaces/IPredictorService.cs b/backend/api/api/Interfaces/IPredictorService.cs new file mode 100644 index 00000000..16f0432a --- /dev/null +++ b/backend/api/api/Interfaces/IPredictorService.cs @@ -0,0 +1,16 @@ +using api.Models; + +namespace api.Services +{ + public interface IPredictorService + { + Predictor Create(Predictor predictor); + void Delete(string id, string userId); + List GetMyPredictors(string userId); + Predictor GetOnePredictor(string id); + Predictor GetPredictor(string userId, string id); + List GetPublicPredictors(); + List SortPredictors(string userId, bool ascdsc, int latest); + void Update(string id, Predictor predictor); + } +} \ No newline at end of file diff --git a/backend/api/api/Interfaces/IUserService.cs b/backend/api/api/Interfaces/IUserService.cs new file mode 100644 index 00000000..d34d410a --- /dev/null +++ b/backend/api/api/Interfaces/IUserService.cs @@ -0,0 +1,16 @@ +using api.Models; +using Microsoft.AspNetCore.Mvc; + +namespace api.Services +{ + public interface IUserService + { + List Get();// daje sve korisnike + User GetUserUsername(string username); //daje korisnika po korisnickom imenu + User Create(User user); // kreira korisnika + bool Update(string username, User user); //apdejtuje korisnika po idu + void Delete(string username);//brise korisnika + public User GetUserByUsername(string username);//Uzima jednog korisnika po username-u + public User GetUserById(string id);//Uzima jednog korisnika po id-u + } +} diff --git a/backend/api/api/Models/ColumnInfo.cs b/backend/api/api/Models/ColumnInfo.cs index f2cae104..dcf5171c 100644 --- a/backend/api/api/Models/ColumnInfo.cs +++ b/backend/api/api/Models/ColumnInfo.cs @@ -4,7 +4,7 @@ { public ColumnInfo() { } - public ColumnInfo(string columnName, string columnType, bool isNumber, int numNulls, float mean, float min, float max, float median,float q1,float q3, string[] uniqueValues, int[]uniqueValuesCount, float[] uniqueValuesPercent) + public ColumnInfo(string columnName, string columnType, bool isNumber, int numNulls, float mean, float min, float max, float median, string[] uniqueValues, int[]uniqueValuesCount, float[] uniqueValuesPercent, float q1, float q3) { this.columnName = columnName; this.columnType = columnType; @@ -13,12 +13,12 @@ this.mean = mean; this.min = min; this.max = max; - this.q1 = q1; - this.q3 = q3; this.median = median; this.uniqueValues = uniqueValues; this.uniqueValuesPercent = uniqueValuesPercent; this.uniqueValuesCount = uniqueValuesCount; + this.q1 = q1; + this.q3 = q3; } public string columnName { get; set; } @@ -29,13 +29,13 @@ public float min { get; set; } public float max { get; set; } public float median { get; set; } - public float q1 { get; set; } - public float q3 { get; set; } - public string[] uniqueValues { get; set; } public int[] uniqueValuesCount { get; set; } public float[] uniqueValuesPercent { get; set; } + public float q1 { get; set; } + public float q3 { get; set; } + } } diff --git a/backend/api/api/Models/Dataset.cs b/backend/api/api/Models/Dataset.cs index 0faa43d5..6bcb0c16 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 bool hasHeader { get; set; } public ColumnInfo[] columnInfo { get; set; } public int rowCount { get; set; } diff --git a/backend/api/api/Services/FillAnEmptyDb.cs b/backend/api/api/Services/FillAnEmptyDb.cs index 062eada3..7ae70a33 100644 --- a/backend/api/api/Services/FillAnEmptyDb.cs +++ b/backend/api/api/Services/FillAnEmptyDb.cs @@ -55,7 +55,6 @@ namespace api.Services dataset.uploaderId = "000000000000000000000000"; dataset.name = "Titanik dataset"; dataset.description = "Titanik dataset"; - //dataset.header = new string[] { "PassengerId", "Survived", "Pclass", "Name", "Sex", "Age", "SibSp", "Parch", "Ticket", "Fare", "Cabin", "Embarked" }; dataset.fileId = _fileService.GetFileId(fullPath); dataset.extension = ".csv"; dataset.isPublic = true; @@ -63,22 +62,21 @@ namespace api.Services dataset.dateCreated = DateTime.Now; dataset.lastUpdated = DateTime.Now; dataset.delimiter = ""; - dataset.hasHeader = true; dataset.columnInfo = new ColumnInfo[] { }; dataset.columnInfo = new[] { - 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" }), + 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 ), + new ColumnInfo( "Name", "columnType", 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 int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "Sex", "columnType", false, 0, 0, 0, 0, 0, new string[]{ "male", "female" }, new int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "Age", "columnType", true, 177, 29.69911766052246f, 0.41999998688697815f, 80, 28, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "SibSp", "columnType", true, 0, 0.523007869720459f, 0, 8, 0, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "Parch", "columnType", true, 0, 0.3815937042236328f, 0, 6, 0, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "Ticket", "columnType", 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 int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "Fare", "columnType", true, 0, 32.20420837402344f, 0, 512.3292236328125f, 14.45419979095459f, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), + 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 ), }; dataset.rowCount = 891; dataset.nullCols = 3; @@ -179,20 +177,19 @@ namespace api.Services dataset.dateCreated = DateTime.Now; dataset.lastUpdated = DateTime.Now; dataset.delimiter = ""; - 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[]{ }) + new ColumnInfo( "Unnamed: 0", "columnType", true, 0, 26969.5f, 0, 53939, 26969.5f, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "carat", "columnType", true, 0, 0.7979397773742676f, 0.20000000298023224f, 5.010000228881836f, 0.699999988079071f, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "cut", "columnType", false, 0, 0, 0, 0, 0, new string[]{ "Ideal", "Premium", "Very Good", "Good", "Fair" }, new int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "color", "columnType", false, 0, 0, 0, 0, 0, new string[]{"G", "E", "F", "H", "D", "I", "I", "J"}, new int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "clarity", "columnType", false, 0, 0, 0, 0, 0, new string[]{ "SI1", "VS2","SI2", "VS1", "VVS2", "VVS1", "IF", "I1" }, new int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "depth", "columnType", true, 0, 61.74940490722656f, 43, 79, 61.79999923706055f, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "table", "columnType", true, 0, 57.457183837890625f, 43, 95, 57, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "price", "columnType", true, 0, 3932.7998046875f, 326, 18823, 2401, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "x", "columnType", true, 0, 5.731157302856445f, 0, 10.739999771118164f, 5.699999809265137f, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), + 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.rowCount = 53940; dataset.nullCols = 0; @@ -297,14 +294,13 @@ namespace api.Services dataset.dateCreated = DateTime.Now; dataset.lastUpdated = DateTime.Now; dataset.delimiter = ""; - 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" }), + 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 ), + new ColumnInfo( "sepal_width", "columnType", true, 0, 3.053999900817871f, 2, 4.400000095367432f, 3, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), + new ColumnInfo( "petal_length", "columnType", true, 0, 3.758666753768921f, 1, 6.900000095367432f, 4.349999904632568f, new string[]{ }, new int[] {}, new float[] {}, 0.01f,0.1f ), + 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.nullCols = 150; dataset.nullRows = 0; diff --git a/backend/api/api/Services/IAuthService.cs b/backend/api/api/Services/IAuthService.cs deleted file mode 100644 index 9a109208..00000000 --- a/backend/api/api/Services/IAuthService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using api.Models.Users; - -namespace api.Services -{ - public interface IAuthService - { - string Login(AuthRequest user); - string Register(RegisterRequest user); - string RenewToken(string token); - public string GuestToken(); - } -} \ No newline at end of file diff --git a/backend/api/api/Services/IDatasetService.cs b/backend/api/api/Services/IDatasetService.cs deleted file mode 100644 index f493a2ec..00000000 --- a/backend/api/api/Services/IDatasetService.cs +++ /dev/null @@ -1,22 +0,0 @@ - -using api.Models; - -namespace api.Services -{ - public interface IDatasetService - { - Dataset GetOneDataset(string userId, string name); - Dataset GetOneDataset(string id); - List SearchDatasets(string name); - List GetMyDatasets(string userId); - List SortDatasets(string userId, bool ascdsc, int latest); - List GetPublicDatasets(); - Dataset Create(Dataset dataset); - void Update(string userId, string id, Dataset dataset); - void Delete(string userId, string id); - public List GetGuestDatasets(); - public void Update(Dataset dataset); - string GetDatasetId(string fileId); - //bool CheckDb(); - } -} diff --git a/backend/api/api/Services/IExperimentService.cs b/backend/api/api/Services/IExperimentService.cs deleted file mode 100644 index 47c86046..00000000 --- a/backend/api/api/Services/IExperimentService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using api.Models; - -namespace api.Services -{ - public interface IExperimentService - { - Experiment Create(Experiment experiment); - public Experiment Get(string id); - public List GetMyExperiments(string id); - public Experiment Get(string uploaderId, string name); - } -} \ No newline at end of file diff --git a/backend/api/api/Services/IFileService.cs b/backend/api/api/Services/IFileService.cs deleted file mode 100644 index e061dfdb..00000000 --- a/backend/api/api/Services/IFileService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using api.Models; - -namespace api.Services -{ - public interface IFileService - { - FileModel Create(FileModel file); - string GetFilePath(string id, string uploaderId); - public FileModel getFile(string id); - bool CheckDb(); - string GetFileId(string fullPath); - } -} \ No newline at end of file diff --git a/backend/api/api/Services/IMLWebSocketService.cs b/backend/api/api/Services/IMLWebSocketService.cs deleted file mode 100644 index 52efb7fc..00000000 --- a/backend/api/api/Services/IMLWebSocketService.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace api.Services -{ - public interface IMLWebSocketService - { - void Send(string message); - } -} diff --git a/backend/api/api/Services/IMlConnectionService.cs b/backend/api/api/Services/IMlConnectionService.cs deleted file mode 100644 index d5dda9f2..00000000 --- a/backend/api/api/Services/IMlConnectionService.cs +++ /dev/null @@ -1,16 +0,0 @@ - -using api.Models; - -namespace api.Services -{ - public interface IMlConnectionService - { - Task SendModelAsync(object model, object dataset); - Task PreProcess(Dataset dataset, string filePath,string id); - Task TrainModel(Model model, Experiment experiment, string filePath, Dataset dataset, string id); - - Task Predict(Predictor predictor, Experiment experiment, PredictorColumns[] inputs); - - //Task PreProcess(Dataset dataset, byte[] file, string filename); - } -} \ No newline at end of file diff --git a/backend/api/api/Services/IModelService.cs b/backend/api/api/Services/IModelService.cs deleted file mode 100644 index 00299979..00000000 --- a/backend/api/api/Services/IModelService.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using api.Models; - -namespace api.Services -{ - public interface IModelService - { - Model GetOneModel(string userId, string name); - Model GetOneModel(string id); - List GetMyModels(string userId); - List GetMyModelsByType(string userId, string problemType); - List GetLatestModels(string userId); - //List GetPublicModels(); - Model Create(Model model); - Model Replace(Model model); - void Update(string userId, string name, Model model); - public void Update(string id, Model model); - void Delete(string userId, string name); - bool CheckHyperparameters(int inputNeurons, int hiddenLayerNeurons, int hiddenLayers, int outputNeurons); - bool CheckDb(); - } -} - diff --git a/backend/api/api/Services/IPredictorService.cs b/backend/api/api/Services/IPredictorService.cs deleted file mode 100644 index 16f0432a..00000000 --- a/backend/api/api/Services/IPredictorService.cs +++ /dev/null @@ -1,16 +0,0 @@ -using api.Models; - -namespace api.Services -{ - public interface IPredictorService - { - Predictor Create(Predictor predictor); - void Delete(string id, string userId); - List GetMyPredictors(string userId); - Predictor GetOnePredictor(string id); - Predictor GetPredictor(string userId, string id); - List GetPublicPredictors(); - List SortPredictors(string userId, bool ascdsc, int latest); - void Update(string id, Predictor predictor); - } -} \ No newline at end of file diff --git a/backend/api/api/Services/IUserService.cs b/backend/api/api/Services/IUserService.cs deleted file mode 100644 index d34d410a..00000000 --- a/backend/api/api/Services/IUserService.cs +++ /dev/null @@ -1,16 +0,0 @@ -using api.Models; -using Microsoft.AspNetCore.Mvc; - -namespace api.Services -{ - public interface IUserService - { - List Get();// daje sve korisnike - User GetUserUsername(string username); //daje korisnika po korisnickom imenu - User Create(User user); // kreira korisnika - bool Update(string username, User user); //apdejtuje korisnika po idu - void Delete(string username);//brise korisnika - public User GetUserByUsername(string username);//Uzima jednog korisnika po username-u - public User GetUserById(string id);//Uzima jednog korisnika po id-u - } -} -- cgit v1.2.3