{
  "id": 22075,
  "title": "does neural network work in this competition?",
  "url": "/competitions/facebook-v-predicting-check-ins/discussion/22075",
  "author_name": "",
  "post_date": "2016-07-06T22:48:34.087Z",
  "votes": null,
  "comment_count": 7,
  "views": 552,
  "content": "<p>i have been testing neural network for this problem.  however, i think in each grid, the label category is too large relative to the sample size. so i can only achieve around 0.3 range. anyone has any success on neural network? thank you!</p>",
  "messages": [
    {
      "id": "126163",
      "postDate": "07/06/2016 22:48:34",
      "content": "<p>i have been testing neural network for this problem.  however, i think in each grid, the label category is too large relative to the sample size. so i can only achieve around 0.3 range. anyone has any success on neural network? thank you!</p>",
      "rawMarkdown": "i have been testing neural network for this problem.  however, i think in each grid, the label category is too large relative to the sample size. so i can only achieve around 0.3 range. anyone has any success on neural network? thank you!",
      "votes": null
    },
    {
      "id": "126184",
      "postDate": "07/07/2016 00:44:57",
      "content": "<p>I briefly tested neural networks. I trained a 5-layer fully-connected NN but only obtained a score 0.18 ...\nBased on what I observed from my several trials, I found that using the first 25000000 data for training and the rest for validation, I could not make training loss lower than validation loss ... This indicates that deep neural networks if large enough should have the potential to achieve the best score on this dataset.</p>",
      "rawMarkdown": "I briefly tested neural networks. I trained a 5-layer fully-connected NN but only obtained a score 0.18 ...\r\nBased on what I observed from my several trials, I found that using the first 25000000 data for training and the rest for validation, I could not make training loss lower than validation loss ... This indicates that deep neural networks if large enough should have the potential to achieve the best score on this dataset.",
      "votes": null
    },
    {
      "id": "126201",
      "postDate": "07/07/2016 01:37:36",
      "content": "<p>My NN model using Keras got score 0.58234 on LB.</p>\n\n<p>it is a straightforward model, 20x40 grid, 4-layer, 50% dropout  and following simple features wih sklearn.preprocessing.standardscaler:</p>\n\n<pre><code>x\ny\naccuracy\nhour\nweekday\nday_of_month\n</code></pre>\n\n<p>It takes 2 days to get result with titan-X.</p>",
      "rawMarkdown": "My NN model using Keras got score 0.58234 on LB.\r\n\r\nit is a straightforward model, 20x40 grid, 4-layer, 50% dropout  and following simple features wih sklearn.preprocessing.standardscaler:\r\n\r\n    x\r\n    y\r\n    accuracy\r\n    hour\r\n    weekday\r\n    day_of_month\r\n\r\nIt takes 2 days to get result with titan-X.",
      "votes": null
    },
    {
      "id": "126203",
      "postDate": "07/07/2016 01:40:33",
      "content": "<p>I tried NN at very early stage of the competition, but abandoned it because it was way too slow on my laptop, compared to other methods like random forest, extra trees, and of course knn. The score from my NN model was about 0.57, which is an okay score at that time. The network structure and parameters were arbitrarily pick. If i had time, I would probably fine tune the parameters and include NN models into the ensemble model.</p>",
      "rawMarkdown": "I tried NN at very early stage of the competition, but abandoned it because it was way too slow on my laptop, compared to other methods like random forest, extra trees, and of course knn. The score from my NN model was about 0.57, which is an okay score at that time. The network structure and parameters were arbitrarily pick. If i had time, I would probably fine tune the parameters and include NN models into the ensemble model.",
      "votes": null
    },
    {
      "id": "126204",
      "postDate": "07/07/2016 01:55:01",
      "content": "<p>I'm a little surprised that you all used grid-based approach. I acutually trained on the whole training set (excluding validation set) only one NN model, as I believe NNs are the few strong models that could scale well with such an enormous amount of data and classes. May be I went the wrong direction ...</p>",
      "rawMarkdown": "I'm a little surprised that you all used grid-based approach. I acutually trained on the whole training set (excluding validation set) only one NN model, as I believe NNs are the few strong models that could scale well with such an enormous amount of data and classes. May be I went the wrong direction ...",
      "votes": null
    },
    {
      "id": "126205",
      "postDate": "07/07/2016 01:56:01",
      "content": "<p>@ Guanshuo Xu  thanks for sharing. </p>\n\n<p>@cute do you have drop out after each layer? how many epochs do you run? if you do not mind, how many nodes at each layer? i have been trying hard on this and impressed by your result. also, congrats on a top 10 finish</p>\n\n<p>@Leon do you mind sharing with me the structure of your NN? like layers and nodes at each grid? i am really curious to know how to get 0.57. thanks</p>",
      "rawMarkdown": "Guanshuo Xu  thanks for sharing. \r\n\r\n@cute do you have drop out after each layer? how many epochs do you run? if you do not mind, how many nodes at each layer? i have been trying hard on this and impressed by your result. also, congrats on a top 10 finish\r\n\r\n@Leon do you mind sharing with me the structure of your NN? like layers and nodes at each grid? i am really curious to know how to get 0.57. thanks",
      "votes": null
    },
    {
      "id": "126210",
      "postDate": "07/07/2016 02:11:10",
      "content": "<p>@Shubin</p>\n\n<p>It has 2 hidden layers, first one with 128 neurons and second one with 512 neurons. Input features are simply &quot;x&quot;, &quot;y&quot;, &quot;accuracy&quot;, &quot;hour of day&quot;, and &quot;day of week&quot;. The hidden layers have batch normalization and dropout.</p>\n\n<p>0.57 was an estimation from my local CV score, which seems to be pretty reliable. It was so slow that I didn't try a full training and testing.</p>",
      "rawMarkdown": "Shubin\r\n\r\nIt has 2 hidden layers, first one with 128 neurons and second one with 512 neurons. Input features are simply \"x\", \"y\", \"accuracy\", \"hour of day\", and \"day of week\". The hidden layers have batch normalization and dropout.\r\n\r\n0.57 was an estimation from my local CV score, which seems to be pretty reliable. It was so slow that I didn't try a full training and testing.",
      "votes": null
    },
    {
      "id": "126213",
      "postDate": "07/07/2016 02:31:23",
      "content": "<p>@Shubin</p>\n\n<p>Thank you.\nYes, drop out after each layer, 90 nb_epoch, 650 hidden_layer(same nodes for each layer).</p>\n\n<p>Following is a portion of the code.</p>\n\n<pre><code>            model = Sequential()\n\n            model.add(Dense(hidden_layer, input_shape=(dimensions,)))\n            model.add(PReLU())\n            model.add(BatchNormalization())\n            model.add(Dropout(dropout))\n\n            model.add(Dense(hidden_layer))\n            model.add(PReLU())\n            model.add(BatchNormalization())\n            model.add(Dropout(dropout))\n\n            model.add(Dense(hidden_layer))\n            model.add(PReLU())\n            model.add(BatchNormalization())\n            model.add(Dropout(dropout))\n\n            model.add(Dense(hidden_layer))\n            model.add(PReLU())\n            model.add(BatchNormalization())\n            model.add(Dropout(dropout))\n\n            model.add(Dense(nb_classes))\n            model.add(Activation('softmax'))\n            model.compile(loss='categorical_crossentropy', optimizer=&quot;adam&quot;)\n            model.fit(X, y, nb_epoch=nb_epoch, batch_size=128)\n            pred = model.predict_proba(X_test)\n</code></pre>",
      "rawMarkdown": "Shubin\r\n\r\nThank you.\r\nYes, drop out after each layer, 90 nb_epoch, 650 hidden_layer(same nodes for each layer).\r\n\r\nFollowing is a portion of the code.\r\n\r\n                model = Sequential()\r\n\r\n                model.add(Dense(hidden_layer, input_shape=(dimensions,)))\r\n                model.add(PReLU())\r\n                model.add(BatchNormalization())\r\n                model.add(Dropout(dropout))\r\n\r\n                model.add(Dense(hidden_layer))\r\n                model.add(PReLU())\r\n                model.add(BatchNormalization())\r\n                model.add(Dropout(dropout))\r\n\r\n                model.add(Dense(hidden_layer))\r\n                model.add(PReLU())\r\n                model.add(BatchNormalization())\r\n                model.add(Dropout(dropout))\r\n\r\n                model.add(Dense(hidden_layer))\r\n                model.add(PReLU())\r\n                model.add(BatchNormalization())\r\n                model.add(Dropout(dropout))\r\n\r\n                model.add(Dense(nb_classes))\r\n                model.add(Activation('softmax'))\r\n                model.compile(loss='categorical_crossentropy', optimizer=\"adam\")\r\n                model.fit(X, y, nb_epoch=nb_epoch, batch_size=128)\r\n                pred = model.predict_proba(X_test)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 126184,
      "author_name": "wowfattie",
      "author_url": "",
      "post_date": "07/07/2016 00:44:57",
      "content": "<p>I briefly tested neural networks. I trained a 5-layer fully-connected NN but only obtained a score 0.18 ...\nBased on what I observed from my several trials, I found that using the first 25000000 data for training and the rest for validation, I could not make training loss lower than validation loss ... This indicates that deep neural networks if large enough should have the potential to achieve the best score on this dataset.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 126201,
      "author_name": "its7171",
      "author_url": "",
      "post_date": "07/07/2016 01:37:36",
      "content": "<p>My NN model using Keras got score 0.58234 on LB.</p>\n\n<p>it is a straightforward model, 20x40 grid, 4-layer, 50% dropout  and following simple features wih sklearn.preprocessing.standardscaler:</p>\n\n<pre><code>x\ny\naccuracy\nhour\nweekday\nday_of_month\n</code></pre>\n\n<p>It takes 2 days to get result with titan-X.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 126203,
      "author_name": "leonlu",
      "author_url": "",
      "post_date": "07/07/2016 01:40:33",
      "content": "<p>I tried NN at very early stage of the competition, but abandoned it because it was way too slow on my laptop, compared to other methods like random forest, extra trees, and of course knn. The score from my NN model was about 0.57, which is an okay score at that time. The network structure and parameters were arbitrarily pick. If i had time, I would probably fine tune the parameters and include NN models into the ensemble model.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 126204,
      "author_name": "wowfattie",
      "author_url": "",
      "post_date": "07/07/2016 01:55:01",
      "content": "<p>I'm a little surprised that you all used grid-based approach. I acutually trained on the whole training set (excluding validation set) only one NN model, as I believe NNs are the few strong models that could scale well with such an enormous amount of data and classes. May be I went the wrong direction ...</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 126205,
      "author_name": "lishubin",
      "author_url": "",
      "post_date": "07/07/2016 01:56:01",
      "content": "<p>@ Guanshuo Xu  thanks for sharing. </p>\n\n<p>@cute do you have drop out after each layer? how many epochs do you run? if you do not mind, how many nodes at each layer? i have been trying hard on this and impressed by your result. also, congrats on a top 10 finish</p>\n\n<p>@Leon do you mind sharing with me the structure of your NN? like layers and nodes at each grid? i am really curious to know how to get 0.57. thanks</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 126210,
      "author_name": "leonlu",
      "author_url": "",
      "post_date": "07/07/2016 02:11:10",
      "content": "<p>@Shubin</p>\n\n<p>It has 2 hidden layers, first one with 128 neurons and second one with 512 neurons. Input features are simply &quot;x&quot;, &quot;y&quot;, &quot;accuracy&quot;, &quot;hour of day&quot;, and &quot;day of week&quot;. The hidden layers have batch normalization and dropout.</p>\n\n<p>0.57 was an estimation from my local CV score, which seems to be pretty reliable. It was so slow that I didn't try a full training and testing.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 126213,
      "author_name": "its7171",
      "author_url": "",
      "post_date": "07/07/2016 02:31:23",
      "content": "<p>@Shubin</p>\n\n<p>Thank you.\nYes, drop out after each layer, 90 nb_epoch, 650 hidden_layer(same nodes for each layer).</p>\n\n<p>Following is a portion of the code.</p>\n\n<pre><code>            model = Sequential()\n\n            model.add(Dense(hidden_layer, input_shape=(dimensions,)))\n            model.add(PReLU())\n            model.add(BatchNormalization())\n            model.add(Dropout(dropout))\n\n            model.add(Dense(hidden_layer))\n            model.add(PReLU())\n            model.add(BatchNormalization())\n            model.add(Dropout(dropout))\n\n            model.add(Dense(hidden_layer))\n            model.add(PReLU())\n            model.add(BatchNormalization())\n            model.add(Dropout(dropout))\n\n            model.add(Dense(hidden_layer))\n            model.add(PReLU())\n            model.add(BatchNormalization())\n            model.add(Dropout(dropout))\n\n            model.add(Dense(nb_classes))\n            model.add(Activation('softmax'))\n            model.compile(loss='categorical_crossentropy', optimizer=&quot;adam&quot;)\n            model.fit(X, y, nb_epoch=nb_epoch, batch_size=128)\n            pred = model.predict_proba(X_test)\n</code></pre>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "126163": "i have been testing neural network for this problem.  however, i think in each grid, the label category is too large relative to the sample size. so i can only achieve around 0.3 range. anyone has any success on neural network? thank you!",
    "126184": "I briefly tested neural networks. I trained a 5-layer fully-connected NN but only obtained a score 0.18 ...\r\nBased on what I observed from my several trials, I found that using the first 25000000 data for training and the rest for validation, I could not make training loss lower than validation loss ... This indicates that deep neural networks if large enough should have the potential to achieve the best score on this dataset.",
    "126201": "My NN model using Keras got score 0.58234 on LB.\r\n\r\nit is a straightforward model, 20x40 grid, 4-layer, 50% dropout  and following simple features wih sklearn.preprocessing.standardscaler:\r\n\r\n    x\r\n    y\r\n    accuracy\r\n    hour\r\n    weekday\r\n    day_of_month\r\n\r\nIt takes 2 days to get result with titan-X.",
    "126203": "I tried NN at very early stage of the competition, but abandoned it because it was way too slow on my laptop, compared to other methods like random forest, extra trees, and of course knn. The score from my NN model was about 0.57, which is an okay score at that time. The network structure and parameters were arbitrarily pick. If i had time, I would probably fine tune the parameters and include NN models into the ensemble model.",
    "126204": "I'm a little surprised that you all used grid-based approach. I acutually trained on the whole training set (excluding validation set) only one NN model, as I believe NNs are the few strong models that could scale well with such an enormous amount of data and classes. May be I went the wrong direction ...",
    "126205": "Guanshuo Xu  thanks for sharing. \r\n\r\n@cute do you have drop out after each layer? how many epochs do you run? if you do not mind, how many nodes at each layer? i have been trying hard on this and impressed by your result. also, congrats on a top 10 finish\r\n\r\n@Leon do you mind sharing with me the structure of your NN? like layers and nodes at each grid? i am really curious to know how to get 0.57. thanks",
    "126210": "Shubin\r\n\r\nIt has 2 hidden layers, first one with 128 neurons and second one with 512 neurons. Input features are simply \"x\", \"y\", \"accuracy\", \"hour of day\", and \"day of week\". The hidden layers have batch normalization and dropout.\r\n\r\n0.57 was an estimation from my local CV score, which seems to be pretty reliable. It was so slow that I didn't try a full training and testing.",
    "126213": "Shubin\r\n\r\nThank you.\r\nYes, drop out after each layer, 90 nb_epoch, 650 hidden_layer(same nodes for each layer).\r\n\r\nFollowing is a portion of the code.\r\n\r\n                model = Sequential()\r\n\r\n                model.add(Dense(hidden_layer, input_shape=(dimensions,)))\r\n                model.add(PReLU())\r\n                model.add(BatchNormalization())\r\n                model.add(Dropout(dropout))\r\n\r\n                model.add(Dense(hidden_layer))\r\n                model.add(PReLU())\r\n                model.add(BatchNormalization())\r\n                model.add(Dropout(dropout))\r\n\r\n                model.add(Dense(hidden_layer))\r\n                model.add(PReLU())\r\n                model.add(BatchNormalization())\r\n                model.add(Dropout(dropout))\r\n\r\n                model.add(Dense(hidden_layer))\r\n                model.add(PReLU())\r\n                model.add(BatchNormalization())\r\n                model.add(Dropout(dropout))\r\n\r\n                model.add(Dense(nb_classes))\r\n                model.add(Activation('softmax'))\r\n                model.compile(loss='categorical_crossentropy', optimizer=\"adam\")\r\n                model.fit(X, y, nb_epoch=nb_epoch, batch_size=128)\r\n                pred = model.predict_proba(X_test)"
  },
  "source": "meta"
}