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

Possible bug in get_query_strategy inside toolbox.py #3

Closed
Arshita27 opened this issue Feb 21, 2019 · 1 comment
Closed

Possible bug in get_query_strategy inside toolbox.py #3

Arshita27 opened this issue Feb 21, 2019 · 1 comment

Comments

@Arshita27
Copy link

ALiPy/alipy/toolbox.py

Lines 402 to 409 in 71d716d

if kwargs.pop('train_idx', None) is None:
raise ValueError(
"Missing necessary parameter 'train_idx' in GraphDensity or QUIRE method.")
if strategy_name == 'QueryInstanceGraphDensity':
query_function = QueryInstanceGraphDensity(self._X,
self._y,
train_idx=kwargs.pop(
'train_idx'))

When I tried to run ''QueryInstanceGraphDensity' it gave me an error: "Missing key 'train_idx' ", even when I was providing this key.

One possible bug could be that in line 402, kwargs.pop('train_idx', None) is being called which removes the train_idx key from the dictionary. Thus when it is called again in line 408, it gives an error as the key is no longer present due to the previous 'pop' statement.

Do let me know if I am missing out anything.

@NUAA-AL
Copy link
Owner

NUAA-AL commented Feb 21, 2019

Hi,

Thank you for your reporting, and we will fix this problem in the next release which will be published recently.
For now, please import the 'QueryInstanceGraphDensity' strategy independently for using it.
Here is an example:

from alipy.query_strategy.query_labels import QueryInstanceGraphDensity
density_strategy = QueryInstanceGraphDensity(X, y ,train_idx)

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

3 participants