题目内容

下面的一段python程序的目的什么?import scipy.sparse as spfrom sklearn.preprocessing import Imputerx = sp.csc_matrix([ [1, 2], [0, 3], [7, 6]])imp = Imputer(missing_values=0, strategy='mean', verbose=0)imp.fit(x)x_test = sp.csc_matrix([ [0, 2], [6, 0], [7, 6]])

A. 样本特征矩阵的量纲的缩放
B. 缺失值补齐,将0视为缺失值
C. 样本特征矩阵的归一化
D. 多项式特征的生成

查看答案
更多问题

关于下面的python程序的描述错误的是?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(ngram_range=(1,2))print("N-gram mode: ",vectorizer.fit_transform(corpus).todense()) print("N-gram mode: ",vectorizer.vocabulary_)

A. 采用n-gram模式进行文档向量化
B. vocabulary_中既包括unigram,也包括bigram
CountVectorizer没有考虑到IDF,即倒排文档频率
D. vocabulary_中只包括bi-gram

为了使用主成分分析法(principal component analysis) 对iris数据集进行特征降维,以便于数据的二维平面可视化。 则下面哪一条import语句不是必须的?

A. import matplotlib.pyplot as plt
B. from sklearn.decomposition import PCA
C. from sklearn.datasets import load_iris
D. from sklearn.feature_extraction.text import CountVectorizer

下面哪一条语句是用于导入nltk中的英文词性标注的模块?

A. from nltk import word_tokenize
B. from nltk.stem import PorterStemmer
C. from nltk import pos_tag
D. from nltk.corpus import treebank

下列哪些是常见的非线性回归模型?

A. 2次以上的多项式
B. 双曲线模型
C. 幂函数模型
D. 指数函数模型

答案查题题库