sklearn.feature_extraction#

从原始数据中提取特征。

User guide. 看到 特征提取 部分了解更多详细信息。

DictVectorizer

Transforms lists of feature-value mappings to vectors.

FeatureHasher

实现具有哈希功能,又名哈希技巧。

从图像中#

从图像中提取特征的实用程序。

image.PatchExtractor

从图像集合中提取补丁。

image.extract_patches_2d

将2D图像重塑为补丁集合。

image.grid_to_graph

像素到像素连接的图表。

image.img_to_graph

像素到像素梯度连接的图形。

image.reconstruct_from_patches_2d

Reconstruct the image from all of its patches.

从文本#

从文本文档构建特征载体的实用程序。

text.CountVectorizer

将文本文档集合转换为令牌计数矩阵。

text.HashingVectorizer

将文本文档集合转换为标记出现的矩阵。

text.TfidfTransformer

将计数矩阵转换为规格化tf或tf-idf表示。

text.TfidfVectorizer

将原始文档集合转换为TF-IDF功能矩阵。