首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在turi create中导入苹果核心运动数据集?

如何在turi create中导入苹果核心运动数据集?
EN

Stack Overflow用户
提问于 2018-01-14 10:24:20
回答 1查看 188关注 0票数 1

我最近发现,苹果的核心运动数据(加速计、陀螺仪等)可以用来创建学习模型。下面的链接显示了一个示例:

https://github.com/apple/turicreate/blob/master/userguide/activity_classifier/introduction.md

此示例使用来自大型数据集(HAPT)的数据。在我的情况下,我是自己的数据集的创建者,使用核心运动数据的记录,同时执行不同的活动(例如,跳跃,行走,坐着)。下一步是在turi中导入我的数据集以创建模型。如何才能做到这一点?有没有人能提供一份步骤清单?

谢谢

EN

回答 1

Stack Overflow用户

发布于 2018-01-24 15:39:02

理想情况下,您应该将运动数据记录为某种标准格式。让我们假设它是CSV格式的。

代码语言:javascript
复制
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可能会拯救你。

代码语言:javascript
复制
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]
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48246148

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档