Task02: IndexError

Task02: IndexError  

  By: cdancette on June 19, 2025, 3:44 p.m.

I get the following error on task 2, on the "submissions" page:

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Is there a way to get more details about where this error is occuring ? The format returned by the container seems correct, so I don't know where this is coming from.

Best, Corentin

Re: Task02: IndexError  

  By: fennievandergraaf on June 20, 2025, 11:55 a.m.

Hi,

Thanks for your submission attempts! The ROC line is expecting a 2D array of probabilities (meaning a softmax should have been applied), and it is expecting this as the output is of both classes (malignant and benign). So either this needs to be adapted in the K means clustering adaptor (for which you could make a PR), or you can apply the other adaptors that may be more suited for this task: linear probing, MLP.

There error is occuring at this line: In this line it extracts just the malignancy class probabilities from the 2D array: https://github.com/DIAGNijmegen/unicorn_eval/blob/fde05de5fa76d7536a9987150c2358485f4eb1ed/src/unicorn_eval/utils.py#L399 Here is the full traceback of your error: 2025-06-19T15:22:50.190000+00:00 /home/user/.local/lib/python3.10/site-packages/sksurv/init.py:5: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. 2025-06-19T15:22:50.190000+00:00 from pkg_resources import DistributionNotFound, get_distribution 2025-06-19T15:22:53.192000+00:00 Traceback (most recent call last): 2025-06-19T15:22:53.192000+00:00 File "/home/user/.local/bin/unicorn_eval", line 8, in 2025-06-19T15:22:53.192000+00:00 sys.exit(main()) 2025-06-19T15:22:53.192000+00:00 File "/home/user/.local/lib/python3.10/site-packages/unicorn_eval/evaluate.py", line 651, in main 2025-06-19T15:22:53.192000+00:00 metrics = evaluate_predictions( 2025-06-19T15:22:53.192000+00:00 File "/home/user/.local/lib/python3.10/site-packages/unicorn_eval/utils.py", line 399, in evaluate_predictions 2025-06-19T15:22:53.192000+00:00 malignancy_risk = test_predictions[:,1] 2025-06-19T15:22:53.192000+00:00 IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Let me know if I can help further!

Re: Task02: IndexError  

  By: cdancette on June 20, 2025, 1:39 p.m.

Thanks @fennievandergraaf, I will try the linear probing and MLP adaptors.

But I see that I cannot do another submission using the same container, how should I proceed for this?

I get the message "A submission for this algorithm container image and model for this phase already exists."

Corentin

 Last edited by: cdancette on June 20, 2025, 1:41 p.m., edited 2 times in total.

Re: Task02: IndexError  

  By: cdancette on June 20, 2025, 2:38 p.m.

Also, another question: what are the tasks for which the 1-nn will be compatible? I thought it was for classification tasks.

Re: Task02: IndexError  

  By: clemsg on June 20, 2025, 3:56 p.m.

Hi Corentin,

Great questions!

Indeed you cannot do another submission using the same container. It would be a waste of resources to have to run the same container twice just to change the adaptor. If you want to try different adaptors on top of your algorithm, you can simply reach out to us! You can find more information in this forum post.

Thanks for pointing out the K-Nearest-Neighbor adaptor implementation doesn't handle returning probabilities. We'll deploy a patch soon so that it can return probability estimates. I'll post a new message here when that's done. Stay tuned!

clément

Re: Task02: IndexError  

  By: cdancette on June 23, 2025, 9:22 a.m.

Hi,

I tried "linear-classification" as mentionned in the message

"Current options: "1-nn", "5-nn", "20-nn", "1-nn-weighted", "5-nn-weighted", "20-nn-weighted", "linear-probing", "linear-classification", "mlp"

But I get an error: ValueError: Unknown adaptor: linear-classification.

I will try with linear-probing next, but I think the message should be adapted if linear-classification does not exist

Re: Task02: IndexError  

  By: clemsg on June 23, 2025, 12:25 p.m.

Hi,

The new evaluation docker extending KNN for task 2 is being deployed and should be up on all phases at the end of the day.

Thanks for reporting about linear-classification. We're in touch with Grand Challenge admins to see if it can be removed from the list of adaptors to chose from. linear-probing should be used for linear classification.

Re: Task02: IndexError  

  By: clemsg on June 26, 2025, 10:53 a.m.

Given it cannot be removed, we've simply patched the evaluation code such that when you specify linear-classification, the linear-probing adaptor gets called instead. You can find more details about adaptors on the evaluation repo.

 Last edited by: clemsg on June 26, 2025, 10:54 a.m., edited 1 time in total.