{
  "id": 82726,
  "title": "No boosting solution (#88 place)",
  "url": "/competitions/ga-customer-revenue-prediction/discussion/82726",
  "author_name": "ArtemMerinov",
  "post_date": "2019-03-03T23:27:41.415000",
  "votes": 7,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Hi everyone! I would like to share our solution with the use of only target variable. I hope ideas provided below will be interesting for you.</p>\n\n<p><strong>MODEL I</strong></p>\n\n<p>The 1st model is based on time series forecasting.</p>\n\n<ol>\n<li>Firstly, we select all users with only positive revenue history. Here we assume that users who didn't pay will not pay in the future. </li>\n<li>To predict the sum of revenue from these users we use common pipeline for time series forecasting: \n<ul><li>outlier rejection </li>\n<li>exponential smoothing </li>\n<li>Box Cox transformation </li>\n<li>forecasting algorithm (we used FBProphet algorithm) </li>\n<li>inverse transformation</li></ul></li>\n<li>The next step is to distribute this value among all users. Here we simply guess that payment distribution in the future will be the same as in the train period.</li>\n</ol>\n\n<p><strong>MODEL II</strong></p>\n\n<p>The 2nd model operates on probabilities. For each user we determine a transition from one state to another depending on whether there was a transaction or not.</p>\n\n<ol>\n<li>Using parameters <code>[T0,T1,T2,T3]</code>, where <code>T0</code> and <code>T1</code> are start time and end time of train window and <code>T2</code> and <code>T3</code> are start time and end time of test window, we train a transition matrix <code>P(i,j)</code> from state <code>i</code> to state <code>j</code>, where <code>I = {0,1,2}</code> and <code>J = {1,2}</code>. We take into account transitions as follows:\n<code>(0,1) -&gt; [-] trans before T0, [-] trans in [T0,T1] and [-] trans in [T2,T3]</code>\n<code>(0,2) -&gt; [-] trans before T0, [-] trans in [T0,T1] and [+] trans in [T2,T3]</code>\n<code>(1,1) -&gt; [+] trans before T0, [-] trans in [T0,T1] and [-] trans in [T2,T3]</code>\n<code>(1,2) -&gt; [+] trans before T0, [-] trans in [T0,T1] and [+] trans in [T2,T3]</code>\n<code>(2,1) -&gt; [+] trans before T0, [+] trans in [T0,T1] and [-] trans in [T2,T3]</code>\n<code>(2,2) -&gt; [+] trans before T0, [+] trans in [T0,T1] and [+] trans in [T2,T3]</code>\nwhere <code>[-]</code> means there was no transaction and <code>[+]</code> means there was at least one transaction. \nOf course, sum <code>P(i,j) == 1</code> over all <code>i</code> and <code>j</code>. \nAt the same time we build matrix <code>C(i,j)</code> of average cost per user being in position <code>(i,j)</code>.</li>\n<li>We train model for 2016 year (<code>T0 = 2016.07.31</code>, <code>T3 = 2017.01.31</code>) and for 2017 year (<code>T0 = 2017.07.31</code>, <code>T3 = 2018.01.31</code>) independently and forecast target for each user as follows:\n<code>forecast_2016(user|state=i) = P(i,2) / (P(i,1) + P(i,2)) * C(i,2)</code>, where matrix <code>P</code> and <code>C</code> estimated on 2016 year, and state (0, 1 or 2) estimated on <code>test_v2</code> history\n<code>forecast_2017(user|state=i) = P(i,2) / (P(i,1) + P(i,2)) * C(i,2)</code>, where matrix <code>P</code> and <code>C</code> estimated on 2017 year, and state (0, 1 or 2) estimated on <code>test_v2</code> history</li>\n<li>We make average predictions with different weights\n<code>forecast = 0.3 * forecast_2016 + 0.7 * forecast_2017</code></li>\n</ol>\n\n<p>Final model makes simple average of Model 1 and Model 2. If you have any no-boost solution, please share it if you want. </p>",
  "messages": [
    {
      "id": 482961,
      "postDate": "2019-03-03T23:27:41.417Z",
      "content": "<p>Hi everyone! I would like to share our solution with the use of only target variable. I hope ideas provided below will be interesting for you.</p>\n\n<p><strong>MODEL I</strong></p>\n\n<p>The 1st model is based on time series forecasting.</p>\n\n<ol>\n<li>Firstly, we select all users with only positive revenue history. Here we assume that users who didn't pay will not pay in the future. </li>\n<li>To predict the sum of revenue from these users we use common pipeline for time series forecasting: \n<ul><li>outlier rejection </li>\n<li>exponential smoothing </li>\n<li>Box Cox transformation </li>\n<li>forecasting algorithm (we used FBProphet algorithm) </li>\n<li>inverse transformation</li></ul></li>\n<li>The next step is to distribute this value among all users. Here we simply guess that payment distribution in the future will be the same as in the train period.</li>\n</ol>\n\n<p><strong>MODEL II</strong></p>\n\n<p>The 2nd model operates on probabilities. For each user we determine a transition from one state to another depending on whether there was a transaction or not.</p>\n\n<ol>\n<li>Using parameters <code>[T0,T1,T2,T3]</code>, where <code>T0</code> and <code>T1</code> are start time and end time of train window and <code>T2</code> and <code>T3</code> are start time and end time of test window, we train a transition matrix <code>P(i,j)</code> from state <code>i</code> to state <code>j</code>, where <code>I = {0,1,2}</code> and <code>J = {1,2}</code>. We take into account transitions as follows:\n<code>(0,1) -&gt; [-] trans before T0, [-] trans in [T0,T1] and [-] trans in [T2,T3]</code>\n<code>(0,2) -&gt; [-] trans before T0, [-] trans in [T0,T1] and [+] trans in [T2,T3]</code>\n<code>(1,1) -&gt; [+] trans before T0, [-] trans in [T0,T1] and [-] trans in [T2,T3]</code>\n<code>(1,2) -&gt; [+] trans before T0, [-] trans in [T0,T1] and [+] trans in [T2,T3]</code>\n<code>(2,1) -&gt; [+] trans before T0, [+] trans in [T0,T1] and [-] trans in [T2,T3]</code>\n<code>(2,2) -&gt; [+] trans before T0, [+] trans in [T0,T1] and [+] trans in [T2,T3]</code>\nwhere <code>[-]</code> means there was no transaction and <code>[+]</code> means there was at least one transaction. \nOf course, sum <code>P(i,j) == 1</code> over all <code>i</code> and <code>j</code>. \nAt the same time we build matrix <code>C(i,j)</code> of average cost per user being in position <code>(i,j)</code>.</li>\n<li>We train model for 2016 year (<code>T0 = 2016.07.31</code>, <code>T3 = 2017.01.31</code>) and for 2017 year (<code>T0 = 2017.07.31</code>, <code>T3 = 2018.01.31</code>) independently and forecast target for each user as follows:\n<code>forecast_2016(user|state=i) = P(i,2) / (P(i,1) + P(i,2)) * C(i,2)</code>, where matrix <code>P</code> and <code>C</code> estimated on 2016 year, and state (0, 1 or 2) estimated on <code>test_v2</code> history\n<code>forecast_2017(user|state=i) = P(i,2) / (P(i,1) + P(i,2)) * C(i,2)</code>, where matrix <code>P</code> and <code>C</code> estimated on 2017 year, and state (0, 1 or 2) estimated on <code>test_v2</code> history</li>\n<li>We make average predictions with different weights\n<code>forecast = 0.3 * forecast_2016 + 0.7 * forecast_2017</code></li>\n</ol>\n\n<p>Final model makes simple average of Model 1 and Model 2. If you have any no-boost solution, please share it if you want. </p>",
      "rawMarkdown": "Hi everyone! I would like to share our solution with the use of only target variable. I hope ideas provided below will be interesting for you.\n\n**MODEL I**\n\nThe 1st model is based on time series forecasting.\n\n1. Firstly, we select all users with only positive revenue history. Here we assume that users who didn't pay will not pay in the future. \n2. To predict the sum of revenue from these users we use common pipeline for time series forecasting: \n  - outlier rejection \n  - exponential smoothing \n  - Box Cox transformation \n  - forecasting algorithm (we used FBProphet algorithm) \n  - inverse transformation\n3. The next step is to distribute this value among all users. Here we simply guess that payment distribution in the future will be the same as in the train period.\n\n**MODEL II**\n\nThe 2nd model operates on probabilities. For each user we determine a transition from one state to another depending on whether there was a transaction or not.\n\n1. Using parameters `[T0,T1,T2,T3]`, where `T0` and `T1` are start time and end time of train window and `T2` and `T3` are start time and end time of test window, we train a transition matrix `P(i,j)` from state `i` to state `j`, where `I = {0,1,2}` and `J = {1,2}`. We take into account transitions as follows:\n`(0,1) -&gt; [-] trans before T0, [-] trans in [T0,T1] and [-] trans in [T2,T3]`\n`(0,2) -&gt; [-] trans before T0, [-] trans in [T0,T1] and [+] trans in [T2,T3]`\n`(1,1) -&gt; [+] trans before T0, [-] trans in [T0,T1] and [-] trans in [T2,T3]`\n`(1,2) -&gt; [+] trans before T0, [-] trans in [T0,T1] and [+] trans in [T2,T3]`\n`(2,1) -&gt; [+] trans before T0, [+] trans in [T0,T1] and [-] trans in [T2,T3]`\n`(2,2) -&gt; [+] trans before T0, [+] trans in [T0,T1] and [+] trans in [T2,T3]`\nwhere `[-]` means there was no transaction and `[+]` means there was at least one transaction. \nOf course, sum `P(i,j) == 1` over all `i` and `j`. \nAt the same time we build matrix `C(i,j)` of average cost per user being in position `(i,j)`.\n2. We train model for 2016 year (`T0 = 2016.07.31`, `T3 = 2017.01.31`) and for 2017 year (`T0 = 2017.07.31`, `T3 = 2018.01.31`) independently and forecast target for each user as follows:\n`forecast_2016(user|state=i) = P(i,2) / (P(i,1) + P(i,2)) * C(i,2)`, where matrix `P` and `C` estimated on 2016 year, and state (0, 1 or 2) estimated on `test_v2` history\n`forecast_2017(user|state=i) = P(i,2) / (P(i,1) + P(i,2)) * C(i,2)`, where matrix `P` and `C` estimated on 2017 year, and state (0, 1 or 2) estimated on `test_v2` history\n3. We make average predictions with different weights\n`forecast = 0.3 * forecast_2016 + 0.7 * forecast_2017`\n\nFinal model makes simple average of Model 1 and Model 2. If you have any no-boost solution, please share it if you want. ",
      "votes": 7
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "482961": "Hi everyone! I would like to share our solution with the use of only target variable. I hope ideas provided below will be interesting for you.\n\n**MODEL I**\n\nThe 1st model is based on time series forecasting.\n\n1. Firstly, we select all users with only positive revenue history. Here we assume that users who didn't pay will not pay in the future. \n2. To predict the sum of revenue from these users we use common pipeline for time series forecasting: \n  - outlier rejection \n  - exponential smoothing \n  - Box Cox transformation \n  - forecasting algorithm (we used FBProphet algorithm) \n  - inverse transformation\n3. The next step is to distribute this value among all users. Here we simply guess that payment distribution in the future will be the same as in the train period.\n\n**MODEL II**\n\nThe 2nd model operates on probabilities. For each user we determine a transition from one state to another depending on whether there was a transaction or not.\n\n1. Using parameters `[T0,T1,T2,T3]`, where `T0` and `T1` are start time and end time of train window and `T2` and `T3` are start time and end time of test window, we train a transition matrix `P(i,j)` from state `i` to state `j`, where `I = {0,1,2}` and `J = {1,2}`. We take into account transitions as follows:\n`(0,1) -&gt; [-] trans before T0, [-] trans in [T0,T1] and [-] trans in [T2,T3]`\n`(0,2) -&gt; [-] trans before T0, [-] trans in [T0,T1] and [+] trans in [T2,T3]`\n`(1,1) -&gt; [+] trans before T0, [-] trans in [T0,T1] and [-] trans in [T2,T3]`\n`(1,2) -&gt; [+] trans before T0, [-] trans in [T0,T1] and [+] trans in [T2,T3]`\n`(2,1) -&gt; [+] trans before T0, [+] trans in [T0,T1] and [-] trans in [T2,T3]`\n`(2,2) -&gt; [+] trans before T0, [+] trans in [T0,T1] and [+] trans in [T2,T3]`\nwhere `[-]` means there was no transaction and `[+]` means there was at least one transaction. \nOf course, sum `P(i,j) == 1` over all `i` and `j`. \nAt the same time we build matrix `C(i,j)` of average cost per user being in position `(i,j)`.\n2. We train model for 2016 year (`T0 = 2016.07.31`, `T3 = 2017.01.31`) and for 2017 year (`T0 = 2017.07.31`, `T3 = 2018.01.31`) independently and forecast target for each user as follows:\n`forecast_2016(user|state=i) = P(i,2) / (P(i,1) + P(i,2)) * C(i,2)`, where matrix `P` and `C` estimated on 2016 year, and state (0, 1 or 2) estimated on `test_v2` history\n`forecast_2017(user|state=i) = P(i,2) / (P(i,1) + P(i,2)) * C(i,2)`, where matrix `P` and `C` estimated on 2017 year, and state (0, 1 or 2) estimated on `test_v2` history\n3. We make average predictions with different weights\n`forecast = 0.3 * forecast_2016 + 0.7 * forecast_2017`\n\nFinal model makes simple average of Model 1 and Model 2. If you have any no-boost solution, please share it if you want. "
  },
  "complete": true,
  "source": "existing_discussion",
  "competition_id": 10038,
  "competition_slug": "ga-customer-revenue-prediction",
  "team_id": 2098496,
  "solution_url": "/competitions/ga-customer-revenue-prediction/writeups/this-no-boosting-solution-88-place"
}