Dimensionality Reduction

Dimensionality Reduction 

--Hands-on Machine Learning with Scikit-Learn and TensorFlow -Chapter 8


Introduction 

 

  1. 降维 pros:有助于加快训练速度;有助于数据可视化。cons:可能会导致重要信息丢失。
  2. Two main approaches to dimensionality:projection and manifold learning 
  3. Three popular dimensionality reduction techniques:PCA,Kernel PCA, and LLE

Two main approaches for Dimensionalty Reduction

  1. Projection 在实际问题当中,训练数据通常是非均匀的分布在整个维度里面。有很多特征是连续的,但是有一些特征非常相似。结果这些训练数据在低纬度空间中挨得非常近。
  2. Manifold Learning (流形学习)

 

PCA(Principal Component Analysis) 

  1. pca是迄今为止最流行的降维算法。首先定义一个超平面,然后将数据投影到上面去。
  2. pca降维应当注意点地方: 2.1 preserving the variance 
  1. 2.2 the axis minimizes the mean squared distance between the original dataset and projection onto the axis

       3. Principal Components:PCA identifies the axis that accounts for the largest amount of variance in the training set.

the unit vector that defines the i(th) axis is called i(th) principal component.

如何找到训练数据的主成分?Singular Value Decomposition(SVD)

 

PAC默认数据集是以愿数据为中心的。Sklearn 的pca 包已经将数据集中化处理了。而用其他方法构造pca时候,不要忘记首先集中化处理数据。(centering the data)

在降维的时候,一定要尽可能的保证更大的方差。

from sklearn.decomposition import PCA

pca=PCA(n_components=2)
X2D=pcd.fit_transform(X)
pca.explained_variance_ratio_

选择合适的维数

 

转载于:https://www.cnblogs.com/makino/p/9626871.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值