Created
August 8, 2018 09:24
-
-
Save lethalbrains/377362ef7b182c96e189da0662ac23b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def predict(self, data): | |
return np.array([self.__flow_data_thru_tree(row) for _, row in data.iterrows()]) | |
def __flow_data_thru_tree(self, row): | |
if self.is_leaf_node: return self.probability | |
tree = self.left if row[self.split_feature] <= self.criteria else self.right | |
return tree.__flow_data_thru_tree(row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment