{
  "id": 377324,
  "title": "Candidate rerank model recommends less than 20 aids per session",
  "url": "/competitions/otto-recommender-system/discussion/377324",
  "author_name": "",
  "post_date": "2023-01-10T18:13:13.458245600Z",
  "votes": null,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I've checked submission file from the Candidate rerank model by Chris and I see that some sessions predict &lt; 20 aids. But the code has \"return result + list(top_orders)[:20-len(result)]\" to ensure there're always 20 aids. Anyone can explain this?</p>",
  "messages": [
    {
      "id": "2094376",
      "postDate": "01/10/2023 18:13:13",
      "content": "<p>I've checked submission file from the Candidate rerank model by Chris and I see that some sessions predict &lt; 20 aids. But the code has \"return result + list(top_orders)[:20-len(result)]\" to ensure there're always 20 aids. Anyone can explain this?</p>",
      "rawMarkdown": "I've checked submission file from the Candidate rerank model by Chris and I see that some sessions predict < 20 aids. But the code has \"return result + list(top_orders)[:20-len(result)]\" to ensure there're always 20 aids. Anyone can explain this?",
      "votes": null
    },
    {
      "id": "2094472",
      "postDate": "01/10/2023 19:14:31",
      "content": "<p>I believe the reason is here</p>\n<pre><code># TOP CLICKS AND ORDERS IN TEST\ntop_clicks = test_df.loc[test_df['type']=='clicks','aid'].value_counts().index.values[:20]\ntop_orders = test_df.loc[test_df['type']=='orders','aid'].value_counts().index.values[:20]\n</code></pre>\n<p>These arrays are empty. We need to change to </p>\n<pre><code># TOP CLICKS AND ORDERS IN TEST\ntop_clicks = test_df.loc[test_df['type']==1,'aid'].value_counts().index.values[:20]\ntop_orders = test_df.loc[test_df['type']==2,'aid'].value_counts().index.values[:20]\n</code></pre>",
      "rawMarkdown": "I believe the reason is here\n\n    # TOP CLICKS AND ORDERS IN TEST\n    top_clicks = test_df.loc[test_df['type']=='clicks','aid'].value_counts().index.values[:20]\n    top_orders = test_df.loc[test_df['type']=='orders','aid'].value_counts().index.values[:20]\n\nThese arrays are empty. We need to change to \n\n    # TOP CLICKS AND ORDERS IN TEST\n    top_clicks = test_df.loc[test_df['type']==1,'aid'].value_counts().index.values[:20]\n    top_orders = test_df.loc[test_df['type']==2,'aid'].value_counts().index.values[:20]",
      "votes": null
    },
    {
      "id": "2094914",
      "postDate": "01/11/2023 05:01:42",
      "content": "<p>Thanks a lot for your explanation!</p>",
      "rawMarkdown": "Thanks a lot for your explanation!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2094472,
      "author_name": "cdeotte",
      "author_url": "",
      "post_date": "01/10/2023 19:14:31",
      "content": "<p>I believe the reason is here</p>\n<pre><code># TOP CLICKS AND ORDERS IN TEST\ntop_clicks = test_df.loc[test_df['type']=='clicks','aid'].value_counts().index.values[:20]\ntop_orders = test_df.loc[test_df['type']=='orders','aid'].value_counts().index.values[:20]\n</code></pre>\n<p>These arrays are empty. We need to change to </p>\n<pre><code># TOP CLICKS AND ORDERS IN TEST\ntop_clicks = test_df.loc[test_df['type']==1,'aid'].value_counts().index.values[:20]\ntop_orders = test_df.loc[test_df['type']==2,'aid'].value_counts().index.values[:20]\n</code></pre>",
      "votes": null,
      "replies": [
        {
          "id": 2094914,
          "author_name": "bibanh",
          "author_url": "",
          "post_date": "01/11/2023 05:01:42",
          "content": "<p>Thanks a lot for your explanation!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2094376": "I've checked submission file from the Candidate rerank model by Chris and I see that some sessions predict < 20 aids. But the code has \"return result + list(top_orders)[:20-len(result)]\" to ensure there're always 20 aids. Anyone can explain this?",
    "2094472": "I believe the reason is here\n\n    # TOP CLICKS AND ORDERS IN TEST\n    top_clicks = test_df.loc[test_df['type']=='clicks','aid'].value_counts().index.values[:20]\n    top_orders = test_df.loc[test_df['type']=='orders','aid'].value_counts().index.values[:20]\n\nThese arrays are empty. We need to change to \n\n    # TOP CLICKS AND ORDERS IN TEST\n    top_clicks = test_df.loc[test_df['type']==1,'aid'].value_counts().index.values[:20]\n    top_orders = test_df.loc[test_df['type']==2,'aid'].value_counts().index.values[:20]",
    "2094914": "Thanks a lot for your explanation!"
  },
  "source": "meta"
}