scikit-learn-contrib/DESlib

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

jayahm opened this issue · 2 comments

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?

@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)

I see. Okay, thanks for the information.