【问题标题】:Training and Testing Splitting Tagging训练和测试拆分标记
【发布时间】:2021-06-10 02:20:39
【问题描述】:

这是我的数据集:

import pandas as pd 
fileName= 'user.csv'
df = pd.read_csv("trainingsample_100k_apps.csv",sep=",",header=0)
pd.set_option('max_columns', None)
df

UserID  Total Usage
001       20.3
002       40.5
003       10.1

应用此查询后,我如何知道哪一行已被选为训练和测试:

train, test = train_test_split(df, test_size = 0.20)

我希望输出是这样的:

UserID  Total Usage   SplitingCategory
001       20.3        Training
002       40.5        Testing
003       10.1        Training

【问题讨论】:

  • 能否分享一下数据集

标签: python pandas machine-learning scikit-learn split


【解决方案1】:

好的,我知道了

test

它会出现我的测试数据集

【讨论】:

    猜你喜欢
    • 2017-11-01
    • 1970-01-01
    • 2021-06-28
    • 1970-01-01
    • 2018-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-21
    相关资源
    最近更新 更多