aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/api/api/Controllers/FileController.cs9
-rw-r--r--backend/api/api/Interfaces/IAuthService.cs (renamed from backend/api/api/Services/IAuthService.cs)0
-rw-r--r--backend/api/api/Interfaces/IDatasetService.cs (renamed from backend/api/api/Services/IDatasetService.cs)0
-rw-r--r--backend/api/api/Interfaces/IExperimentService.cs (renamed from backend/api/api/Services/IExperimentService.cs)0
-rw-r--r--backend/api/api/Interfaces/IFileService.cs (renamed from backend/api/api/Services/IFileService.cs)0
-rw-r--r--backend/api/api/Interfaces/IMLWebSocketService.cs (renamed from backend/api/api/Services/IMLWebSocketService.cs)0
-rw-r--r--backend/api/api/Interfaces/IMlConnectionService.cs (renamed from backend/api/api/Services/IMlConnectionService.cs)0
-rw-r--r--backend/api/api/Interfaces/IModelService.cs (renamed from backend/api/api/Services/IModelService.cs)0
-rw-r--r--backend/api/api/Interfaces/IPredictorService.cs (renamed from backend/api/api/Services/IPredictorService.cs)0
-rw-r--r--backend/api/api/Interfaces/IUserService.cs (renamed from backend/api/api/Services/IUserService.cs)0
-rw-r--r--backend/api/api/Models/ColumnInfo.cs12
-rw-r--r--backend/api/api/Models/Dataset.cs2
-rw-r--r--backend/api/api/Services/FillAnEmptyDb.cs48
13 files changed, 56 insertions, 15 deletions
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<string> CsvRead(bool hasHeader, string fileId, int skipRows = 0, int takeRows = 10)
+ public ActionResult<string> 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/Services/IAuthService.cs b/backend/api/api/Interfaces/IAuthService.cs
index 9a109208..9a109208 100644
--- a/backend/api/api/Services/IAuthService.cs
+++ b/backend/api/api/Interfaces/IAuthService.cs
diff --git a/backend/api/api/Services/IDatasetService.cs b/backend/api/api/Interfaces/IDatasetService.cs
index f493a2ec..f493a2ec 100644
--- a/backend/api/api/Services/IDatasetService.cs
+++ b/backend/api/api/Interfaces/IDatasetService.cs
diff --git a/backend/api/api/Services/IExperimentService.cs b/backend/api/api/Interfaces/IExperimentService.cs
index 47c86046..47c86046 100644
--- a/backend/api/api/Services/IExperimentService.cs
+++ b/backend/api/api/Interfaces/IExperimentService.cs
diff --git a/backend/api/api/Services/IFileService.cs b/backend/api/api/Interfaces/IFileService.cs
index e061dfdb..e061dfdb 100644
--- a/backend/api/api/Services/IFileService.cs
+++ b/backend/api/api/Interfaces/IFileService.cs
diff --git a/backend/api/api/Services/IMLWebSocketService.cs b/backend/api/api/Interfaces/IMLWebSocketService.cs
index 52efb7fc..52efb7fc 100644
--- a/backend/api/api/Services/IMLWebSocketService.cs
+++ b/backend/api/api/Interfaces/IMLWebSocketService.cs
diff --git a/backend/api/api/Services/IMlConnectionService.cs b/backend/api/api/Interfaces/IMlConnectionService.cs
index d5dda9f2..d5dda9f2 100644
--- a/backend/api/api/Services/IMlConnectionService.cs
+++ b/backend/api/api/Interfaces/IMlConnectionService.cs
diff --git a/backend/api/api/Services/IModelService.cs b/backend/api/api/Interfaces/IModelService.cs
index 00299979..00299979 100644
--- a/backend/api/api/Services/IModelService.cs
+++ b/backend/api/api/Interfaces/IModelService.cs
diff --git a/backend/api/api/Services/IPredictorService.cs b/backend/api/api/Interfaces/IPredictorService.cs
index 16f0432a..16f0432a 100644
--- a/backend/api/api/Services/IPredictorService.cs
+++ b/backend/api/api/Interfaces/IPredictorService.cs
diff --git a/backend/api/api/Services/IUserService.cs b/backend/api/api/Interfaces/IUserService.cs
index d34d410a..d34d410a 100644
--- a/backend/api/api/Services/IUserService.cs
+++ b/backend/api/api/Interfaces/IUserService.cs
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 a01f3cf7..7acd4382 100644
--- a/backend/api/api/Models/Dataset.cs
+++ b/backend/api/api/Models/Dataset.cs
@@ -22,8 +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; }
public int nullCols { get; set; }
diff --git a/backend/api/api/Services/FillAnEmptyDb.cs b/backend/api/api/Services/FillAnEmptyDb.cs
index b36b31d9..2020d40e 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,10 +62,28 @@ namespace api.Services
dataset.dateCreated = DateTime.Now;
dataset.lastUpdated = DateTime.Now;
dataset.delimiter = "";
+<<<<<<< HEAD
+=======
//dataset.hasHeader = true;
+>>>>>>> f9b96fc9234802ba78a64be094ebc4b4525cde8e
dataset.columnInfo = new ColumnInfo[] { };
/*dataset.columnInfo = new[]
{
+<<<<<<< HEAD
+ 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 ),
+ };
+=======
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[]{ }),
@@ -80,6 +97,7 @@ namespace api.Services
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" }),
};*/
+>>>>>>> f9b96fc9234802ba78a64be094ebc4b4525cde8e
dataset.rowCount = 891;
dataset.nullCols = 3;
dataset.nullRows = 708;
@@ -179,6 +197,22 @@ namespace api.Services
dataset.dateCreated = DateTime.Now;
dataset.lastUpdated = DateTime.Now;
dataset.delimiter = "";
+<<<<<<< HEAD
+ dataset.columnInfo = new[]
+ {
+ 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.hasHeader = true;
/*dataset.columnInfo = new[]
{
@@ -194,6 +228,7 @@ namespace api.Services
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[]{ })
};*/
+>>>>>>> f9b96fc9234802ba78a64be094ebc4b4525cde8e
dataset.rowCount = 53940;
dataset.nullCols = 0;
dataset.nullRows = 0;
@@ -297,6 +332,16 @@ namespace api.Services
dataset.dateCreated = DateTime.Now;
dataset.lastUpdated = DateTime.Now;
dataset.delimiter = "";
+<<<<<<< HEAD
+ dataset.columnInfo = new[]
+ {
+ 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.hasHeader = true;
/*dataset.columnInfo = new[]
{
@@ -306,6 +351,7 @@ namespace api.Services
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" }),
};*/
+>>>>>>> f9b96fc9234802ba78a64be094ebc4b4525cde8e
dataset.nullCols = 150;
dataset.nullRows = 0;
dataset.isPreProcess = true;