python resample函数_python中的resample()

from sklearn.utils import resample

df_majority = df[df.balance==0]

df_minority = df[df.balance==1]

#Upsample minority class

df_minority_upsampled = resample(df_minority,

replace=True, # sample with replacement

n_samples=576, # to match majority class

random_state=123) # reproducible results

=================

Error:

Traceback (most recent call last):

File "", line 5, in

File "C:\Anaconda3\lib\site-packages\sklearn\utils\__init__.py", line 253, in resample

max_n_samples, n_samples))

ValueError: Cannot sample 576 out of arrays with dim 49

感谢任何帮助…指点。。

谢谢你

附言:我用齐柏林飞艇笔记本来试一试这些。在

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
相关推荐
©️2020 CSDN 皮肤主题: 游动-白 设计师:白松林 返回首页