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

Broadcasting error in avg_score #193

Open
shubhamgp47 opened this issue Dec 3, 2024 · 0 comments
Open

Broadcasting error in avg_score #193

shubhamgp47 opened this issue Dec 3, 2024 · 0 comments

Comments

@shubhamgp47
Copy link

I get the following error with avg_score multilabel strategy -

File "C:\Users\localuserSKSG\anaconda3\envs\alenv\lib\site-packages\modAL\models\base.py", line 175, in query
query_result, query_metrics = self.query_strategy( File "C:\Users\localuserSKSG\anaconda3\envs\alenv\lib\site-packages\modAL\multilabel.py",
line 258, in avg_score classwise_scores = classwise_confidence*(classwise_predictions-1/2)
ValueError: operands could not be broadcast together with shapes (26872,2,3) (26872,3)

During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "avg-score.py", line 264, in
query_index, query_instance = learner.query(X_pool_np, n_instances=n_instances)
File "C:\Users\localuserSKSG\anaconda3\envs\alenv\lib\site-packages\modAL\models\base.py", line 180, in query
query_result = self.query_strategy( File "C:\Users\localuserSKSG\anaconda3\envs\alenv\lib\site-packages\modAL\multilabel.py", line 258, in
avg_score classwise_scores = classwise_confidence*(classwise_predictions-1/2) ValueError: operands could not be broadcast together with shapes (26872,2,3) (26872,3)

We do not see this error with avg_confidence. Clearly this is because of these lines of code in avg_score which are not present in avg_confidence-

classwise_predictions = classifier.predict(X_pool)
classwise_scores = classwise_confidence*(classwise_predictions-1/2)

Does anyone has a solution/workaround for this?

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