// Convert K into a tuple argument if an integer
if isinstance(k, int):
k = (2, k+1)
// Expand k in to the values we will use, capturing exceptions
try:
k = tuple(k)
self.k_values_ = list(range(*k))
except:
raise YellowbrickValueError((
"Specify a range or maximal K value, the value "{}" "
After Change
if isinstance(k, int):
self.k_values_ = list(range(2, k+1))
elif isinstance(k, tuple) and len(k) == 2 and \
all(isinstance(x, (int, np.integer)) for x in k):
self.k_values_ = list(range(*k))
elif isinstance(k, collections.Iterable) and \
all(isinstance(x, (int, np.integer)) for x in k):