ZhiningLiu1998 / imbalanced-ensemble

🛠️ Class-imbalanced Ensemble Learning Toolbox. | 类别不平衡/长尾机器学习库
https://imbalanced-ensemble.readthedocs.io
MIT License
326 stars 51 forks source link

Does the model support running on GPU? #30

Closed lizzle-lei closed 1 year ago

lizzle-lei commented 1 year ago

Hello, I must say that IMBENS is an exceptional machine learning library. I am currently utilizing it to handle classification tasks for an extensive dataset. However, it appears that IMBENS lacks support for model migration to the GPU 'SelfPacedEnsembleClassifier' object has no attribute 'to'.

ZhiningLiu1998 commented 1 year ago

Hi Lei, thanks for your interest in this package. Unfortunately, like scikit-learn, IMBENS does not specifically support GPU usage cuz many of the base classifiers lack (or are not able to have) GPU support, e.g., Decision Trees and Native Bayes models.

Despite this, you can use neural nets as the base model of the IMBENS ensembles, as long as you put them into a sklearn-compatible wrapper class. An example of using PyTorch with IMBENS is provided here: https://imbalanced-ensemble.readthedocs.io/en/latest/auto_examples/classification/plot_torch.html#sphx-glr-auto-examples-classification-plot-torch-py.

Hope this helps.