{
  "id": 12690,
  "title": "Validation Accuracy is 70% ranked 800 in LB",
  "url": "/competitions/datasciencebowl/discussion/12690",
  "author_name": "",
  "post_date": "2015-03-05T10:40:18.500Z",
  "votes": null,
  "comment_count": 13,
  "views": 1557,
  "content": "<p>Hi guys. I just come in this competition recent few days. While I deploy a CNN with Nolearn + Lasagne with a single GPU in some cloud computing platform. I left 10% training data as my validation data using sklearn.train_test_split. And I get my validation accuracy nearly 70% within an hour. However, when I submit my result, my logloss is about 8 ranked 800 in LB. Does anything go wrong? And I guess maybe the row or column mixing problem?</p>\n<p>Any suggestions are welcomed. Thank you !&nbsp;</p>",
  "messages": [
    {
      "id": "65486",
      "postDate": "03/05/2015 10:40:18",
      "content": "<p>Hi guys. I just come in this competition recent few days. While I deploy a CNN with Nolearn + Lasagne with a single GPU in some cloud computing platform. I left 10% training data as my validation data using sklearn.train_test_split. And I get my validation accuracy nearly 70% within an hour. However, when I submit my result, my logloss is about 8 ranked 800 in LB. Does anything go wrong? And I guess maybe the row or column mixing problem?</p>\n<p>Any suggestions are welcomed. Thank you !&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65488",
      "postDate": "03/05/2015 10:59:05",
      "content": "<p>Seems like a bug in your submission file or classification process, a logloss of 8 is very bad, like random. An accuracy of ~70% should get you closer to a logloss of 1.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65489",
      "postDate": "03/05/2015 11:01:16",
      "content": "<p>@npetitclerc, does the row of submission file should be ordered like 1.jpg, 2.jpg, ... ?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65490",
      "postDate": "03/05/2015 11:17:03",
      "content": "<p>Check the order of the columns for the label. I had this problem too, and solved after checking the order of the columns in the submission file</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65491",
      "postDate": "03/05/2015 11:24:55",
      "content": "<p>@ Elena Cuoco, do the column names should comply with the training folder names?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65492",
      "postDate": "03/05/2015 11:33:23",
      "content": "<p>Column names is the same as folder names in train folder. I think that you are mixing columns in submission file (For example in acantharia_protist column you write acantharia_protist_big_center predictions).</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65493",
      "postDate": "03/05/2015 11:40:49",
      "content": "<p>So, row order does not matter?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65494",
      "postDate": "03/05/2015 12:01:54",
      "content": "<p>Row order is irrelevant, as long as you've put the right data next to the right filename on each row.</p>\n<p>I think column order is irrelevant too, as long as the labels in the header are ordered the same as the classes in your data. Can someone confirm? Or does the order have to exactly the same as in the sample submission?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65499",
      "postDate": "03/05/2015 12:22:51",
      "content": "<p>@Nicolay Korslund you are right. Order does not matter until class corresponds to class title.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65500",
      "postDate": "03/05/2015 12:22:52",
      "content": "<p>[quote=PengPai;65491]</p>\n<p>@ Elena Cuoco, do the column names should comply with the training folder names?</p>\n<p>[/quote]</p>\n<p>Yes, the labels correspond to the folder names. So be sure to make label and name ordered in the same way. As other say, row order does not matter.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65504",
      "postDate": "03/05/2015 13:03:10",
      "content": "<p>Hi PengPai</p>\n<p>which cloud service you are using?</p>\n\n<p>is there any tutorial or other resources help learning this method?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65520",
      "postDate": "03/05/2015 15:20:09",
      "content": "<p>Thank you guys. I just re-rank my submissions and get a reasonable LB-rank.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65578",
      "postDate": "03/06/2015 08:54:04",
      "content": "<p>You can use below code for generating your submission.csv</p>\n\n<p>######################################################################<br>#Submission <br>######################################################################</p>\n<p>header = &quot;acantharia_protist_big_center,acantharia_protist_halo,acantharia_protist,amphipods,appendicularian_fritillaridae,appendicularian_s_shape,appendicularian_slight_curve,appendicularian_straight,artifacts_edge,artifacts,chaetognath_non_sagitta,chaetognath_other,chaetognath_sagitta,chordate_type1,copepod_calanoid_eggs,copepod_calanoid_eucalanus,copepod_calanoid_flatheads,copepod_calanoid_frillyAntennae,copepod_calanoid_large_side_antennatucked,copepod_calanoid_large,copepod_calanoid_octomoms,copepod_calanoid_small_longantennae,copepod_calanoid,copepod_cyclopoid_copilia,copepod_cyclopoid_oithona_eggs,copepod_cyclopoid_oithona,copepod_other,crustacean_other,ctenophore_cestid,ctenophore_cydippid_no_tentacles,ctenophore_cydippid_tentacles,ctenophore_lobate,decapods,detritus_blob,detritus_filamentous,detritus_other,diatom_chain_string,diatom_chain_tube,echinoderm_larva_pluteus_brittlestar,echinoderm_larva_pluteus_early,echinoderm_larva_pluteus_typeC,echinoderm_larva_pluteus_urchin,echinoderm_larva_seastar_bipinnaria,echinoderm_larva_seastar_brachiolaria,echinoderm_seacucumber_auricularia_larva,echinopluteus,ephyra,euphausiids_young,euphausiids,fecal_pellet,fish_larvae_deep_body,fish_larvae_leptocephali,fish_larvae_medium_body,fish_larvae_myctophids,fish_larvae_thin_body,fish_larvae_very_thin_body,heteropod,hydromedusae_aglaura,hydromedusae_bell_and_tentacles,hydromedusae_h15,hydromedusae_haliscera_small_sideview,hydromedusae_haliscera,hydromedusae_liriope,hydromedusae_narco_dark,hydromedusae_narco_young,hydromedusae_narcomedusae,hydromedusae_other,hydromedusae_partial_dark,hydromedusae_shapeA_sideview_small,hydromedusae_shapeA,hydromedusae_shapeB,hydromedusae_sideview_big,hydromedusae_solmaris,hydromedusae_solmundella,hydromedusae_typeD_bell_and_tentacles,hydromedusae_typeD,hydromedusae_typeE,hydromedusae_typeF,invertebrate_larvae_other_A,invertebrate_larvae_other_B,jellies_tentacles,polychaete,protist_dark_center,protist_fuzzy_olive,protist_noctiluca,protist_other,protist_star,pteropod_butterfly,pteropod_theco_dev_seq,pteropod_triangle,radiolarian_chain,radiolarian_colony,shrimp_caridean,shrimp_sergestidae,shrimp_zoea,shrimp-like_other,siphonophore_calycophoran_abylidae,siphonophore_calycophoran_rocketship_adult,siphonophore_calycophoran_rocketship_young,siphonophore_calycophoran_sphaeronectes_stem,siphonophore_calycophoran_sphaeronectes_young,siphonophore_calycophoran_sphaeronectes,siphonophore_other_parts,siphonophore_partial,siphonophore_physonect_young,siphonophore_physonect,stomatopod,tornaria_acorn_worm_larvae,trichodesmium_bowtie,trichodesmium_multiple,trichodesmium_puff,trichodesmium_tuft,trochophore_larvae,tunicate_doliolid_nurse,tunicate_doliolid,tunicate_partial,tunicate_salp_chains,tunicate_salp,unknown_blobs_and_smudges,unknown_sticks,unknown_unclassified&quot;.split(',')</p>\n<p>labels = map(lambda s: s.split('/')[-1], namesClasses)</p>\n<p>#get the total test images<br>fnames = glob.glob(os.path.join(&quot;competition_data&quot;, &quot;test&quot;, &quot;*.jpg&quot;))<br>numberofTestImages = len(fnames)</p>\n<p>print(numberofTestImages)</p>\n<p>X_test = np.zeros((numberofTestImages, num_features), dtype=float)</p>\n<p>images = map(lambda fileName: fileName.split('/')[-1], fnames)</p>\n<p>i = 0<br># report progress for each 5% done <br>report = [int((j+1)*numberofTestImages/20.) for j in range(20)]<br>for fileName in fnames:<br> # Read in the images and create the features<br> image = imread(fileName, as_grey=True)<br> (axisratio,orientation,convex_area,extent,fscore) = getFeatures(image)<br> image = resize(image, (maxPixel, maxPixel))</p>\n<p># Store the rescaled image pixels and the axis ratio<br> X_test[i, 0:imageSize] = np.reshape(image, (1, imageSize))<br> X_test[i, imageSize] = axisratio<br> X_test[i, imageSize+1] = orientation<br> X_test[i, imageSize+2] = convex_area<br> X_test[i, imageSize+3] = extent<br> X_test[i, imageSize+4] = fscore</p>\n<p>i += 1<br> if i in report: print np.ceil(i *100.0 / numberofTestImages), &quot;% done&quot;</p>\n<p>y_pred = clf.predict_proba(X_test)</p>\n<p>y_pred.shape</p>\n<p>df = pd.DataFrame(y_pred, columns=labels, index=images)<br>df.index.name = 'image'<br>df = df[header]<br>df.to_csv('competition_data/submission.csv')</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65584",
      "postDate": "03/06/2015 09:57:27",
      "content": "<p>@data-lover, I am using terminal.com. Actually there have been a lot of cloud computing services around. Amazons' are popular as well. For CNN tutorial, check deeplearning.net</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 65488,
      "author_name": "npetitclerc",
      "author_url": "",
      "post_date": "03/05/2015 10:59:05",
      "content": "<p>Seems like a bug in your submission file or classification process, a logloss of 8 is very bad, like random. An accuracy of ~70% should get you closer to a logloss of 1.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65489,
      "author_name": "pengpai",
      "author_url": "",
      "post_date": "03/05/2015 11:01:16",
      "content": "<p>@npetitclerc, does the row of submission file should be ordered like 1.jpg, 2.jpg, ... ?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65490,
      "author_name": "elenacuoco",
      "author_url": "",
      "post_date": "03/05/2015 11:17:03",
      "content": "<p>Check the order of the columns for the label. I had this problem too, and solved after checking the order of the columns in the submission file</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65491,
      "author_name": "pengpai",
      "author_url": "",
      "post_date": "03/05/2015 11:24:55",
      "content": "<p>@ Elena Cuoco, do the column names should comply with the training folder names?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65492,
      "author_name": "pikquu",
      "author_url": "",
      "post_date": "03/05/2015 11:33:23",
      "content": "<p>Column names is the same as folder names in train folder. I think that you are mixing columns in submission file (For example in acantharia_protist column you write acantharia_protist_big_center predictions).</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65493,
      "author_name": "pengpai",
      "author_url": "",
      "post_date": "03/05/2015 11:40:49",
      "content": "<p>So, row order does not matter?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65494,
      "author_name": "nicolaykorslund",
      "author_url": "",
      "post_date": "03/05/2015 12:01:54",
      "content": "<p>Row order is irrelevant, as long as you've put the right data next to the right filename on each row.</p>\n<p>I think column order is irrelevant too, as long as the labels in the header are ordered the same as the classes in your data. Can someone confirm? Or does the order have to exactly the same as in the sample submission?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65499,
      "author_name": "oldufo",
      "author_url": "",
      "post_date": "03/05/2015 12:22:51",
      "content": "<p>@Nicolay Korslund you are right. Order does not matter until class corresponds to class title.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65500,
      "author_name": "elenacuoco",
      "author_url": "",
      "post_date": "03/05/2015 12:22:52",
      "content": "<p>[quote=PengPai;65491]</p>\n<p>@ Elena Cuoco, do the column names should comply with the training folder names?</p>\n<p>[/quote]</p>\n<p>Yes, the labels correspond to the folder names. So be sure to make label and name ordered in the same way. As other say, row order does not matter.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65504,
      "author_name": "",
      "author_url": "",
      "post_date": "03/05/2015 13:03:10",
      "content": "<p>Hi PengPai</p>\n<p>which cloud service you are using?</p>\n\n<p>is there any tutorial or other resources help learning this method?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65520,
      "author_name": "pengpai",
      "author_url": "",
      "post_date": "03/05/2015 15:20:09",
      "content": "<p>Thank you guys. I just re-rank my submissions and get a reasonable LB-rank.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65578,
      "author_name": "saquibkhan",
      "author_url": "",
      "post_date": "03/06/2015 08:54:04",
      "content": "<p>You can use below code for generating your submission.csv</p>\n\n<p>######################################################################<br>#Submission <br>######################################################################</p>\n<p>header = &quot;acantharia_protist_big_center,acantharia_protist_halo,acantharia_protist,amphipods,appendicularian_fritillaridae,appendicularian_s_shape,appendicularian_slight_curve,appendicularian_straight,artifacts_edge,artifacts,chaetognath_non_sagitta,chaetognath_other,chaetognath_sagitta,chordate_type1,copepod_calanoid_eggs,copepod_calanoid_eucalanus,copepod_calanoid_flatheads,copepod_calanoid_frillyAntennae,copepod_calanoid_large_side_antennatucked,copepod_calanoid_large,copepod_calanoid_octomoms,copepod_calanoid_small_longantennae,copepod_calanoid,copepod_cyclopoid_copilia,copepod_cyclopoid_oithona_eggs,copepod_cyclopoid_oithona,copepod_other,crustacean_other,ctenophore_cestid,ctenophore_cydippid_no_tentacles,ctenophore_cydippid_tentacles,ctenophore_lobate,decapods,detritus_blob,detritus_filamentous,detritus_other,diatom_chain_string,diatom_chain_tube,echinoderm_larva_pluteus_brittlestar,echinoderm_larva_pluteus_early,echinoderm_larva_pluteus_typeC,echinoderm_larva_pluteus_urchin,echinoderm_larva_seastar_bipinnaria,echinoderm_larva_seastar_brachiolaria,echinoderm_seacucumber_auricularia_larva,echinopluteus,ephyra,euphausiids_young,euphausiids,fecal_pellet,fish_larvae_deep_body,fish_larvae_leptocephali,fish_larvae_medium_body,fish_larvae_myctophids,fish_larvae_thin_body,fish_larvae_very_thin_body,heteropod,hydromedusae_aglaura,hydromedusae_bell_and_tentacles,hydromedusae_h15,hydromedusae_haliscera_small_sideview,hydromedusae_haliscera,hydromedusae_liriope,hydromedusae_narco_dark,hydromedusae_narco_young,hydromedusae_narcomedusae,hydromedusae_other,hydromedusae_partial_dark,hydromedusae_shapeA_sideview_small,hydromedusae_shapeA,hydromedusae_shapeB,hydromedusae_sideview_big,hydromedusae_solmaris,hydromedusae_solmundella,hydromedusae_typeD_bell_and_tentacles,hydromedusae_typeD,hydromedusae_typeE,hydromedusae_typeF,invertebrate_larvae_other_A,invertebrate_larvae_other_B,jellies_tentacles,polychaete,protist_dark_center,protist_fuzzy_olive,protist_noctiluca,protist_other,protist_star,pteropod_butterfly,pteropod_theco_dev_seq,pteropod_triangle,radiolarian_chain,radiolarian_colony,shrimp_caridean,shrimp_sergestidae,shrimp_zoea,shrimp-like_other,siphonophore_calycophoran_abylidae,siphonophore_calycophoran_rocketship_adult,siphonophore_calycophoran_rocketship_young,siphonophore_calycophoran_sphaeronectes_stem,siphonophore_calycophoran_sphaeronectes_young,siphonophore_calycophoran_sphaeronectes,siphonophore_other_parts,siphonophore_partial,siphonophore_physonect_young,siphonophore_physonect,stomatopod,tornaria_acorn_worm_larvae,trichodesmium_bowtie,trichodesmium_multiple,trichodesmium_puff,trichodesmium_tuft,trochophore_larvae,tunicate_doliolid_nurse,tunicate_doliolid,tunicate_partial,tunicate_salp_chains,tunicate_salp,unknown_blobs_and_smudges,unknown_sticks,unknown_unclassified&quot;.split(',')</p>\n<p>labels = map(lambda s: s.split('/')[-1], namesClasses)</p>\n<p>#get the total test images<br>fnames = glob.glob(os.path.join(&quot;competition_data&quot;, &quot;test&quot;, &quot;*.jpg&quot;))<br>numberofTestImages = len(fnames)</p>\n<p>print(numberofTestImages)</p>\n<p>X_test = np.zeros((numberofTestImages, num_features), dtype=float)</p>\n<p>images = map(lambda fileName: fileName.split('/')[-1], fnames)</p>\n<p>i = 0<br># report progress for each 5% done <br>report = [int((j+1)*numberofTestImages/20.) for j in range(20)]<br>for fileName in fnames:<br> # Read in the images and create the features<br> image = imread(fileName, as_grey=True)<br> (axisratio,orientation,convex_area,extent,fscore) = getFeatures(image)<br> image = resize(image, (maxPixel, maxPixel))</p>\n<p># Store the rescaled image pixels and the axis ratio<br> X_test[i, 0:imageSize] = np.reshape(image, (1, imageSize))<br> X_test[i, imageSize] = axisratio<br> X_test[i, imageSize+1] = orientation<br> X_test[i, imageSize+2] = convex_area<br> X_test[i, imageSize+3] = extent<br> X_test[i, imageSize+4] = fscore</p>\n<p>i += 1<br> if i in report: print np.ceil(i *100.0 / numberofTestImages), &quot;% done&quot;</p>\n<p>y_pred = clf.predict_proba(X_test)</p>\n<p>y_pred.shape</p>\n<p>df = pd.DataFrame(y_pred, columns=labels, index=images)<br>df.index.name = 'image'<br>df = df[header]<br>df.to_csv('competition_data/submission.csv')</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65584,
      "author_name": "pengpai",
      "author_url": "",
      "post_date": "03/06/2015 09:57:27",
      "content": "<p>@data-lover, I am using terminal.com. Actually there have been a lot of cloud computing services around. Amazons' are popular as well. For CNN tutorial, check deeplearning.net</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "65486": "",
    "65488": "",
    "65489": "",
    "65490": "",
    "65491": "",
    "65492": "",
    "65493": "",
    "65494": "",
    "65499": "",
    "65500": "",
    "65504": "",
    "65520": "",
    "65578": "",
    "65584": ""
  },
  "source": "meta"
}