How to use the kaggler.online_model.classification_tree.ClassificationTree function in Kaggler

To help you get started, we’ve selected a few Kaggler 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 jeongyoonlee / Kaggler / kaggler / online_model / classification_tree.py View on Github external
def _apply_best_split(self):
        best_split, best_split_score = self._find_best_split()
        if best_split_score > 0:
            self.criterion = lambda x: x[best_split['feature']] \
                             > best_split['value']
            # create the left child
            self.left = ClassificationTree(
                number_of_features=self.number_of_features,
                number_of_functions=self.number_of_functions,
                min_sample_split=self.min_sample_split,
                predict_initialize={
                    'count_dict': count_dict(best_split['left']),
                }
            )
            # create the right child
            self.right = ClassificationTree(
                number_of_features=self.number_of_features,
                number_of_functions=self.number_of_functions,
                min_sample_split=self.min_sample_split,
                predict_initialize={
                    'count_dict': count_dict(best_split['right']),
                }
            )
            # Collect garbage
            self.samples = {}
            self.Y = []
github jeongyoonlee / Kaggler / kaggler / online_model / classification_tree.py View on Github external
def _apply_best_split(self):
        best_split, best_split_score = self._find_best_split()
        if best_split_score > 0:
            self.criterion = lambda x: x[best_split['feature']] \
                             > best_split['value']
            # create the left child
            self.left = ClassificationTree(
                number_of_features=self.number_of_features,
                number_of_functions=self.number_of_functions,
                min_sample_split=self.min_sample_split,
                predict_initialize={
                    'count_dict': count_dict(best_split['left']),
                }
            )
            # create the right child
            self.right = ClassificationTree(
                number_of_features=self.number_of_features,
                number_of_functions=self.number_of_functions,
                min_sample_split=self.min_sample_split,
                predict_initialize={
                    'count_dict': count_dict(best_split['right']),
                }
            )