From fe73f9dfd45771564090718f5c54184c916b9470 Mon Sep 17 00:00:00 2001 From: Mukesh A Date: Wed, 17 Jun 2020 01:31:28 +0100 Subject: [PATCH] WIP: updated the app.py with fmlearn class test call --- app.py | 8 ++++++-- src/fmlearn.py | 5 +---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app.py b/app.py index 378f6a6..d31cd50 100644 --- a/app.py +++ b/app.py @@ -40,7 +40,11 @@ def apidescription(): # Run Server if __name__ == '__main__': # app.run() + # NOTE: temp work around so that the server doesn't have to started to test # the FMLearn algo. Need to remove once done with it. - from src.fmlearn import * - print(kmc()) + from src.fmlearn import fmlearn + + fml = fmlearn() + fml._test() + diff --git a/src/fmlearn.py b/src/fmlearn.py index 796321c..2f55e39 100644 --- a/src/fmlearn.py +++ b/src/fmlearn.py @@ -99,9 +99,6 @@ def _test(self, print_details=False): # kneighbors()[0] contains distances to points # kneighbors()[1] contains indcies of nearest points print(model.kneighbors(X_test)[1]) - + print(y_test.to_string(header=False)) print(pd.DataFrame(y_pred).to_string(header=False)) - -if __name__ == "__main__": - kmc()