Skip to content

Instantly share code, notes, and snippets.

@weilinear
Created October 21, 2012 08:30
Show Gist options
  • Save weilinear/3926327 to your computer and use it in GitHub Desktop.
Save weilinear/3926327 to your computer and use it in GitHub Desktop.
warnings in scikit-learn
import numpy as np
from sklearn.utils import validation
a = np.ones([10,10], dtype=np.uint)
b = np.ones([10,10], dtype=np.uint)
c = np.ones([10,10], dtype=np.int)
d = np.ones([10,10], dtype=np.bool)
validation.warn_if_not_float(a)
validation.warn_if_not_float(b)
validation.warn_if_not_float(c)
validation.warn_if_not_float(d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment