Skip to content
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

Fix cont_cat_split for multi-label classification #2759

Merged
merged 6 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 fastai/tabular/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def cont_cat_split(df, max_card=20, dep_var=None):
"Helper function that returns column names of cont and cat variables from given `df`."
cont_names, cat_names = [], []
for label in df:
if label == dep_var: continue
if label in list(dep_var): continue
if df[label].dtype == int and df[label].unique().shape[0] > max_card or df[label].dtype == float:
cont_names.append(label)
else: cat_names.append(label)
Expand Down
2 changes: 1 addition & 1 deletion nbs/40_tabular.core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
" \"Helper function that returns column names of cont and cat variables from given `df`.\"\n",
" cont_names, cat_names = [], []\n",
" for label in df:\n",
" if label == dep_var: continue\n",
" if label in list(dep_var): continue\n",
" if df[label].dtype == int and df[label].unique().shape[0] > max_card or df[label].dtype == float:\n",
" cont_names.append(label)\n",
" else: cat_names.append(label)\n",
Expand Down