flennerhag / mlens

ML-Ensemble – high performance ensemble learning
http://ml-ensemble.com
MIT License
843 stars 108 forks source link

Superlearnerl on google colab (python 3.10 or 3.7) #155

Open andresilvapimentel opened 8 months ago

andresilvapimentel commented 8 months ago

I am trying to run Superlearner on google colab (python 3.10 or 3.7), but I am getting an error in the Superlearner import (from mlens.ensemble import SuperLearner). The error is:

from collections import Sequence

ImportError: cannot import name ‘Sequence’ from ‘collections’ (/usr/lib/python3.10/collections/init.py)

Do you know how to solve this issue? Thank you in advance.

andresilvapimentel commented 8 months ago

I found the following: To solve the Python "ImportError: cannot import name 'Sequence' from 'collections'" error: Import the Sequence class from collections. abc , as a change was made in Python 3.10. Update the versions of any modules that have old import statements.

But I did not try it. Could you update this Sequence class from collections. abc , please?

andresilvapimentel commented 8 months ago

Please, see this on: https://github.com/skorch-dev/skorch/issues/895 python3.10 -c "from collections.abc import Sequence"

andresilvapimentel commented 8 months ago

Solved