42.md 3.0 KB
Newer Older
L
loopyme 已提交
1
# 5.5. 无监督降维
W
init  
wizardforcel 已提交
2 3 4 5

校验者:
        [@程威](https://github.com/apachecn/scikit-learn-doc-zh)
翻译者:
L
loopyme 已提交
6
        [@十四号](https://github.com/apachecn/scikit-learn-doc-zh)
W
init  
wizardforcel 已提交
7

L
loopyme 已提交
8
如果你的特征数量很多, 在监督步骤之前, 可以通过无监督的步骤来减少特征. 很多的 [无监督学习](../unsupervised_learning.html#unsupervised-learning) 方法实现了一个名为 `transform` 的方法, 它可以用来降低维度. 下面我们将讨论大量使用这种模式的两个具体示例.
W
init  
wizardforcel 已提交
9

L
loopyme 已提交
10
>**Pipelining**
L
loopyme 已提交
11
>非监督数据约简和监督估计器可以链接起来。 请看 [Pipeline: 链式评估器](38#511-pipeline-链式评估器).
W
init  
wizardforcel 已提交
12

L
loopyme 已提交
13
## 5.5.1. PCA: 主成份分析
W
init  
wizardforcel 已提交
14

L
loopyme 已提交
15
[`decomposition.PCA`](https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html#sklearn.decomposition.PCA "sklearn.decomposition.PCA") 寻找能够捕捉原始特征的差异的特征的组合. 请参阅 [分解成分中的信号(矩阵分解问题)](24#25-分解成分中的信号(矩阵分解问题)).
W
init  
wizardforcel 已提交
16

L
loopyme 已提交
17 18
>**示例**
>* [Faces recognition example using eigenfaces and SVMs](https://scikit-learn.org/stable/auto_examples/applications/plot_face_recognition.html#sphx-glr-auto-examples-applications-plot-face-recognition-py)
W
init  
wizardforcel 已提交
19

L
loopyme 已提交
20
## 5.5.2. 随机投影
W
init  
wizardforcel 已提交
21

片刻小哥哥's avatar
片刻小哥哥 已提交
22
模块: `random_projection` 提供了几种用于通过随机投影减少数据的工具. 请参阅文档的相关部分: [随机投影](56).
W
init  
wizardforcel 已提交
23

L
loopyme 已提交
24 25
>**示例**
>*   [The Johnson-Lindenstrauss bound for embedding with random projections](https://scikit-learn.org/stable/auto_examples/plot_johnson_lindenstrauss_bound.html#sphx-glr-auto-examples-plot-johnson-lindenstrauss-bound-py)
W
init  
wizardforcel 已提交
26

L
loopyme 已提交
27
## 5.5.3. 特征聚集
W
init  
wizardforcel 已提交
28

L
loopyme 已提交
29
[`cluster.FeatureAgglomeration`](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.FeatureAgglomeration.html#sklearn.cluster.FeatureAgglomeration "sklearn.cluster.FeatureAgglomeration") 应用 [层次聚类](clustering.html#hierarchical-clustering) 将行为类似的特征分组在一起.
W
init  
wizardforcel 已提交
30

L
loopyme 已提交
31 32 33
>**示例**
>*   [Feature agglomeration vs. univariate selection](https://scikit-learn.org/stable/auto_examples/cluster/plot_feature_agglomeration_vs_univariate_selection.html#sphx-glr-auto-examples-cluster-plot-feature-agglomeration-vs-univariate-selection-py)
>*   [Feature agglomeration](https://scikit-learn.org/stable/auto_examples/cluster/plot_digits_agglomeration.html#sphx-glr-auto-examples-cluster-plot-digits-agglomeration-py)
W
init  
wizardforcel 已提交
34

L
loopyme 已提交
35 36 37
>**特征缩放**
>
>请注意,如果功能具有明显不同的缩放或统计属性,则 [`cluster.FeatureAgglomeration`](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.FeatureAgglomeration.html#sklearn.cluster.FeatureAgglomeration "sklearn.cluster.FeatureAgglomeration") 可能无法捕获相关特征之间的关系.使用一个 [`preprocessing.StandardScaler`](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html#sklearn.preprocessing.StandardScaler "sklearn.preprocessing.StandardScaler") 可以在这些 设置中使用.