You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
np.unique is used for encoding data values to integers. However, numpy currently treats every np.NaN as a unique value, creating many categories. (See: numpy/numpy#2111)
Solution is to check with np.isnan so that we can just ignore all NaNs when encoding. The encoder then simply assigns all NaNs to the -1 (i.e. "I don't know this value") category.
The text was updated successfully, but these errors were encountered:
@nicodv, could you expand on this a bit, or give a code example? How does one "check with np.isnan" when using np.unique? Also, a remark in the documentation of np.unique would be useful.
np.unique
is used for encoding data values to integers. However,numpy
currently treats everynp.NaN
as a unique value, creating many categories. (See: numpy/numpy#2111)Solution is to check with
np.isnan
so that we can just ignore all NaNs when encoding. The encoder then simply assigns all NaNs to the-1
(i.e. "I don't know this value") category.The text was updated successfully, but these errors were encountered: