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
Oh no, I was taking a quick look now, and you have fallen on the one case that we sort of decided to ignore, that of flexible types. We did this mainly for two reason: we didn't think anyone used those and we didn't really know how we could handle _meta for those.
This case in particular can be easily fixed (I'll send a PR soon), but I assume you're going to do something more complex than that to your data, which may then not be easily fixable.
Given this is the first use case we've encountered since we decided to just ignore it, would you mind elaborating on how important is the use of flexible types (for completeness, those are basically strings and bytes) for you?
As for how much weight to put on that use case... I'm not really sure. I'd say relatively low. In my experience I'm rarely working with just text data, and so I'm using a dataframe rather than an array (which takes a different code path in dask-ml).
Great, thanks for the details @TomAugspurger, I'll send a PR with the fix, it isn't anything difficult to get working. So maybe this is one of the relatively rare cases. :)
@pentschev, do you know how text data was handled before _meta? I'm curious if with text data we can use whatever old code path was there. Maybe it didn't track things like '<U1' vs. '<U2', but it did track a type of np.unicode_. Apologies if this question is naive, you know more about how _meta handles these things and what code it replaced than I. 🙂
Previously, it tracked things like '<U1' via dtype, so that was all of the array's knowledge of the flexible type. Eventually all the computations would be done and the dtype updated, but now we don't have a separate dtype anymore, it's inferred from _meta and this is why we have no actual length anymore. I'm not sure whether this answers your question entirely, let me know if it doesn't.
Activity
TomAugspurger commentedon Jun 10, 2019
Bisected to #4543 (cc @pentschev if you have a chance to look)
pentschev commentedon Jun 10, 2019
When I saw the title, I immediately thought it would be there. Thanks for the report @TomAugspurger, will take a look.
pentschev commentedon Jun 10, 2019
Oh no, I was taking a quick look now, and you have fallen on the one case that we sort of decided to ignore, that of flexible types. We did this mainly for two reason: we didn't think anyone used those and we didn't really know how we could handle
_metafor those.This case in particular can be easily fixed (I'll send a PR soon), but I assume you're going to do something more complex than that to your data, which may then not be easily fixable.
Given this is the first use case we've encountered since we decided to just ignore it, would you mind elaborating on how important is the use of flexible types (for completeness, those are basically
strings andbytes) for you?cc @jakirkham @mrocklin
TomAugspurger commentedon Jun 10, 2019
The context is dask_ml's OneHotEncoder, which transforms an array like
to
see https://ml.dask.org/preprocessing.html#dask-ml-s-sparse-support
As for how much weight to put on that use case... I'm not really sure. I'd say relatively low. In my experience I'm rarely working with just text data, and so I'm using a dataframe rather than an array (which takes a different code path in dask-ml).
pentschev commentedon Jun 10, 2019
Great, thanks for the details @TomAugspurger, I'll send a PR with the fix, it isn't anything difficult to get working. So maybe this is one of the relatively rare cases. :)
jakirkham commentedon Jun 10, 2019
@pentschev, do you know how text data was handled before
_meta? I'm curious if with text data we can use whatever old code path was there. Maybe it didn't track things like'<U1'vs.'<U2', but it did track a type ofnp.unicode_. Apologies if this question is naive, you know more about how_metahandles these things and what code it replaced than I. 🙂pentschev commentedon Jun 10, 2019
Previously, it tracked things like
'<U1'viadtype, so that was all of the array's knowledge of the flexible type. Eventually all the computations would be done and thedtypeupdated, but now we don't have a separatedtypeanymore, it's inferred from_metaand this is why we have no actual length anymore. I'm not sure whether this answers your question entirely, let me know if it doesn't.