0

在将我在 Python 中的不平衡数据集拆分为测试集和训练集后,我想对我的数据进行二次抽样。但是我得到了非常高的准确性,我也得到了以下错误:

/usr/local/lib/python3.5/dist-packages/ipykernel_launcher.py:33: UserWarning: Boolean Series key will be reindexed to match DataFrame index.

我需要担心这个吗?在我的数据集中,我有 2724 个 0 和 351 个 1。我使用的数据下采样代码如下:

df_majority = x_train[df_x.A==0]    
df_minority = x_train[df_x.A==1]    
df_majority_downsampled = resample(df_majority, replace=False, n_samples=351, random_state=123)    
df_downsampled = pd.concat([df_majority_downsampled, df_minority])

样本数据:

x 啦啦啦

1 0 -42.3333。72.4567

2 1 -42.4500 72.2345

3 0 -42.2345 72.0000

4 0 -42.9090 72.7897

5 0 -42.7777 72.1234

我想预测A

4

0 回答 0