【发布时间】:2021-07-25 19:01:08
【问题描述】:
df_chunk=pd.read_csv(文件名,chunk=1000) X_train,Y_train,X_test,Y_test=train_test.split(df_chunk)
如何使用 df_chunk 将其拆分为 x 和 y 训练数据
【问题讨论】:
df_chunk=pd.read_csv(文件名,chunk=1000) X_train,Y_train,X_test,Y_test=train_test.split(df_chunk)
如何使用 df_chunk 将其拆分为 x 和 y 训练数据
【问题讨论】:
我以前从未遇到过这种情况。也许你可以试试这个。
https://examples.dask.org/machine-learning/incremental.html
或者,这个。
https://zerowithdot.com/splitting-to-batches/
或者,获取原始数据集的一小部分。如果它真的是随机的,那么一个样本应该能够很好地代表整个数据集。
# Fraction of rows
# here you get .50 % of the rows
df.sample(frac = 0.5)
【讨论】: