Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Training model...
- Train on 72879 samples, validate on 12861 samples
- Epoch 1/2
- 72879/72879 [==============================] - 6s - loss: 0.5490 - val_loss: 0.5488
- Epoch 2/2
- 72879/72879 [==============================] - 6s - loss: 0.5435 - val_loss: 0.5556
- 28581/28581 [==============================] - 0s
- ---------------------------------------------------------------------------
- ValueError Traceback (most recent call last)
- <ipython-input-19-e5853ce75642> in <module>()
- 26 model.fit(X_train, y_train, nb_epoch=2,batch_size=256,validation_split=0.15)
- 27 y_pre = model.predict_proba(X_valid)
- ---> 28 scores = roc_auc_score(y_valid,y_pre)
- 29 auc_scores.append(scores)
- 30 print (i,scores)
- /home/vriplab5/anaconda2/lib/python2.7/site-packages/sklearn/metrics/ranking.pyc in roc_auc_score(y_true, y_score, average, sample_weight)
- 251 return _average_binary_score(
- 252 _binary_roc_auc_score, y_true, y_score, average,
- --> 253 sample_weight=sample_weight)
- 254
- 255
- /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)
- 77
- 78 if y_type == "binary":
- ---> 79 return binary_metric(y_true, y_score, sample_weight=sample_weight)
- 80
- 81 check_consistent_length(y_true, y_score, sample_weight)
- /home/vriplab5/anaconda2/lib/python2.7/site-packages/sklearn/metrics/ranking.pyc in _binary_roc_auc_score(y_true, y_score, sample_weight)
- 246
- 247 fpr, tpr, tresholds = roc_curve(y_true, y_score,
- --> 248 sample_weight=sample_weight)
- 249 return auc(fpr, tpr, reorder=True)
- 250
- /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)
- 495 """
- 496 fps, tps, thresholds = _binary_clf_curve(
- --> 497 y_true, y_score, pos_label=pos_label, sample_weight=sample_weight)
- 498
- 499 # Attempt to drop thresholds corresponding to points in between and
- /home/vriplab5/anaconda2/lib/python2.7/site-packages/sklearn/metrics/ranking.pyc in _binary_clf_curve(y_true, y_score, pos_label, sample_weight)
- 290 check_consistent_length(y_true, y_score)
- 291 y_true = column_or_1d(y_true)
- --> 292 y_score = column_or_1d(y_score)
- 293 if sample_weight is not None:
- 294 sample_weight = column_or_1d(sample_weight)
- /home/vriplab5/anaconda2/lib/python2.7/site-packages/sklearn/utils/validation.pyc in column_or_1d(y, warn)
- 549 return np.ravel(y)
- 550
- --> 551 raise ValueError("bad input shape {0}".format(shape))
- 552
- 553
- ValueError: bad input shape (28581, 2)
Add Comment
Please, Sign In to add comment