Expected type 'Optional[int]', got 'RandomState' instead
jayahm opened this issue · 2 comments
jayahm commented
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
@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
I see. Okay, thanks for the information.