Guest User

Error recieved

a guest
Mar 2nd, 2016
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1.  
  2. Training model...
  3. Train on 72879 samples, validate on 12861 samples
  4. Epoch 1/2
  5. 72879/72879 [==============================] - 6s - loss: 0.5490 - val_loss: 0.5488
  6. Epoch 2/2
  7. 72879/72879 [==============================] - 6s - loss: 0.5435 - val_loss: 0.5556
  8. 28581/28581 [==============================] - 0s
  9.  
  10. ---------------------------------------------------------------------------
  11. ValueError Traceback (most recent call last)
  12. <ipython-input-19-e5853ce75642> in <module>()
  13. 26 model.fit(X_train, y_train, nb_epoch=2,batch_size=256,validation_split=0.15)
  14. 27 y_pre = model.predict_proba(X_valid)
  15. ---> 28 scores = roc_auc_score(y_valid,y_pre)
  16. 29 auc_scores.append(scores)
  17. 30 print (i,scores)
  18.  
  19. /home/vriplab5/anaconda2/lib/python2.7/site-packages/sklearn/metrics/ranking.pyc in roc_auc_score(y_true, y_score, average, sample_weight)
  20. 251 return _average_binary_score(
  21. 252 _binary_roc_auc_score, y_true, y_score, average,
  22. --> 253 sample_weight=sample_weight)
  23. 254
  24. 255
  25.  
  26. /home/vriplab5/anaconda2/lib/python2.7/site-packages/sklearn/metrics/base.pyc in _average_binary_score(binary_metric, y_true, y_score, average, sample_weight)
  27. 77
  28. 78 if y_type == "binary":
  29. ---> 79 return binary_metric(y_true, y_score, sample_weight=sample_weight)
  30. 80
  31. 81 check_consistent_length(y_true, y_score, sample_weight)
  32.  
  33. /home/vriplab5/anaconda2/lib/python2.7/site-packages/sklearn/metrics/ranking.pyc in _binary_roc_auc_score(y_true, y_score, sample_weight)
  34. 246
  35. 247 fpr, tpr, tresholds = roc_curve(y_true, y_score,
  36. --> 248 sample_weight=sample_weight)
  37. 249 return auc(fpr, tpr, reorder=True)
  38. 250
  39.  
  40. /home/vriplab5/anaconda2/lib/python2.7/site-packages/sklearn/metrics/ranking.pyc in roc_curve(y_true, y_score, pos_label, sample_weight, drop_intermediate)
  41. 495 """
  42. 496 fps, tps, thresholds = _binary_clf_curve(
  43. --> 497 y_true, y_score, pos_label=pos_label, sample_weight=sample_weight)
  44. 498
  45. 499 # Attempt to drop thresholds corresponding to points in between and
  46.  
  47. /home/vriplab5/anaconda2/lib/python2.7/site-packages/sklearn/metrics/ranking.pyc in _binary_clf_curve(y_true, y_score, pos_label, sample_weight)
  48. 290 check_consistent_length(y_true, y_score)
  49. 291 y_true = column_or_1d(y_true)
  50. --> 292 y_score = column_or_1d(y_score)
  51. 293 if sample_weight is not None:
  52. 294 sample_weight = column_or_1d(sample_weight)
  53.  
  54. /home/vriplab5/anaconda2/lib/python2.7/site-packages/sklearn/utils/validation.pyc in column_or_1d(y, warn)
  55. 549 return np.ravel(y)
  56. 550
  57. --> 551 raise ValueError("bad input shape {0}".format(shape))
  58. 552
  59. 553
  60.  
  61. ValueError: bad input shape (28581, 2)
Add Comment
Please, Sign In to add comment