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:
I have completed the profiling. The results confirm that the performance bottleneck is within the `multilabel_confusion_matrix` function, which is called by the other metrics. It spends most of its time executing low-level `NumPy` operations like `sort`, `flatten`, and `searchsorted` on the entire dataset.

Here is the profiler output for `num_samples=500`:

```
Total time taken: 75.28 seconds

--- PROFILER RESULTS ---
         16814 function calls (16750 primitive calls) in 75.282 seconds

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

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
       53   33.339    0.629   33.339    0.629 {method 'sort' of 'numpy.ndarray' objects}
       63   12.216    0.194   12.216    0.194 {method 'flatten' of 'numpy.ndarray' objects}
       12   11.987    0.999   11.987    0.999 {method 'searchsorted' of 'numpy.ndarray' objects}
       53    6.334    0.120   48.917    0.923 /usr/local/lib/python3.11/dist-packages/numpy/lib/_arraysetops_impl.py:342(_unique1d)
        4    5.863    1.466   49.250   12.313 /usr/local/lib/python3.11/dist-packages/sklearn/metrics/_classification.py:419(multilabel_confusion_matrix)
       12    3.543    0.295    3.544    0.295 /usr/local/lib/python3.11/dist-packages/sklearn/utils/_array_api.py:1088(_bincount)
        8    1.484    0.185    1.484    0.185 {method 'astype' of 'numpy.ndarray' objects}
        1    0.260    0.260    4.800    4.800 /usr/local/lib/python3.11/dist-packages/sklearn/metrics/_classification.py:155(accuracy_score)
       80    0.113    0.001    0.113    0.001 {method 'reduce' of 'numpy.ufunc' objects}
       53    0.068    0.001   48.985    0.924 /usr/local/lib/python3.11/dist-packages/numpy/lib/_arraysetops_impl.py:144(unique)
     13/5    0.027    0.002   72.292   14.458 /usr/local/lib/python3.11/dist-packages/sklearn/utils/_param_validation.py:185(wrapper)
        1    0.015    0.015   75.282   75.282 /tmp/ipython-input-2-905007606.py:18(calculate_all_metrics)
       65    0.002    0.000    0.002    0.000 {built-in method numpy.empty}
       98    0.002    0.000    1.490    0.015 /usr/local/lib/python3.11/dist-packages/sklearn/utils/validation.py:736(check_array)
     1757    0.001    0.000    0.002    0.000 {built-in method builtins.hasattr}
```

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