【发布时间】:2019-12-09 15:32:36
【问题描述】:
如何根据标签将数据拆分为训练和测试数据集? 标签是 1 和 0,我想将所有 1 用作训练数据集,将 0 用作测试数据集。 csv 文件如下所示:
1 Pixar classic is one of the best kids' movies of all time.
1 Apesar de representar um imenso avanço tecnológico, a força do filme reside no carisma de seus personagens e no charme de sua história.
1 When Woody perks up in the opening scene, it's not only the toy cowboy who comes alive - we're watching the rebirth of an art form.
0 The humans are wooden, the computer-animals have that floating, jerky gait of animated fauna.
1 Introduced not one but two indelible characters to the pop culture pantheon: cowboy rag-doll Woody (Tom Hanks) and plastic space ranger Buzz Lightyear (Tim Allen). [Blu-ray]
1 it is easy to see how virtually everything that is good in animation right now has some small seed in Toy Story
0 All the effects in the world can't disguise the thin plot.
1 Though some of the animation seems dated compared to later Pixar efforts and not nearly as detailed, what's here is done impeccably well.
【问题讨论】:
-
这是DataFrame吗?如果是,列名是什么?
-
第一列为“label”,第二列为“text”