Exemple #1
0
 def write_dataframe(frame, name, directory=None):
     config = Config()
     if directory is None:
         path = os.path.join(config.artifacts_directory, f"{name}.csv")
     else:
         path = os.path.join(directory, f"{name}.csv")
     frame.to_csv(path, index=False, sep=config.delimiter)
     checksum = DataManager.checksum(path)
     return checksum
Exemple #2
0
    def __init__(self, directory):
        self.config = Config()
        self.logger = Logger(__name__)
        self.logger.info(f"Loading data from {directory}...")
        self.target_column_name = self.config.target_column
        self.feature_column_names = None
        self.is_single_file = self.config.csv_name is not None

        self.raw_data = self.read_all_data(directory)
        if self.raw_data is None: return
        self.logger.info(f"Done read [{len(self.raw_data)}] points.")
Exemple #3
0
    def __init__(self, directory):
        self.config = Config()
        self.logger = Logger(__name__)
        self.logger.info(f"Loading data from {directory}...")
        self.target_column_name = self.config.target_column
        self.feature_column_names = None
        self._label_encoder = self.load_labelencoder()
        self.is_single_file = self.config.csv_name is not None

        self.raw_data = self.read_all_data(directory)
        if self.raw_data is None: return

        nclasses = self.num_classes()
        self.logger.info(
            f"Done read [{len(self.raw_data)}] points with [{nclasses}] classes."
        )

        if nclasses == 1:
            self.logger.info("Data must have at least 2 classes.")
            self.raw_data = None
 def __init__(self, is_infer_only=False):
     self.config = Config()
     self.logger = Logger(__name__)
     self._model = self.load_model()
     self._label_encoder = self.load_labelencoder()
Exemple #5
0
 def __init__(self, name):
     self.config = Config()
     self.logger_name = name
     self.logger = logging.getLogger(name)
     if self.config.is_info or self.config.is_verbose:
         self.logger.setLevel(logging.INFO)