Skip to content

Instantly share code, notes, and snippets.

@sagarhowal
Created January 14, 2018 12:51
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 sagarhowal/72ebe8737f772dfd284410ffe0c6490c to your computer and use it in GitHub Desktop.
Save sagarhowal/72ebe8737f772dfd284410ffe0c6490c to your computer and use it in GitHub Desktop.
target_map = {
1.: 'walking',
2.: 'climbing_upstairs',
3.: 'climbing_downstairs',
4.: 'sitting',
5.: 'standing',
6.: 'laying'
}
# Use the same labels used in the experiment
data = data.filter_by(target_map.keys(), 'activity_id')
data['activity'] = data['activity_id'].apply(lambda x: target_map[x])
data = data.remove_column('activity_id')
data.save('hapt_data.sframe')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment