Skip to content

Use unique_vals function #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion decision_tree.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@
"\n",
" for col in range(n_features): # for each feature\n",
"\n",
" values = set([row[col] for row in rows]) # unique values in the column\n",
" values = unique_vals(rows, col) # unique values in the column\n",
"\n",
" for val in values: # for each value\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion decision_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def find_best_split(rows):

for col in range(n_features): # for each feature

values = set([row[col] for row in rows]) # unique values in the column
values = unique_vals(rows, col) # unique values in the column

for val in values: # for each value

Expand Down