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

Diverse Mini-batch Active Learning #134

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

mbrine555
Copy link

@mbrine555 mbrine555 commented Jun 22, 2021

This is a PR that implements a new batch active learning query strategy (as mentioned in #119). Diverse Mini-batch Active Learning attempts to take into account both informativeness and diversity when selecting a batch of new examples to be labeled. It's also worth noting that this involves bumping the required scikit-learn version from 0.18 -> 0.20.

I'm not sure if there's any additional documentation you'd like to have added around this, so just let me know!

Returns:
Indices of the instances from `X` chosen to be labelled
"""
uncertainty = classifier_margin(classifier, X, **uncertainty_measure_kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so you only support margin uncertainty? I would suggest to add the callable as param of the function, and default to classifier_margin.


# Limit data set based on n_instances and filter_param
record_limit = filter_param * n_instances
keep_args = np.argsort(uncertainty_scores)[-record_limit:]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argsort is suboptimal in this case because we only need to partition at the record_limitth instance.
argpartition is better suited for that. it is O(n) as opposed to O(nlog(n)) for argsort. you can use multi_argmax, or shuffled_argmax already implemented in selection.py

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

Successfully merging this pull request may close these issues.

None yet

2 participants