---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-95-c7df15bf5f59> in <module>()
----> 1 scores = cross_val_score(clf, X, y, cv=3, scoring='log_loss')
2 print(scores, scores.mean(), scores.std())
/Users/rbussman/anaconda/lib/python2.7/site-packages/sklearn/cross_validation.pyc in cross_val_score(estimator, X, y, scoring, cv, n_jobs, verbose, fit_params, pre_dispatch)
1359 train, test, verbose, None,
1360 fit_params)
-> 1361 for train, test in cv)
1362 return np.array(scores)[:, 0]
1363
/Users/rbussman/anaconda/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.pyc in __call__(self, iterable)
657 self._iterating = True
658 for function, args, kwargs in iterable:
--> 659 self.dispatch(function, args, kwargs)
660
661 if pre_dispatch == "all" or n_jobs == 1:
/Users/rbussman/anaconda/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.pyc in dispatch(self, func, args, kwargs)
404 """
405 if self._pool is None:
--> 406 job = ImmediateApply(func, args, kwargs)
407 index = len(self._jobs)
408 if not _verbosity_filter(index, self.verbose):
/Users/rbussman/anaconda/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.pyc in __init__(self, func, args, kwargs)
138 # Don't delay the application, to avoid keeping the input
139 # arguments in memory
--> 140 self.results = func(*args, **kwargs)
141
142 def get(self):
/Users/rbussman/anaconda/lib/python2.7/site-packages/sklearn/cross_validation.pyc in _fit_and_score(estimator, X, y, scorer, train, test, verbose, parameters, fit_params, return_train_score, return_parameters, error_score)
1476
1477 else:
-> 1478 test_score = _score(estimator, X_test, y_test, scorer)
1479 if return_train_score:
1480 train_score = _score(estimator, X_train, y_train, scorer)
/Users/rbussman/anaconda/lib/python2.7/site-packages/sklearn/cross_validation.pyc in _score(estimator, X_test, y_test, scorer)
1532 score = scorer(estimator, X_test)
1533 else:
-> 1534 score = scorer(estimator, X_test, y_test)
1535 if not isinstance(score, numbers.Number):
1536 raise ValueError("scoring must return a number, got %s (%s) instead."
/Users/rbussman/anaconda/lib/python2.7/site-packages/sklearn/metrics/scorer.pyc in __call__(self, clf, X, y, sample_weight)
121 **self._kwargs)
122 else:
--> 123 return self._sign * self._score_func(y, y_pred, **self._kwargs)
124
125 def _factory_args(self):
/Users/rbussman/anaconda/lib/python2.7/site-packages/sklearn/metrics/classification.pyc in log_loss(y_true, y_pred, eps, normalize, sample_weight)
1406
1407 # Clipping
-> 1408 Y = np.clip(y_pred, eps, 1 - eps)
1409
1410 # This happens in cases when elements in y_pred have type "str".
/Users/rbussman/anaconda/lib/python2.7/site-packages/numpy/core/fromnumeric.pyc in clip(a, a_min, a_max, out)
1625 clip = a.clip
1626 except AttributeError:
-> 1627 return _wrapit(a, 'clip', a_min, a_max, out)
1628 return clip(a_min, a_max, out)
1629
/Users/rbussman/anaconda/lib/python2.7/site-packages/numpy/core/fromnumeric.pyc in _wrapit(obj, method, *args, **kwds)
43 except AttributeError:
44 wrap = None
---> 45 result = getattr(asarray(obj), method)(*args, **kwds)
46 if wrap:
47 if not isinstance(result, mu.ndarray):
/Users/rbussman/anaconda/lib/python2.7/site-packages/numpy/core/numeric.pyc in asarray(a, dtype, order)
460
461 """
--> 462 return array(a, dtype, copy=False, order=order)
463
464 def asanyarray(a, dtype=None, order=None):
ValueError: could not broadcast input array from shape (888,2) into shape (888)