标签:imp random code value val dom style bsp cti
from sklearn.model_selection import train_test_split Xtrain,Xtest,Ytrain,Ytest = train_test_split(X,Y,test_size=0.3,random_state=420) #切分前数据标签的分布情况 train_data.SeriousDlqin2yrs.value_counts() #切分后,训练集数据标签的分布情况 pd.Series(Ytrain).value_counts() #如果切分后的数据集分布不均衡,则需要对Xtrain,Ytrain和Xtest,Ytest进行平衡处理(参见非平衡样本的处理方式SMOTE)
标签:imp random code value val dom style bsp cti
原文地址:https://www.cnblogs.com/jing-yan/p/12339642.html