-
Notifications
You must be signed in to change notification settings - Fork 491
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
hdbscan.HDBSCAN().fit('group') #50
Comments
I'm not sure exactly what you mean. Can you provide some example code of the sort of thing you would like to see? Are you trying to fit multiple different groups from a single dataframe, each group independent of the prior? |
I see what you mean now, and I can definitely see why that might be desirable. I don't have any elegant solutions to offer unfortunately. If you need to fit the groups independently then I think you have to effectively iterate through them in one way or another. That means either a transform as you have, or just iterating through the groups in the groupby and constructing the resulting series. I would lean toward the latter as it is "simpler" and will probably do the job, but obviously the transform will faster. You can access some of the "under the hood" code if you like to make the functions easier.
ought to work, although I admit I haven't tried it. Let me know if that is the sort of thing you had in mind. |
Ah yes, the local variable x which is, of course my fault. This is why I should always test code that I type in. At least I can catch obvious errors. I've updated my comment to fix the obvious error (x should have been series). If we're lucky that might solve the other error too. |
Ah, I see the problem. Sklearn wants 2D arrays, and a Series is 1D. You'll On Wed, Aug 10, 2016 at 10:56 AM, Eric Coker notifications@github.com
|
I think what is needed is something like:
I admit there may still be issues with hdbscan on one-dimensional data, but this should at least format it so that sklearn style APIs will deal with it appropriately. |
I presume this was working now? |
I know that the algorithm will fit very easily using a column from a full pandas dataframe, but is there an elegant solution for 'fitting' across categorical groups, either by using 'groupby.transform' or through iteration?
The text was updated successfully, but these errors were encountered: