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

calculate_enrichment bad attrib #51

Open
dizak opened this issue May 24, 2018 · 3 comments
Open

calculate_enrichment bad attrib #51

dizak opened this issue May 24, 2018 · 3 comments
Assignees
Labels

Comments

@dizak
Copy link
Owner

dizak commented May 24, 2018

7ad31e7

Description

Cannot run stats.calculate_enrichment function.

Steps to reproduce

Pass two dataframes to stats.calculate_enrichment as described by the function __doc__

Expected behavior

stats.calculate_enrichment should return dataframe with enrichment scores.

Actual behavior

stats.calculate_enrichment gives
AttributeError: ("type object 'Columns' has no attribute '_score'", 'occurred at index 0')

@dizak dizak added the bug label May 24, 2018
@dizak
Copy link
Owner Author

dizak commented May 24, 2018

This is probably caused by stats.calculate_enrichment was not updated after the SCORE attrib was moved to dtypes in the Columns class.

stats.calculate_enrichment still reference directly to Columns:

selected_bins[Columns.SCORE] = selected_bins.apply(lambda x: Columns._score(x[Columns.COUNT],
                                                                          len(selected),
                                                                          x[Columns.P]),
                                                    axis=1)

@dizak
Copy link
Owner Author

dizak commented May 24, 2018

This is not true. It cries about score attribute which is logical since this is module-level function. Even the slightly broken indentation seems like there was an accidental autocompletion.

It should probably be:

selected_bins[Columns.SCORE] = selected_bins.apply(lambda x: _score(x[Columns.COUNT],
                                                                        len(selected),
                                                                        x[Columns.P]),
                                                       axis=1)

@dizak dizak self-assigned this Feb 15, 2019
@szymon-kaczanowski
Copy link

Very nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants