{
  "id": 65775,
  "title": "Unit of Transaction Revenue?",
  "url": "/competitions/ga-customer-revenue-prediction/discussion/65775",
  "author_name": "yilisg",
  "post_date": "2018-09-14T17:28:07.998000",
  "votes": 23,
  "comment_count": 17,
  "views": 0,
  "content": "<p>Anyone else curious why are the transaction revenues so massive? The minimum in train is 10000, maximum is 2,110,800,000 -- that's over 2 billion and I know Google is a large company but unless we are talking about the Zimbabwean dollar...</p>\n\n<p><img src=\"https://i.ebayimg.com/images/g/yjMAAOSwVL1WCnRU/s-l1600.jpg\" alt=\"enter image description here\"></p>",
  "messages": [
    {
      "id": 387299,
      "postDate": "2018-09-14T17:28:07.997Z",
      "content": "<p>Anyone else curious why are the transaction revenues so massive? The minimum in train is 10000, maximum is 2,110,800,000 -- that's over 2 billion and I know Google is a large company but unless we are talking about the Zimbabwean dollar...</p>\n\n<p><img src=\"https://i.ebayimg.com/images/g/yjMAAOSwVL1WCnRU/s-l1600.jpg\" alt=\"enter image description here\"></p>",
      "rawMarkdown": "Anyone else curious why are the transaction revenues so massive? The minimum in train is 10000, maximum is 2,110,800,000 -- that's over 2 billion and I know Google is a large company but unless we are talking about the Zimbabwean dollar...\n\n![enter image description here][1]\n\n  [1]: https://i.ebayimg.com/images/g/yjMAAOSwVL1WCnRU/s-l1600.jpg",
      "votes": 23
    },
    {
      "id": 387740,
      "postDate": "2018-09-15T15:16:13.340Z",
      "content": "<p>It seems that it is all in <strong>USD</strong> <em>times 10^6</em></p>\n\n<p>An explanation can be found here: <a href=\"https://www.en.advertisercommunity.com/t5/Google-Analytics-Tracking-Goals/BigQuery-pulling-revenue-hits-transaction-transactionRevenue-or/td-p/894808\">https://www.en.advertisercommunity.com/t5/Google-Analytics-Tracking-Goals/BigQuery-pulling-revenue-hits-transaction-transactionRevenue-or/td-p/894808</a></p>",
      "rawMarkdown": "It seems that it is all in **USD** *times 10^6*\n\nAn explanation can be found here: https://www.en.advertisercommunity.com/t5/Google-Analytics-Tracking-Goals/BigQuery-pulling-revenue-hits-transaction-transactionRevenue-or/td-p/894808",
      "votes": 21,
      "replies": [
        {
          "id": 387772,
          "postDate": "2018-09-15T16:52:40.437Z",
          "content": "<p>Correct.</p>",
          "rawMarkdown": "Correct.",
          "votes": 1
        },
        {
          "id": 387778,
          "postDate": "2018-09-15T16:57:32.147Z",
          "content": "<p>Hello Phil, thanks for the reply. Just wondering, are you referring to my comment or to the main post?</p>",
          "rawMarkdown": "Hello Phil, thanks for the reply. Just wondering, are you referring to my comment or to the main post?"
        },
        {
          "id": 387780,
          "postDate": "2018-09-15T17:01:17.247Z",
          "content": "<p>I was referring to your comment.</p>",
          "rawMarkdown": "I was referring to your comment."
        },
        {
          "id": 387788,
          "postDate": "2018-09-15T17:18:06.143Z",
          "content": "<p>May I ask, does the log of the transaction predictions need to be carried out on the transactionRevenue in real $ or in the unadjusted figure (* 1million) in the dataset?</p>",
          "rawMarkdown": "May I ask, does the log of the transaction predictions need to be carried out on the transactionRevenue in real $ or in the unadjusted figure (* 1million) in the dataset?"
        },
        {
          "id": 387792,
          "postDate": "2018-09-15T17:22:23.167Z",
          "content": "<p>The unadjusted figure.  The target is based on the dataset, and the unadjusted figure is what is provided in the dataset, so that's what was used to formulate the target.</p>",
          "rawMarkdown": "The unadjusted figure.  The target is based on the dataset, and the unadjusted figure is what is provided in the dataset, so that's what was used to formulate the target.",
          "votes": 3
        }
      ]
    },
    {
      "id": 387997,
      "postDate": "2018-09-16T04:42:58.870Z",
      "content": "<p>Be careful with how you represent your revenue totals in R (or when using 32-bit integers)...! The maximum revenue in the training set is 23,129,500,000 by my analysis. To get the value of 2,110,800,000 that you quoted in your question as the maximum transaction revenue, it looks like you tried to convert the values to an integer representation. In R, try to compare the output of these two commands:<br>\n     <code>&gt; summary(as.integer(train$transactionRevenue))</code><br>\n     <code>&gt; summary(as.numeric(train$transactionRevenue))</code><br>\nThe maximum values are very different, and the first command gives a warning message! You can run the following code to see the maximum value that R integer can store, then compare that to the largest revenues in our data set. The value of 2,110,800,000 is the last record just under the cutoff:<br>\n     <code>&gt; .Machine$integer.max</code><br>\n     <code>&gt; sort(train$transactionRevenue[nchar(train$transactionRevenue)&gt;9])</code><br>\n     <code>&gt; as.numeric(\"23000000000\"); as.integer(\"23000000000\")</code><br>\nTry to use as.numeric instead.</p>",
      "rawMarkdown": "Be careful with how you represent your revenue totals in R (or when using 32-bit integers)...! The maximum revenue in the training set is 23,129,500,000 by my analysis. To get the value of 2,110,800,000 that you quoted in your question as the maximum transaction revenue, it looks like you tried to convert the values to an integer representation. In R, try to compare the output of these two commands:<br>\n     `&gt; summary(as.integer(train$transactionRevenue))`<br>\n     `&gt; summary(as.numeric(train$transactionRevenue))`<br>\nThe maximum values are very different, and the first command gives a warning message! You can run the following code to see the maximum value that R integer can store, then compare that to the largest revenues in our data set. The value of 2,110,800,000 is the last record just under the cutoff:<br>\n     `&gt; .Machine$integer.max`<br>\n     `&gt; sort(train$transactionRevenue[nchar(train$transactionRevenue)&gt;9])`<br>\n     `&gt; as.numeric(\"23000000000\"); as.integer(\"23000000000\")`<br>\nTry to use as.numeric instead.",
      "votes": 10,
      "replies": [
        {
          "id": 388297,
          "postDate": "2018-09-16T18:07:09.837Z",
          "content": "<p>Thank you. Great catch and I can confirm that as.integer produced a max of 2110800000 and as.numeric has produced a max of 23129500000...</p>",
          "rawMarkdown": "Thank you. Great catch and I can confirm that as.integer produced a max of 2110800000 and as.numeric has produced a max of 23129500000..."
        }
      ]
    },
    {
      "id": 387492,
      "postDate": "2018-09-15T04:14:05.457Z",
      "content": "<p>Thanks Preston. It's <em>possible</em> that the revenues are log transformed but this wasn't stated in the data description. All we've been asked to predict is the \"natural log of the <em>sum of all transactions per user</em>\" and if the underlying revenues are indeed log transformed, then the min/max still doesn't make real-world sense =&gt; log of smallest non-zero revenue is log(10000) ~= 9.21 and the log of the largest revenue is log(2110800000) ~= 21.5.</p>",
      "rawMarkdown": "Thanks Preston. It's *possible* that the revenues are log transformed but this wasn't stated in the data description. All we've been asked to predict is the \"natural log of the *sum of all transactions per user*\" and if the underlying revenues are indeed log transformed, then the min/max still doesn't make real-world sense =&gt; log of smallest non-zero revenue is log(10000) ~= 9.21 and the log of the largest revenue is log(2110800000) ~= 21.5.",
      "votes": 2
    },
    {
      "id": 387377,
      "postDate": "2018-09-14T20:08:04.047Z",
      "content": "<p>The values are log transformed.</p>",
      "rawMarkdown": "The values are log transformed.",
      "votes": -2
    },
    {
      "id": 388417,
      "postDate": "2018-09-17T01:52:32.337Z",
      "content": "<p>So do we adjust the total revenue, or leave it as is, for our predictions?</p>",
      "rawMarkdown": "So do we adjust the total revenue, or leave it as is, for our predictions?",
      "replies": [
        {
          "id": 388425,
          "postDate": "2018-09-17T02:19:13.290Z",
          "content": "<p>I think you should leave it as is, since the final \"actual value\" is based on this x1000000 definition.</p>",
          "rawMarkdown": "I think you should leave it as is, since the final \"actual value\" is based on this x1000000 definition."
        }
      ]
    },
    {
      "id": 388291,
      "postDate": "2018-09-16T17:58:23.413Z",
      "content": "<p>I can see the range of the train$transactionRevenue is from 10000 to 23129500000, while 99% of the revenue data is either missing or invalid. Did I miss anything or it is just what it is?</p>",
      "rawMarkdown": "I can see the range of the train$transactionRevenue is from 10000 to 23129500000, while 99% of the revenue data is either missing or invalid. Did I miss anything or it is just what it is?",
      "replies": [
        {
          "id": 388298,
          "postDate": "2018-09-16T18:12:33.610Z",
          "content": "<p>Most web visitors don't end up buying anything -- in this case 98.7%. The organizer has clarified that missing/NA is basically zero revenue.</p>\n\n<p>As for the amount, it is simply in USD * 1000000 (to maintain precision), so the mean revenue is 133744789/1000000 or $133.70 while the median revenue is $49.50 -- among those who ended up buying something. Of course if we include all users, these numbers fell drastically...</p>",
          "rawMarkdown": "Most web visitors don't end up buying anything -- in this case 98.7%. The organizer has clarified that missing/NA is basically zero revenue.\n\nAs for the amount, it is simply in USD * 1000000 (to maintain precision), so the mean revenue is 133744789/1000000 or $133.70 while the median revenue is $49.50 -- among those who ended up buying something. Of course if we include all users, these numbers fell drastically...",
          "votes": 8
        },
        {
          "id": 388300,
          "postDate": "2018-09-16T18:14:10.697Z",
          "content": "<p>This makes more sense. Thanks for the clarification. </p>",
          "rawMarkdown": "This makes more sense. Thanks for the clarification. "
        },
        {
          "id": 388416,
          "postDate": "2018-09-17T01:51:44.133Z",
          "rawMarkdown": "",
          "isDeleted": true
        }
      ]
    },
    {
      "id": 409010,
      "postDate": "2018-10-23T18:02:59.377Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 387740,
      "author_name": "ianchute",
      "author_url": "",
      "post_date": "2018-09-15T15:16:13.340000",
      "content": "<p>It seems that it is all in <strong>USD</strong> <em>times 10^6</em></p>\n\n<p>An explanation can be found here: <a href=\"https://www.en.advertisercommunity.com/t5/Google-Analytics-Tracking-Goals/BigQuery-pulling-revenue-hits-transaction-transactionRevenue-or/td-p/894808\">https://www.en.advertisercommunity.com/t5/Google-Analytics-Tracking-Goals/BigQuery-pulling-revenue-hits-transaction-transactionRevenue-or/td-p/894808</a></p>",
      "votes": 21,
      "replies": [
        {
          "id": 387772,
          "author_name": "Phil Culliton",
          "author_url": "",
          "post_date": "2018-09-15T16:52:40.437000",
          "content": "<p>Correct.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 387778,
          "author_name": "ianchute",
          "author_url": "",
          "post_date": "2018-09-15T16:57:32.147000",
          "content": "<p>Hello Phil, thanks for the reply. Just wondering, are you referring to my comment or to the main post?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 387780,
          "author_name": "Phil Culliton",
          "author_url": "",
          "post_date": "2018-09-15T17:01:17.247000",
          "content": "<p>I was referring to your comment.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 387788,
          "author_name": "MarkeD",
          "author_url": "",
          "post_date": "2018-09-15T17:18:06.143000",
          "content": "<p>May I ask, does the log of the transaction predictions need to be carried out on the transactionRevenue in real $ or in the unadjusted figure (* 1million) in the dataset?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 387792,
          "author_name": "Phil Culliton",
          "author_url": "",
          "post_date": "2018-09-15T17:22:23.167000",
          "content": "<p>The unadjusted figure.  The target is based on the dataset, and the unadjusted figure is what is provided in the dataset, so that's what was used to formulate the target.</p>",
          "votes": 3,
          "replies": []
        }
      ]
    },
    {
      "id": 387997,
      "author_name": "D.M. Salter",
      "author_url": "",
      "post_date": "2018-09-16T04:42:58.870000",
      "content": "<p>Be careful with how you represent your revenue totals in R (or when using 32-bit integers)...! The maximum revenue in the training set is 23,129,500,000 by my analysis. To get the value of 2,110,800,000 that you quoted in your question as the maximum transaction revenue, it looks like you tried to convert the values to an integer representation. In R, try to compare the output of these two commands:<br>\n     <code>&gt; summary(as.integer(train$transactionRevenue))</code><br>\n     <code>&gt; summary(as.numeric(train$transactionRevenue))</code><br>\nThe maximum values are very different, and the first command gives a warning message! You can run the following code to see the maximum value that R integer can store, then compare that to the largest revenues in our data set. The value of 2,110,800,000 is the last record just under the cutoff:<br>\n     <code>&gt; .Machine$integer.max</code><br>\n     <code>&gt; sort(train$transactionRevenue[nchar(train$transactionRevenue)&gt;9])</code><br>\n     <code>&gt; as.numeric(\"23000000000\"); as.integer(\"23000000000\")</code><br>\nTry to use as.numeric instead.</p>",
      "votes": 10,
      "replies": [
        {
          "id": 388297,
          "author_name": "yilisg",
          "author_url": "",
          "post_date": "2018-09-16T18:07:09.837000",
          "content": "<p>Thank you. Great catch and I can confirm that as.integer produced a max of 2110800000 and as.numeric has produced a max of 23129500000...</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 387492,
      "author_name": "yilisg",
      "author_url": "",
      "post_date": "2018-09-15T04:14:05.457000",
      "content": "<p>Thanks Preston. It's <em>possible</em> that the revenues are log transformed but this wasn't stated in the data description. All we've been asked to predict is the \"natural log of the <em>sum of all transactions per user</em>\" and if the underlying revenues are indeed log transformed, then the min/max still doesn't make real-world sense =&gt; log of smallest non-zero revenue is log(10000) ~= 9.21 and the log of the largest revenue is log(2110800000) ~= 21.5.</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 387377,
      "author_name": "prestomagnetic",
      "author_url": "",
      "post_date": "2018-09-14T20:08:04.047000",
      "content": "<p>The values are log transformed.</p>",
      "votes": -2,
      "replies": []
    },
    {
      "id": 388417,
      "author_name": "Michael Rodgers",
      "author_url": "",
      "post_date": "2018-09-17T01:52:32.337000",
      "content": "<p>So do we adjust the total revenue, or leave it as is, for our predictions?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 388425,
          "author_name": "yilisg",
          "author_url": "",
          "post_date": "2018-09-17T02:19:13.290000",
          "content": "<p>I think you should leave it as is, since the final \"actual value\" is based on this x1000000 definition.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 388291,
      "author_name": "Lamothy",
      "author_url": "",
      "post_date": "2018-09-16T17:58:23.413000",
      "content": "<p>I can see the range of the train$transactionRevenue is from 10000 to 23129500000, while 99% of the revenue data is either missing or invalid. Did I miss anything or it is just what it is?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 388298,
          "author_name": "yilisg",
          "author_url": "",
          "post_date": "2018-09-16T18:12:33.610000",
          "content": "<p>Most web visitors don't end up buying anything -- in this case 98.7%. The organizer has clarified that missing/NA is basically zero revenue.</p>\n\n<p>As for the amount, it is simply in USD * 1000000 (to maintain precision), so the mean revenue is 133744789/1000000 or $133.70 while the median revenue is $49.50 -- among those who ended up buying something. Of course if we include all users, these numbers fell drastically...</p>",
          "votes": 8,
          "replies": []
        },
        {
          "id": 388300,
          "author_name": "Lamothy",
          "author_url": "",
          "post_date": "2018-09-16T18:14:10.697000",
          "content": "<p>This makes more sense. Thanks for the clarification. </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 388416,
          "author_name": "",
          "author_url": "",
          "post_date": "2018-09-17T01:51:44.133000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 409010,
      "author_name": "",
      "author_url": "",
      "post_date": "2018-10-23T18:02:59.377000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "387299": "Anyone else curious why are the transaction revenues so massive? The minimum in train is 10000, maximum is 2,110,800,000 -- that's over 2 billion and I know Google is a large company but unless we are talking about the Zimbabwean dollar...\n\n![enter image description here][1]\n\n  [1]: https://i.ebayimg.com/images/g/yjMAAOSwVL1WCnRU/s-l1600.jpg",
    "387740": "It seems that it is all in **USD** *times 10^6*\n\nAn explanation can be found here: https://www.en.advertisercommunity.com/t5/Google-Analytics-Tracking-Goals/BigQuery-pulling-revenue-hits-transaction-transactionRevenue-or/td-p/894808",
    "387997": "Be careful with how you represent your revenue totals in R (or when using 32-bit integers)...! The maximum revenue in the training set is 23,129,500,000 by my analysis. To get the value of 2,110,800,000 that you quoted in your question as the maximum transaction revenue, it looks like you tried to convert the values to an integer representation. In R, try to compare the output of these two commands:<br>\n     `&gt; summary(as.integer(train$transactionRevenue))`<br>\n     `&gt; summary(as.numeric(train$transactionRevenue))`<br>\nThe maximum values are very different, and the first command gives a warning message! You can run the following code to see the maximum value that R integer can store, then compare that to the largest revenues in our data set. The value of 2,110,800,000 is the last record just under the cutoff:<br>\n     `&gt; .Machine$integer.max`<br>\n     `&gt; sort(train$transactionRevenue[nchar(train$transactionRevenue)&gt;9])`<br>\n     `&gt; as.numeric(\"23000000000\"); as.integer(\"23000000000\")`<br>\nTry to use as.numeric instead.",
    "387492": "Thanks Preston. It's *possible* that the revenues are log transformed but this wasn't stated in the data description. All we've been asked to predict is the \"natural log of the *sum of all transactions per user*\" and if the underlying revenues are indeed log transformed, then the min/max still doesn't make real-world sense =&gt; log of smallest non-zero revenue is log(10000) ~= 9.21 and the log of the largest revenue is log(2110800000) ~= 21.5.",
    "387377": "The values are log transformed.",
    "388417": "So do we adjust the total revenue, or leave it as is, for our predictions?",
    "388291": "I can see the range of the train$transactionRevenue is from 10000 to 23129500000, while 99% of the revenue data is either missing or invalid. Did I miss anything or it is just what it is?",
    "409010": ""
  }
}