How to use the kaggler.util.gini 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 _calculate_split_score(self, split):
        """Calculate the score of the split.

        score = current_error - after_split_error
        """
        left_error = gini(split['left'])
        right_error = gini(split['right'])
        error = gini(self.Y)
        # if the split is any good, the score should be greater than 0
        total = float(len(self.Y))
        score = (error - 1 / total * (len(split['left']) * left_error +
                                      len(split['right']) * right_error))
        return score
github jeongyoonlee / Kaggler / kaggler / online_model / classification_tree.py View on Github external
def _calculate_split_score(self, split):
        """Calculate the score of the split.

        score = current_error - after_split_error
        """
        left_error = gini(split['left'])
        right_error = gini(split['right'])
        error = gini(self.Y)
        # if the split is any good, the score should be greater than 0
        total = float(len(self.Y))
        score = (error - 1 / total * (len(split['left']) * left_error +
                                      len(split['right']) * right_error))
        return score
github jeongyoonlee / Kaggler / kaggler / online_model / classification_tree.py View on Github external
def _calculate_split_score(self, split):
        """Calculate the score of the split.

        score = current_error - after_split_error
        """
        left_error = gini(split['left'])
        right_error = gini(split['right'])
        error = gini(self.Y)
        # if the split is any good, the score should be greater than 0
        total = float(len(self.Y))
        score = (error - 1 / total * (len(split['left']) * left_error +
                                      len(split['right']) * right_error))
        return score