# 5.5. 无监督降维 校验者:         [@程威](https://github.com/apachecn/scikit-learn-doc-zh) 翻译者:         [@十四号](https://github.com/apachecn/scikit-learn-doc-zh) 如果你的特征数量很多, 在监督步骤之前, 可以通过无监督的步骤来减少特征. 很多的 [无监督学习](../unsupervised_learning.html#unsupervised-learning) 方法实现了一个名为 `transform` 的方法, 它可以用来降低维度. 下面我们将讨论大量使用这种模式的两个具体示例. >**Pipelining** >非监督数据约简和监督估计器可以链接起来。 请看 [Pipeline: 链式评估器](38#511-pipeline-链式评估器). ## 5.5.1. PCA: 主成份分析 [`decomposition.PCA`](https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html#sklearn.decomposition.PCA "sklearn.decomposition.PCA") 寻找能够捕捉原始特征的差异的特征的组合. 请参阅 [分解成分中的信号(矩阵分解问题)](24#25-分解成分中的信号(矩阵分解问题)). >**示例** >* [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) ## 5.5.2. 随机投影 模块: `random_projection` 提供了几种用于通过随机投影减少数据的工具. 请参阅文档的相关部分: [随机投影](56). >**示例** >* [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) ## 5.5.3. 特征聚集 [`cluster.FeatureAgglomeration`](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.FeatureAgglomeration.html#sklearn.cluster.FeatureAgglomeration "sklearn.cluster.FeatureAgglomeration") 应用 [层次聚类](clustering.html#hierarchical-clustering) 将行为类似的特征分组在一起. >**示例** >* [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) >**特征缩放** > >请注意,如果功能具有明显不同的缩放或统计属性,则 [`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") 可以在这些 设置中使用.