Loading ml.py +16 −16 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ sgd = None nn = None tree = None def getPerformanceMetrics(y_actual, y_pred): def getPerformanceMetrics(): if len(X) == 0: preprocessing() Loading Loading @@ -268,8 +268,8 @@ def partialFitNewData(message, label): def switchCurrentAlgorithm(): pass def getPerformanceMetrics(): pass # def getPerformanceMetrics(): # pass def getSampleMessages(): pass No newline at end of file server.py +21 −2 Original line number Diff line number Diff line Loading @@ -56,8 +56,25 @@ def getTopAlgorithms(): # recall = ["1", "2", "3", "4", "5"] # accuracy = ["1", "2", "3", "4", "5"] name = "Perceptron", "Stochastic Gradient Descent", "Neural Network", "Decision Tree" accuracy, precision, recall, f1 = ml.getPerformanceMetrics() name = ["Perceptron", "Stochastic Gradient Descent", "Neural Network", "Decision Tree"] # accuracy, precision, recall, f1 = ml.getPerformanceMetrics() result = ml.getPerformanceMetrics() print(result) accuracy = result[0] precision = result[1] recall = result[2] f1 = result[3] # print(accuracy) # print(precision) # print(recall) # print(f1) # name = "test" # f1 = "test" # precision = "test" # recall = "test" # accuracy = "test" val = { "name": name, Loading @@ -66,6 +83,8 @@ def getTopAlgorithms(): "recall": recall, "accuracy": accuracy } return val # TODO make this get the actual top feature words Loading web/js/main.js +0 −2 Original line number Diff line number Diff line Loading @@ -93,10 +93,8 @@ function getTopAlgorithms() { var replyObj var http = new XMLHttpRequest(); http.open("GET", url + endpoint, true); http.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); http.onreadystatechange = function () { var DONE = 4; // 4 means that the request is done var OK = 200; // 200 means a successful return Loading Loading
ml.py +16 −16 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ sgd = None nn = None tree = None def getPerformanceMetrics(y_actual, y_pred): def getPerformanceMetrics(): if len(X) == 0: preprocessing() Loading Loading @@ -268,8 +268,8 @@ def partialFitNewData(message, label): def switchCurrentAlgorithm(): pass def getPerformanceMetrics(): pass # def getPerformanceMetrics(): # pass def getSampleMessages(): pass No newline at end of file
server.py +21 −2 Original line number Diff line number Diff line Loading @@ -56,8 +56,25 @@ def getTopAlgorithms(): # recall = ["1", "2", "3", "4", "5"] # accuracy = ["1", "2", "3", "4", "5"] name = "Perceptron", "Stochastic Gradient Descent", "Neural Network", "Decision Tree" accuracy, precision, recall, f1 = ml.getPerformanceMetrics() name = ["Perceptron", "Stochastic Gradient Descent", "Neural Network", "Decision Tree"] # accuracy, precision, recall, f1 = ml.getPerformanceMetrics() result = ml.getPerformanceMetrics() print(result) accuracy = result[0] precision = result[1] recall = result[2] f1 = result[3] # print(accuracy) # print(precision) # print(recall) # print(f1) # name = "test" # f1 = "test" # precision = "test" # recall = "test" # accuracy = "test" val = { "name": name, Loading @@ -66,6 +83,8 @@ def getTopAlgorithms(): "recall": recall, "accuracy": accuracy } return val # TODO make this get the actual top feature words Loading
web/js/main.js +0 −2 Original line number Diff line number Diff line Loading @@ -93,10 +93,8 @@ function getTopAlgorithms() { var replyObj var http = new XMLHttpRequest(); http.open("GET", url + endpoint, true); http.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); http.onreadystatechange = function () { var DONE = 4; // 4 means that the request is done var OK = 200; // 200 means a successful return Loading