Allow batch based metrics calculation of sklearn.metrics

### Describe the workflow you want to enable

I have a lot of data and need to calculate metrics such as accuracy_score, jaccard_score, f1_score, recall, precision etc.

### Describe your proposed solution

 When I try to calculate these it can literally take days, so i created a small solution which can batch and avg in the end, or for the weighted metrics it can do a weighted avg of each, this accelerated the calculation to just a couple of minutes, because I have a 32 core CPU. I'm willing to contribute with the proper guidance as I'm unfamiliar with the codebase, but I think many people can benefit from this. I'm unsure if there is already a work around of this present in the codebase, but if there is one do let me know, thanks a lot.

### Describe alternatives you've considered, if relevant

_No response_

### Additional context

_No response_

COMMENT:
Thanks for the suggestion!

The earlier profiling I shared was done on  `numpy 2.0.2` and `num_samples = 500`. I have now re run the test on nightly build and `num_samples = 200`, yes you were right `unique1d` no longer calls `sort` on many dtypes and it has significantly improved the `percall` . That being said `.unique_hash`  is  still showing up as the major hotspot in this. Would love to hear your thoughts on whether this is expected  or if there's room for optimization here.


```
--- PROFILER RESULTS ---
         17274 function calls (16990 primitive calls) in 30.862 seconds

   Ordered by: internal time
   List reduced from 303 to 15 due to restriction <15>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
       53   16.079    0.303   16.079    0.303 {built-in method numpy._core._multiarray_umath._unique_hash}
       12    5.025    0.419    5.025    0.419 {method 'searchsorted' of 'numpy.ndarray' objects}
       63    3.865    0.061    3.865    0.061 {method 'flatten' of 'numpy.ndarray' objects}
        4    2.211    0.553   21.151    5.288 /usr/local/lib/python3.11/dist-packages/sklearn/metrics/_classification.py:419(multilabel_confusion_matrix)
        1    1.496    1.496   30.860   30.860 /tmp/ipython-input-1-2880829203.py:8(calculate_all_metrics)
       12    1.256    0.105    1.256    0.105 /usr/local/lib/python3.11/dist-packages/sklearn/utils/_array_api.py:1088(_bincount)
       11    0.766    0.070    0.766    0.070 {method 'astype' of 'numpy.ndarray' objects}
        1    0.082    0.082    1.418    1.418 /usr/local/lib/python3.11/dist-packages/sklearn/metrics/_classification.py:155(accuracy_score)
       81    0.037    0.000    0.037    0.000 {method 'reduce' of 'numpy.ufunc' objects}
     13/5    0.010    0.001   28.198    5.640 /usr/local/lib/python3.11/dist-packages/sklearn/utils/_param_validation.py:185(wrapper)
       53    0.003    0.000    0.003    0.000 {method 'sort' of 'numpy.ndarray' objects}
       53    0.002    0.000   19.059    0.360 /usr/local/lib/python3.11/dist-packages/numpy/lib/_arraysetops_impl.py:348(_unique1d)
        1    0.002    0.002   30.862   30.862 /tmp/ipython-input-1-2880829203.py:1(<cell line: 0>)
       98    0.001    0.000    0.496    0.005 /usr/local/lib/python3.11/dist-packages/sklearn/utils/validation.py:736(check_array)
       12    0.001    0.000    0.003    0.000 /usr/local/lib/python3.11/dist-packages/numpy/lib/_arraysetops_impl.py:909(_in1d)
```

Labels: Performance, help wanted, module:metrics, Needs Investigation