scikit-learn-contrib / DESlib

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

Expected type 'Optional[int]', got 'RandomState' instead #228

Closed jayahm closed 3 years ago

jayahm commented 3 years ago

Hi,

I wrote the code in PyCharm, but I got that message from PyCHarm for random_sate. I have set a random state.

See below: https://i.ibb.co/p32HY9Q/Untitled.png

Another thing is that I realized some methods have different results in several runs though I have set random state.

So, I'm wondering if this related the warning from PyCharm?

Menelau commented 3 years ago

@jayahm Yes, this is related to PyCharm. We do not use type hints in the library in order to be compatible with older Python versions. So PyCharm cannot infer the correct type of this input. You can either ignore the warning or instead of passing a RandomState object you can pass an integer instead (the random seed)

jayahm commented 3 years ago

I see. Okay, thanks for the information.