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

Align get_labeled_entries and get_unlabeled_entries #146

Open
J535D165 opened this issue Jun 20, 2018 · 0 comments
Open

Align get_labeled_entries and get_unlabeled_entries #146

J535D165 opened this issue Jun 20, 2018 · 0 comments

Comments

@J535D165
Copy link

J535D165 commented Jun 20, 2018

get_labeled_entries and get_unlabeled_entries are confusing to me. The latter one returns the entry index while get_labeled_entries doesn't. I would be great if get_labeled_entries had the option to return the index.

It's about this piece of code:

    def get_labeled_entries(self):
        """
        Returns list of labeled feature and their label
        Returns
        -------
        labeled_entries : list of (feature, label) tuple
            Labeled entries
        """
        return list(filter(lambda entry: entry[1] is not None, self.data))


    def get_unlabeled_entries(self):
        """
        Returns list of unlabeled features, along with their entry_ids
        Returns
        -------
        unlabeled_entries : list of (entry_id, feature) tuple
            Labeled entries
        """
        return [
            (idx, entry[0]) for idx, entry in enumerate(self.data)
            if entry[1] is None
        ]

Thanks a lot for this lib. It's very useful.

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