{
  "id": 293445,
  "title": "Few questions",
  "url": "/competitions/g-research-crypto-forecasting/discussion/293445",
  "author_name": "",
  "post_date": "2021-12-05T21:32:16.416519400Z",
  "votes": 6,
  "comment_count": 1,
  "views": 0,
  "content": "<p>I am starting to understand the competition and I have some doubts. I was reading the forum and looking at the public kernels and I found very interesting insights.</p>\n<p><strong>1.- Metric:</strong> I think that this is the first competition where the metric is not defined by the organizers. In the explanatory notebook made by the organizers they talk about weighted correlation, buy in the given example they make an approximation. I've shown that some people use:</p>\n<pre><code># https://stackoverflow.com/questions/38641691/weighted-correlation-coefficient-with-pandas\ndef wmean(x, w):\n    return np.sum(x * w) / np.sum(w)\n\ndef wcov(x, y, w):\n    return np.sum(w * (x - wmean(x, w)) * (y - wmean(y, w))) / np.sum(w)\n\ndef wcorr(x, y, w):\n    return wcov(x, y, w) / np.sqrt(wcov(x, x, w) * wcov(y, y, w))\n</code></pre>\n<p>Has been confirmed by the organizers?</p>\n<p><strong>2.- Target:</strong> It seems that the definition given by the organizers on how the target is calculated is not very accurate. However there is a <a href=\"https://www.kaggle.com/alexfir/recreating-target\" target=\"_blank\">public kernel</a> with a reconstruction of the target where the metric, target against target_recreated, is around 0.981714. Is not perfect but it is good enough to try to build some features. Is there any improvement?</p>\n<p><strong>3.- VWAP:</strong> I have been looking and I have not found how this \"volume weighted average price\" can be calculated with historical data, or if it is possible. I am not sure if the average is for some minutes (I tried and I have not found the window nor the combination of OHLC) or if it is the weighted average on the current minute and we don't have the data to recreate such price. Is there any clarification on that? or has someone clear how to obtain if from the volume and OHLC prices?</p>\n<p><strong>4.- Public test set:</strong> train set with timestamps&gt;=1623542400. That is 143998 different timestamp's. Correct?</p>\n<p><strong>5.- API:</strong> I have iterated:</p>\n<pre><code>test_all = pd.DataFrame()\n\nfor (test_df, sample_prediction_df) in iter_test:\n    test_all = pd.concat([test_all, test_df], axis=0)\n    print(test_all.shape)\n    sample_prediction_df['Target'] = 0\n    env.predict(sample_prediction_df)\n</code></pre>\n<p>and I obtain 4 different timestamps. Are there more timestamps in the public test set?<br>\nSomeone tried to use lag1 features? Is it possible?</p>\n<p>Thank you all</p>",
  "messages": [
    {
      "id": "1607332",
      "postDate": "12/05/2021 21:32:16",
      "content": "<p>I am starting to understand the competition and I have some doubts. I was reading the forum and looking at the public kernels and I found very interesting insights.</p>\n<p><strong>1.- Metric:</strong> I think that this is the first competition where the metric is not defined by the organizers. In the explanatory notebook made by the organizers they talk about weighted correlation, buy in the given example they make an approximation. I've shown that some people use:</p>\n<pre><code># https://stackoverflow.com/questions/38641691/weighted-correlation-coefficient-with-pandas\ndef wmean(x, w):\n    return np.sum(x * w) / np.sum(w)\n\ndef wcov(x, y, w):\n    return np.sum(w * (x - wmean(x, w)) * (y - wmean(y, w))) / np.sum(w)\n\ndef wcorr(x, y, w):\n    return wcov(x, y, w) / np.sqrt(wcov(x, x, w) * wcov(y, y, w))\n</code></pre>\n<p>Has been confirmed by the organizers?</p>\n<p><strong>2.- Target:</strong> It seems that the definition given by the organizers on how the target is calculated is not very accurate. However there is a <a href=\"https://www.kaggle.com/alexfir/recreating-target\" target=\"_blank\">public kernel</a> with a reconstruction of the target where the metric, target against target_recreated, is around 0.981714. Is not perfect but it is good enough to try to build some features. Is there any improvement?</p>\n<p><strong>3.- VWAP:</strong> I have been looking and I have not found how this \"volume weighted average price\" can be calculated with historical data, or if it is possible. I am not sure if the average is for some minutes (I tried and I have not found the window nor the combination of OHLC) or if it is the weighted average on the current minute and we don't have the data to recreate such price. Is there any clarification on that? or has someone clear how to obtain if from the volume and OHLC prices?</p>\n<p><strong>4.- Public test set:</strong> train set with timestamps&gt;=1623542400. That is 143998 different timestamp's. Correct?</p>\n<p><strong>5.- API:</strong> I have iterated:</p>\n<pre><code>test_all = pd.DataFrame()\n\nfor (test_df, sample_prediction_df) in iter_test:\n    test_all = pd.concat([test_all, test_df], axis=0)\n    print(test_all.shape)\n    sample_prediction_df['Target'] = 0\n    env.predict(sample_prediction_df)\n</code></pre>\n<p>and I obtain 4 different timestamps. Are there more timestamps in the public test set?<br>\nSomeone tried to use lag1 features? Is it possible?</p>\n<p>Thank you all</p>",
      "rawMarkdown": "I am starting to understand the competition and I have some doubts. I was reading the forum and looking at the public kernels and I found very interesting insights.\n\n**1.- Metric:** I think that this is the first competition where the metric is not defined by the organizers. In the explanatory notebook made by the organizers they talk about weighted correlation, buy in the given example they make an approximation. I've shown that some people use:\n```\n# https://stackoverflow.com/questions/38641691/weighted-correlation-coefficient-with-pandas\ndef wmean(x, w):\n    return np.sum(x * w) / np.sum(w)\n\ndef wcov(x, y, w):\n    return np.sum(w * (x - wmean(x, w)) * (y - wmean(y, w))) / np.sum(w)\n\ndef wcorr(x, y, w):\n    return wcov(x, y, w) / np.sqrt(wcov(x, x, w) * wcov(y, y, w))\n```\n\nHas been confirmed by the organizers?\n\n**2.- Target:** It seems that the definition given by the organizers on how the target is calculated is not very accurate. However there is a [public kernel](https://www.kaggle.com/alexfir/recreating-target) with a reconstruction of the target where the metric, target against target_recreated, is around 0.981714. Is not perfect but it is good enough to try to build some features. Is there any improvement?\n\n**3.- VWAP:** I have been looking and I have not found how this \"volume weighted average price\" can be calculated with historical data, or if it is possible. I am not sure if the average is for some minutes (I tried and I have not found the window nor the combination of OHLC) or if it is the weighted average on the current minute and we don't have the data to recreate such price. Is there any clarification on that? or has someone clear how to obtain if from the volume and OHLC prices?\n\n**4.- Public test set:** train set with timestamps>=1623542400. That is 143998 different timestamp's. Correct?\n\n**5.- API:** I have iterated:\n\n```\ntest_all = pd.DataFrame()\n\nfor (test_df, sample_prediction_df) in iter_test:\n    test_all = pd.concat([test_all, test_df], axis=0)\n    print(test_all.shape)\n    sample_prediction_df['Target'] = 0\n    env.predict(sample_prediction_df)\n```\n\nand I obtain 4 different timestamps. Are there more timestamps in the public test set?\nSomeone tried to use lag1 features? Is it possible?\n\nThank you all",
      "votes": null
    },
    {
      "id": "1608751",
      "postDate": "12/06/2021 15:55:11",
      "content": "<ol>\n<li>You can find more about the competition metric <a href=\"https://www.kaggle.com/c/g-research-crypto-forecasting/discussion/291845\" target=\"_blank\">here</a></li>\n<li>The target calculation function had been fully released by the organizers <a href=\"https://www.kaggle.com/c/g-research-crypto-forecasting/discussion/286778\" target=\"_blank\">here</a></li>\n<li>VWAP is still kind of a mystery to create 100% however I created an approximation for it (that is pretty accurate) <a href=\"https://www.kaggle.com/c/g-research-crypto-forecasting/discussion/285726\" target=\"_blank\">here</a> </li>\n<li>(checking now to make sure)</li>\n<li>Yes there are more timestamps in the public test set but they are fed into our models only on submission. </li>\n</ol>",
      "rawMarkdown": "1. You can find more about the competition metric [here](https://www.kaggle.com/c/g-research-crypto-forecasting/discussion/291845)\n2. The target calculation function had been fully released by the organizers [here](https://www.kaggle.com/c/g-research-crypto-forecasting/discussion/286778)\n3. VWAP is still kind of a mystery to create 100% however I created an approximation for it (that is pretty accurate) [here](https://www.kaggle.com/c/g-research-crypto-forecasting/discussion/285726) \n4. (checking now to make sure)\n5. Yes there are more timestamps in the public test set but they are fed into our models only on submission.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1608751,
      "author_name": "",
      "author_url": "",
      "post_date": "12/06/2021 15:55:11",
      "content": "<ol>\n<li>You can find more about the competition metric <a href=\"https://www.kaggle.com/c/g-research-crypto-forecasting/discussion/291845\" target=\"_blank\">here</a></li>\n<li>The target calculation function had been fully released by the organizers <a href=\"https://www.kaggle.com/c/g-research-crypto-forecasting/discussion/286778\" target=\"_blank\">here</a></li>\n<li>VWAP is still kind of a mystery to create 100% however I created an approximation for it (that is pretty accurate) <a href=\"https://www.kaggle.com/c/g-research-crypto-forecasting/discussion/285726\" target=\"_blank\">here</a> </li>\n<li>(checking now to make sure)</li>\n<li>Yes there are more timestamps in the public test set but they are fed into our models only on submission. </li>\n</ol>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1607332": "I am starting to understand the competition and I have some doubts. I was reading the forum and looking at the public kernels and I found very interesting insights.\n\n**1.- Metric:** I think that this is the first competition where the metric is not defined by the organizers. In the explanatory notebook made by the organizers they talk about weighted correlation, buy in the given example they make an approximation. I've shown that some people use:\n```\n# https://stackoverflow.com/questions/38641691/weighted-correlation-coefficient-with-pandas\ndef wmean(x, w):\n    return np.sum(x * w) / np.sum(w)\n\ndef wcov(x, y, w):\n    return np.sum(w * (x - wmean(x, w)) * (y - wmean(y, w))) / np.sum(w)\n\ndef wcorr(x, y, w):\n    return wcov(x, y, w) / np.sqrt(wcov(x, x, w) * wcov(y, y, w))\n```\n\nHas been confirmed by the organizers?\n\n**2.- Target:** It seems that the definition given by the organizers on how the target is calculated is not very accurate. However there is a [public kernel](https://www.kaggle.com/alexfir/recreating-target) with a reconstruction of the target where the metric, target against target_recreated, is around 0.981714. Is not perfect but it is good enough to try to build some features. Is there any improvement?\n\n**3.- VWAP:** I have been looking and I have not found how this \"volume weighted average price\" can be calculated with historical data, or if it is possible. I am not sure if the average is for some minutes (I tried and I have not found the window nor the combination of OHLC) or if it is the weighted average on the current minute and we don't have the data to recreate such price. Is there any clarification on that? or has someone clear how to obtain if from the volume and OHLC prices?\n\n**4.- Public test set:** train set with timestamps>=1623542400. That is 143998 different timestamp's. Correct?\n\n**5.- API:** I have iterated:\n\n```\ntest_all = pd.DataFrame()\n\nfor (test_df, sample_prediction_df) in iter_test:\n    test_all = pd.concat([test_all, test_df], axis=0)\n    print(test_all.shape)\n    sample_prediction_df['Target'] = 0\n    env.predict(sample_prediction_df)\n```\n\nand I obtain 4 different timestamps. Are there more timestamps in the public test set?\nSomeone tried to use lag1 features? Is it possible?\n\nThank you all",
    "1608751": "1. You can find more about the competition metric [here](https://www.kaggle.com/c/g-research-crypto-forecasting/discussion/291845)\n2. The target calculation function had been fully released by the organizers [here](https://www.kaggle.com/c/g-research-crypto-forecasting/discussion/286778)\n3. VWAP is still kind of a mystery to create 100% however I created an approximation for it (that is pretty accurate) [here](https://www.kaggle.com/c/g-research-crypto-forecasting/discussion/285726) \n4. (checking now to make sure)\n5. Yes there are more timestamps in the public test set but they are fed into our models only on submission."
  },
  "source": "meta"
}