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

Only labeler.get_keys() is sorted in the same order as L_train #79

Open
HiromuHota opened this issue Jul 24, 2020 · 0 comments
Open

Only labeler.get_keys() is sorted in the same order as L_train #79

HiromuHota opened this issue Jul 24, 2020 · 0 comments

Comments

@HiromuHota
Copy link
Contributor

Describe the bug

In the hardware tutorial, a sorted list of LFs is fed into LFAnalytics like below:

from snorkel.labeling import LFAnalysis

# Sort LFs for LFAnalysis because LFAnalysis does not sort LFs,
# while columns of L_train are sorted alphabetically already.
sorted_lfs = sorted(stg_temp_lfs, key=lambda lf: lf.name)

LFAnalysis(L=L_train[0], lfs=sorted_lfs).lf_summary(Y=L_gold_train[0].reshape(-1))

While sorted_lfs is sorted alphabetically case-sensitive, the columns of L_train is sorted alphabetically case-insensitive (subject to the postgres config (https://dba.stackexchange.com/a/131471)).

To Reproduce

N/A.

Expected behavior

LFAnalysis should be fed LFs that is sorted in the same order as L_train, and only labeler.get_keys() is sorted in the same way no matter how Postgres is configured.

Error Logs/Screenshots

N/A.

Environment (please complete the following information):

N/A.

Additional context

This was introduced by #68.

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

No branches or pull requests

1 participant