Loading ml.py +2 −1 Original line number Diff line number Diff line Loading @@ -221,7 +221,8 @@ def makePrediction(message): def mlinit(): pass def partialFitNewData(): # partial fit the new prediction data to each algorithm def partialFitNewData(message, label): pass def switchCurrentAlgorithm(): Loading server.py +3 −2 Original line number Diff line number Diff line Loading @@ -41,9 +41,10 @@ def predict(): @app.route('/correctPrediction', methods=["POST"]) def correctPrediction(): json = request.get_json() # message = json["message"] # label = json["label"] message = json["message"] label = json["label"] print(json) response = {'response': ml.partialFitNewData(message, label)} return json # just for debugging TODO integrate the code with ml.py to get a response # TODO make this get the actual ranking of algorithms Loading Loading
ml.py +2 −1 Original line number Diff line number Diff line Loading @@ -221,7 +221,8 @@ def makePrediction(message): def mlinit(): pass def partialFitNewData(): # partial fit the new prediction data to each algorithm def partialFitNewData(message, label): pass def switchCurrentAlgorithm(): Loading
server.py +3 −2 Original line number Diff line number Diff line Loading @@ -41,9 +41,10 @@ def predict(): @app.route('/correctPrediction', methods=["POST"]) def correctPrediction(): json = request.get_json() # message = json["message"] # label = json["label"] message = json["message"] label = json["label"] print(json) response = {'response': ml.partialFitNewData(message, label)} return json # just for debugging TODO integrate the code with ml.py to get a response # TODO make this get the actual ranking of algorithms Loading