{
  "id": 118006,
  "title": "K-Fold predicting with single model",
  "url": "/competitions/understanding_cloud_organization/discussion/118006",
  "author_name": "",
  "post_date": "2019-11-19T06:24:40.600887800Z",
  "votes": 3,
  "comment_count": 1,
  "views": 0,
  "content": "<p>I saw that a lot of people are making predictions on folds with single models. \nAm I understand right that they are splitting data into folds, then training model on each of them and then making prediction for test with each model (trained on each fold)? And averaging them? Like this:</p>\n\n<p>```\nfold_preds = []</p>\n\n<p>for fold in folds:\n    model.train(fold)\n    fold_preds.append(model.predict(test))</p>\n\n<p>test_pred = fold_preds.mean()\n```</p>\n\n<p>If I misunderstood something, then can you please explain? This is a pretty interesting and important point.</p>",
  "messages": [
    {
      "id": "676407",
      "postDate": "11/19/2019 06:24:40",
      "content": "<p>I saw that a lot of people are making predictions on folds with single models. \nAm I understand right that they are splitting data into folds, then training model on each of them and then making prediction for test with each model (trained on each fold)? And averaging them? Like this:</p>\n\n<p>```\nfold_preds = []</p>\n\n<p>for fold in folds:\n    model.train(fold)\n    fold_preds.append(model.predict(test))</p>\n\n<p>test_pred = fold_preds.mean()\n```</p>\n\n<p>If I misunderstood something, then can you please explain? This is a pretty interesting and important point.</p>",
      "rawMarkdown": "I saw that a lot of people are making predictions on folds with single models. \nAm I understand right that they are splitting data into folds, then training model on each of them and then making prediction for test with each model (trained on each fold)? And averaging them? Like this:\n\n```\nfold_preds = []\n\nfor fold in folds:\n    model.train(fold)\n    fold_preds.append(model.predict(test))\n\ntest_pred = fold_preds.mean()\n```\n\nIf I misunderstood something, then can you please explain? This is a pretty interesting and important point.",
      "votes": null
    },
    {
      "id": "676422",
      "postDate": "11/19/2019 06:58:35",
      "content": "<p>Yes you are right~</p>",
      "rawMarkdown": "Yes you are right~",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 676422,
      "author_name": "joeychuang",
      "author_url": "",
      "post_date": "11/19/2019 06:58:35",
      "content": "<p>Yes you are right~</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "676407": "I saw that a lot of people are making predictions on folds with single models. \nAm I understand right that they are splitting data into folds, then training model on each of them and then making prediction for test with each model (trained on each fold)? And averaging them? Like this:\n\n```\nfold_preds = []\n\nfor fold in folds:\n    model.train(fold)\n    fold_preds.append(model.predict(test))\n\ntest_pred = fold_preds.mean()\n```\n\nIf I misunderstood something, then can you please explain? This is a pretty interesting and important point.",
    "676422": "Yes you are right~"
  },
  "source": "meta"
}