我最近发现,苹果的核心运动数据(加速计、陀螺仪等)可以用来创建学习模型。下面的链接显示了一个示例:
https://github.com/apple/turicreate/blob/master/userguide/activity_classifier/introduction.md
此示例使用来自大型数据集(HAPT)的数据。在我的情况下,我是自己的数据集的创建者,使用核心运动数据的记录,同时执行不同的活动(例如,跳跃,行走,坐着)。下一步是在turi中导入我的数据集以创建模型。如何才能做到这一点?有没有人能提供一份步骤清单?
谢谢
发布于 2018-01-24 15:39:02
理想情况下,您应该将运动数据记录为某种标准格式。让我们假设它是CSV格式的。
walking,jumping,sitting
82,309635,1
82,309635,1
25,18265403,1
30,18527312,8
30,17977769,40
30,18375422,37
30,18292441,38
30,303092,7
85,18449654,3您可以使用任何文件读取器读取文件。为了简化你的生活,熊猫或sframe可能会拯救你。
In [14]: import turicreate as tc
In [15]: sf = tc.SFrame.read_csv('/tmp/activity.csv')
Finished parsing file /tmp/activity.csv
Parsing completed. Parsed 9 lines in 0.13823 secs.
------------------------------------------------------
Inferred types from first 100 line(s) of file as
column_type_hints=[int,int,int]
If parsing fails due to incorrect types, you can correct
the inferred type list above and pass it to read_csv in
the column_type_hints argument
------------------------------------------------------
Finished parsing file /tmp/activity.csv
Parsing completed. Parsed 9 lines in 0.113868 secs.
In [16]: sf.head()
Out[16]:
Columns:
walking int
jumping int
sitting int
Rows: 9
Data:
+---------+----------+---------+
| walking | jumping | sitting |
+---------+----------+---------+
| 82 | 309635 | 1 |
| 82 | 309635 | 1 |
| 25 | 18265403 | 1 |
| 30 | 18527312 | 8 |
| 30 | 17977769 | 40 |
| 30 | 18375422 | 37 |
| 30 | 18292441 | 38 |
| 30 | 303092 | 7 |
| 85 | 18449654 | 3 |
+---------+----------+---------+
[9 rows x 3 columns]https://stackoverflow.com/questions/48246148
复制相似问题