题目内容

下面关于特征矩阵的归一化(Normalizer)的描述错误的是

A. 归一化是依照特征矩阵的行,即每个样本进行处理
B. 其目的是使样本向量在进行点乘运算或计算相似性时,拥有统一的标准,即都转化为“单位向量”,使每个样本的范式等于 1。
C. 归一化是主要是对特征矩阵中每个列,即同一特征维度的数值进行规范化处理
D. 常见的归一化公式为L1 范式和L2 范式

查看答案
更多问题

下面是对数据进行二值化处理的python程序from sklearn.preprocessing import Binarizerdata = [[0, 0], [50, 0], [100, 1], [80, 1]]print (Binarizer(threshold=60).fit_transform(data)) 则print语句的输出结果为

A. [[0 0] [0 0] [1 1] [0 1]]
B. [[1 0] [1 0] [0 1] [1 1]]
C. [[0 0] [0 0] [0 0] [0 0]]
D. [[0 0] [0 0] [1 0] [1 0]]

下面是一段文档的向量化的程序,且未经停用词过滤 from sklearn.feature_extraction.text import CountVectorizercorpus = ['Jobs was the chairman of Apple Inc., and he was very famous','I like to use apple computer','And I also like to eat apple'] vectorizer =CountVectorizer()print(vectorizer.vocabulary_)print(vectorizer.fit_transform(corpus).todense()) #转化为完整特征矩阵 已知print(vectorizer.vocabulary_)的输出结果为:{u'and': 1, u'jobs': 9, u'apple': 2, u'very': 15, u'famous': 6, u'computer': 4, u'eat': 5, u'he': 7, u'use': 14, u'like': 10, u'to': 13, u'of': 11, u'also': 0, u'chairman': 3, u'the': 12, u'inc': 8, u'was': 16}. 则最后一条print语句中文档D1,即'Jobs was the chairman of Apple Inc., and he was very famous'的向量为

A. [0 1 1 1 0 0 1 1 1 1 0 1 1 0 0 1 2]
B. [0 0 1 0 1 0 0 0 0 0 1 0 0 1 1 0 0]
C. [1 1 1 0 0 1 0 0 0 0 1 0 0 1 0 0 0]
D. 其它选项都不对

下面的一段python程序的目的是利用皮尔逊相关系数进行iris数据集特征选择import numpy as npfrom scipy.stats import pearsonrfrom sklearn import datasetsiris = 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

下面的一段python程序的目的是对样本特征矩阵进行归一化处理,则空格处应该填充的函数是? from sklearn import datasetsiris = datasets.load_iris()from sklearn.preprocessing import Normalizerprint (Normalizer(norm='l1'). (iris.data))

A. fit
B. fit_transform
C. transform
D. normalizer

答案查题题库