From 1a5b548e3ec4385e6f6369c448bed16413261364 Mon Sep 17 00:00:00 2001 From: Frank Blanning Date: Sun, 6 Jan 2019 12:47:56 +0200 Subject: [PATCH] avoid sklern.scale() error for converting float32 to float64 --- classifier/preprocessing/data_preprocessing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classifier/preprocessing/data_preprocessing.py b/classifier/preprocessing/data_preprocessing.py index cbd6344..5fa9541 100644 --- a/classifier/preprocessing/data_preprocessing.py +++ b/classifier/preprocessing/data_preprocessing.py @@ -68,7 +68,7 @@ def standardization(dataset): print(bcolors.YELLOW + 'Running standardization' + bcolors.ENDC) # Standardization - scaledDataset = preprocessing.scale(dataset) + scaledDataset = preprocessing.scale(np.float64(dataset)) return scaledDataset @@ -95,4 +95,4 @@ if __name__ == "__main__": print(bcolors.GREEN + 'Saving scaled results to file' + bcolors.ENDC) datasetFrame = pd.DataFrame(scaledDataset, columns = featureKeys) datasetFrame = datasetFrame.assign(target=target) - datasetFrame.to_pickle("./dataset.pkl") \ No newline at end of file + datasetFrame.to_pickle("./dataset.pkl")