我看网上的顺序都是:先进行数据集划分,然后再进行特征抽取,能不能把这个顺序换一下呢?
我为什么想要换一下呢?
答:在使用KNN算法的过程中,我如果先进行数据集划分就会报错:
ValueError: Number of features of the model must match the input. Model n_features is 334 and input n_features is 224
好像是因为,测试集的特征数与训练的特征数不匹配?(我不确定是不是这个原因)
于是我就先进行特征抽取,之后再数据集划分,就不会报错了,但就是不知道这样做行不行呢?
666