Skip to content

Instantly share code, notes, and snippets.

@myui
Last active October 31, 2019 03:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myui/8ab03ea1de10209fae88fb278c30dce1 to your computer and use it in GitHub Desktop.
Save myui/8ab03ea1de10209fae88fb278c30dce1 to your computer and use it in GitHub Desktop.
blogpost gender age prediction

Download dataset from https://www.kaggle.com/tomlisankie/blog-posts-labeled-with-age-and-gender/download

pip install kaggle

Please set your kaggle API credentials in ~/.kaggle/kaggle.json following the instruction: https://github.com/Kaggle/kaggle-api#api-credentials

chmod 600 ~/.kaggle/kaggle.json
kaggle datasets download tomlisankie/blog-posts-labeled-with-age-and-gender

unzip blog-posts-labeled-with-age-and-gender.zip 

brew install jq
jq -c '.[]' train.json > train.td.json
jq -c '.[]' test.json > test.td.json

td db:create blogposts
td table:create blogposts train
td table:create blogposts test
td import:auto --auto-create blogposts.train --format json --time-value `date +%s` --column-type age:int ./train.td.json
td import:auto --auto-create blogposts.test --format json --time-value `date +%s` --column-type age:int ./test.td.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment