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

node_stats for nodes with features including string values. #276

Open
parrt opened this issue Mar 2, 2023 · 2 comments
Open

node_stats for nodes with features including string values. #276

parrt opened this issue Mar 2, 2023 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@parrt
Copy link
Owner

parrt commented Mar 2, 2023

When creating a data frame from a numpy, by default it converts all dtypes to object in case it contains different dtypes (float and str in our case)...
https://stackoverflow.com/questions/61346021/create-a-mixed-type-pandas-dataframe-using-an-numpy-array-of-type-object

Solution:

df = pd.DataFrame(self.shadow_tree.X_train, columns=self.shadow_tree.feature_names).convert_dtypes()
return df.iloc[node_samples[node_id]].describe(include='all')
@parrt parrt added the bug Something isn't working label Mar 2, 2023
@tlapusan
Copy link
Collaborator

tlapusan commented Mar 3, 2023

I thought that you already made the fix :D

@parrt
Copy link
Owner Author

parrt commented Mar 3, 2023

hahah. nope was working on the tutorial and now they want a blog post haha

@parrt parrt added this to the 2.2.1 milestone Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants