This is duplicate. Please put it in a function. Also validation should be done in `fit`, not `__init__`.