2021
07-09
07-09
python 如何通过KNN来填充缺失值
看代码吧~#加载库importnumpyasnpfromfancyimputeimportKNNfromsklearn.preprocessingimportStandardScalerfromsklearn.datasetsimportmake_blobs#创建模拟特征矩阵features,_=make_blobs(n_samples=1000,n_features=2,random_state=1)#标准化特征scaler=StandardScaler()standardized_features=scaler.fit_transform(features)standardized_featu...
继续阅读 >