How to use the catboost.python-package.catboost.eval._fold_storage._FoldFile function in catboost

To help you get started, we’ve selected a few catboost examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github catboost / catboost / catboost / python-package / catboost / eval / _fold_storage.py View on Github external
def remove_dir():
        """
        Remove default directory for folds if there're no files nut models. In other way it raises warning.

        Args:
            :return: Nothing.

        """
        try:
            if os.path.exists(_FoldFile.default_dir):
                os.rmdir(_FoldFile.default_dir)
        except OSError as err:
            get_eval_logger().warning(err.message)
github catboost / catboost / catboost / python-package / catboost / eval / _fold_storage.py View on Github external
def __init__(self, fold, storage_name, sep, column_description):
        super(_FoldFile, self).__init__(
            fold, storage_name,
            sep=sep, column_description=column_description
        )
        self._file_path = os.path.join(self.default_dir,
                                       storage_name)
        self._prepare_path()
        self._lines = []
        self._file = None
github catboost / catboost / catboost / python-package / catboost / eval / _splitter.py View on Github external
def create_fold(self, fold_set, name, id):
        file_name = self.create_name_from_id(name, id)
        fold_file = _FoldFile(fold_set,
                              file_name,
                              sep=self._line_reader.get_separator(),
                              column_description=self._column_description)
        self._folds_storage.add(fold_file)
        return fold_file