{
  "id": 68782,
  "title": "Sampling the data?",
  "url": "/competitions/ga-customer-revenue-prediction/discussion/68782",
  "author_name": "Ben Greenwalt",
  "post_date": "2018-10-17T05:24:38.421000",
  "votes": 0,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Hi, I am wondering if sampling the data using a method like the one below is a valid strategy. I do not have the computational power to analyze the entire datasets. If not, what should I do to achieve a similar goal?</p>\n\n<pre><code>df_train_sample = pd.DataFrame.sample(df_train, n=2000, replace=False, random_state=42, axis=0)\npd.DataFrame.to_csv(df_train_sample, 'train_sample.csv')\n\ndf_test_sample = pd.DataFrame.sample(df_test, n=2000, replace=False, random_state=42, axis=0)\npd.DataFrame.to_csv(df_test_sample, 'test_sample.csv')\n</code></pre>",
  "messages": [
    {
      "id": 405244,
      "postDate": "2018-10-17T05:24:38.420Z",
      "content": "<p>Hi, I am wondering if sampling the data using a method like the one below is a valid strategy. I do not have the computational power to analyze the entire datasets. If not, what should I do to achieve a similar goal?</p>\n\n<pre><code>df_train_sample = pd.DataFrame.sample(df_train, n=2000, replace=False, random_state=42, axis=0)\npd.DataFrame.to_csv(df_train_sample, 'train_sample.csv')\n\ndf_test_sample = pd.DataFrame.sample(df_test, n=2000, replace=False, random_state=42, axis=0)\npd.DataFrame.to_csv(df_test_sample, 'test_sample.csv')\n</code></pre>",
      "rawMarkdown": "Hi, I am wondering if sampling the data using a method like the one below is a valid strategy. I do not have the computational power to analyze the entire datasets. If not, what should I do to achieve a similar goal?\n\n    df_train_sample = pd.DataFrame.sample(df_train, n=2000, replace=False, random_state=42, axis=0)\n    pd.DataFrame.to_csv(df_train_sample, 'train_sample.csv')\n    \n    df_test_sample = pd.DataFrame.sample(df_test, n=2000, replace=False, random_state=42, axis=0)\n    pd.DataFrame.to_csv(df_test_sample, 'test_sample.csv')"
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "405244": "Hi, I am wondering if sampling the data using a method like the one below is a valid strategy. I do not have the computational power to analyze the entire datasets. If not, what should I do to achieve a similar goal?\n\n    df_train_sample = pd.DataFrame.sample(df_train, n=2000, replace=False, random_state=42, axis=0)\n    pd.DataFrame.to_csv(df_train_sample, 'train_sample.csv')\n    \n    df_test_sample = pd.DataFrame.sample(df_test, n=2000, replace=False, random_state=42, axis=0)\n    pd.DataFrame.to_csv(df_test_sample, 'test_sample.csv')"
  }
}