From bf43afb8a4d80d80f62866242113d45e0b30788e Mon Sep 17 00:00:00 2001 From: mmichelsonIF Date: Mon, 25 Sep 2017 15:28:52 -0700 Subject: [PATCH] removed unnecessary sub dir --- dsbox/overfitdetector/detector.py | 15 +++++++++++++-- dsbox/overfitdetector/util/__init__.py | 1 - dsbox/overfitdetector/util/utilities.py | 17 ----------------- 3 files changed, 13 insertions(+), 20 deletions(-) delete mode 100644 dsbox/overfitdetector/util/__init__.py delete mode 100644 dsbox/overfitdetector/util/utilities.py diff --git a/dsbox/overfitdetector/detector.py b/dsbox/overfitdetector/detector.py index 500f1e7..4a07d72 100644 --- a/dsbox/overfitdetector/detector.py +++ b/dsbox/overfitdetector/detector.py @@ -19,7 +19,6 @@ this class will assume it is already pre-processed """ -from dsbox.overfitdetector.util.utilities import Utilities import pandas import numpy as np from scipy.stats import chi2_contingency, normaltest @@ -374,7 +373,7 @@ def find_matching_rows(self, row_values, columns, training_data, num_neighbors=1 matches = training_data for (col, val) in zip(col_set, vals_for_col_set): - if Utilities.is_number(val): + if self.is_number(val): lower_bound = float(val) * (1.0 - real_value_extend) upper_bound = float(val)*(1.0 + real_value_extend) matches = matches[matches[col] >= lower_bound] @@ -503,3 +502,15 @@ def counts_to_distribution(self, column_values): distribution.append((colval, float(counts[colval]) / total)) return distribution + + def csv_to_dataframe(self, path_to_csv): + data = pandas.read_csv(path_to_csv) # all read as str + return data + + def is_number(self, s): + # type: (number) -> number + try: + float(s) + return True + except ValueError: + return False diff --git a/dsbox/overfitdetector/util/__init__.py b/dsbox/overfitdetector/util/__init__.py deleted file mode 100644 index 9636c6b..0000000 --- a/dsbox/overfitdetector/util/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Some utilities for this class""" diff --git a/dsbox/overfitdetector/util/utilities.py b/dsbox/overfitdetector/util/utilities.py deleted file mode 100644 index b4409f0..0000000 --- a/dsbox/overfitdetector/util/utilities.py +++ /dev/null @@ -1,17 +0,0 @@ -import pandas as pd - - -class Utilities(object): - - def csv_to_dataframe(self, path_to_csv): - data = pd.read_csv(path_to_csv) # all read as str - return data - - @staticmethod - def is_number(s): - # type: (number) -> number - try: - float(s) - return True - except ValueError: - return False