scikit-learn-contrib / DESlib

A Python library for dynamic classifier and ensemble selection
BSD 3-Clause "New" or "Revised" License
477 stars 106 forks source link

Batch vectorized diversity computations #273

Closed derekahuang closed 1 year ago

derekahuang commented 1 year ago

Opening this PR in response to issue #272

This PR vectorizes diversity.py into a new file diversity_batch.py. All the diversity functions now accept inputs of the form

    y : array of shape (n_samples,):
    y_pred1 : array of shape (n_samples,):
    y_pred2 : array of shape (n_classifiers, n_samples):
Menelau commented 1 year ago

@derekahuang Hello,

I've checked the PR today and it looks good. Just found some small pep8 formatting warnings that I already fixed. So I'm merging the PR.

It would be interesting to update the DS methods that use diversity information (DESKNN and DESClustering) to use the new vectorized functions in another PR now that they are available. Do you think you could contribute to that as well?

derekahuang commented 1 year ago

@Menelau thanks for merging. and yes i can take a look at updating those methods with the new vectorized function