Skip to content

Instantly share code, notes, and snippets.

@lethalbrains
Last active August 8, 2018 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lethalbrains/3d35e3d9d23191bae29cf788a110637f to your computer and use it in GitHub Desktop.
Save lethalbrains/3d35e3d9d23191bae29cf788a110637f to your computer and use it in GitHub Desktop.
def __find_best_split(self):
best_split = {}
for col in self.independent:
information_gain, split = self.__find_best_split_for_column(col)
if split is None: continue
if not best_split or best_split["information_gain"] < information_gain:
best_split = {"split": split,
"col": col,
"information_gain": information_gain}
return best_split["split"], best_split["col"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment