Added some sklearn-style input checking