下面的一段python程序的目的是利用皮尔逊相关系数进行...
下面的一段python程序的目的是利用皮尔逊相关系数进行iris数据集特征选择 import numpy as np from scipy.stats import pearsonr from sklearn import datasets iris = datasets.load_iris() print ("Pearson's correlation coefficient between column #1 and target column", pearsonr(iris.data[:,0], iris.target )) print ("Pearson's correlation coefficient between column #2 and target column", pearsonr(iris.data[:,1], iris.target )) print ("Pearson's correlation coefficient between column #3 and target column", pearsonr(iris.data[:,2], iris.target )) print ("Pearson's correlation coefficient between column #4 and target column", pearsonr(iris.data[:,3], iris.target )) 其输出结果为: ("Pearson's correlation coefficient between column #1 and target column", (0.7825612318100814, 2.890478352614054e-32)) ("Pearson's correlation coefficient between column #2 and target column", (-0.4194462002600275, 9.159984972550002e-08)) ("Pearson's correlation coefficient between column #3 and target column", (0.9490425448523336, 4.1554775794971695e-76)) ("Pearson's correlation coefficient between column #4 and target column", (0.9564638238016173, 4.775002368756619e-81)) 则如果去掉一个特征,应该选择哪一个特征去掉?A、#1B、#2C、#3D、#4
下面的一段python程序的目的是利用皮尔逊相关系数进行iris数据集特征选择 import numpy as np from scipy.stats import pearsonr from sklearn import datasets iris = datasets.load_iris() print ("Pearson's correlation coefficient between column #1 and target column", pearsonr(iris.data[:,0], iris.target )) print ("Pearson's correlation coefficient between column #2 and target column", pearsonr(iris.data[:,1], iris.target )) print ("Pearson's correlation coefficient between column #3 and target column", pearsonr(iris.data[:,2], iris.target )) print ("Pearson's correlation coefficient between column #4 and target column", pearsonr(iris.data[:,3], iris.target )) 其输出结果为: ("Pearson's correlation coefficient between column #1 and target column", (0.7825612318100814, 2.890478352614054e-32)) ("Pearson's correlation coefficient between column #2 and target column", (-0.4194462002600275, 9.159984972550002e-08)) ("Pearson's correlation coefficient between column #3 and target column", (0.9490425448523336, 4.1554775794971695e-76)) ("Pearson's correlation coefficient between column #4 and target column", (0.9564638238016173, 4.775002368756619e-81)) 则如果去掉一个特征,应该选择哪一个特征去掉?
A、#1
B、#2
C、#3
D、#4
点击查看答案