anu0012 / Amazon-ML-Hiring-Challenge

ML Hiring Challenge 2019
7 stars 6 forks source link

Error during Training #1

Open sachinprabhu007 opened 5 years ago

sachinprabhu007 commented 5 years ago

Hello Anurag,

Thanks for sharing your work. I find the EDA interesting. I came across this error when running the model.

accuracy 0.8454106280193237

ValueError Traceback (most recent call last)

in () 15 16 print('accuracy %s' % accuracy_score(y_pred, y_test)) ---> 17 print(classification_report(y_test, y_pred,target_names=y)) /usr/local/lib/python3.6/dist-packages/sklearn/metrics/classification.py in classification_report(y_true, y_pred, labels, target_names, sample_weight, digits, output_dict) 1874 "Number of classes, {0}, does not match size of " 1875 "target_names, {1}. Try specifying the labels " -> 1876 "parameter".format(len(labels), len(target_names)) 1877 ) 1878 if target_names is None: ValueError: Number of classes, 10, does not match size of target_names, 688. Try specifying the labels parameter

Any help is much appreciated :)

Thanks for your time Sachin

anu0012 commented 5 years ago

Number of classes, 10, does not match the size of target_names, 688

You are providing the wrong number of classes. It should be 10, not 688.