ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

机器学习基石 之 非线性转换(Nonlinear Transformation)

2021-04-28 22:33:47  阅读:489  来源: 互联网

标签:subset Phi Nonlinear mathbf right mathcal left Transformation 基石


非线性转换(Nonlinear Transformation)

前面讲了许多线性模型,但是假如数据并不是线性可分的,该如何处理呢?基本思路是将数据样本(特征)空间 \(\mathcal{X}\) 映射到 \(\mathcal{Z}\) 空间后,在 \(\mathcal{Z}\) 空间数据是线性可分的话,便可以在 \(\mathcal{Z}\) 空间上使用线性模型对数据分析。

那么该映射叫做非线性特征转换 \(\Phi\)((nonlinear) feature transform )实现的是:

\[\mathbf { x } \in \mathcal { X } {\mathop \longmapsto ^ \mathbf { \Phi }} \mathbf { z } \in \mathcal { Z } \]

学习的基本步骤如下:

  • transform original data \(\left\{ \left( \mathbf { x } _ { n } , y _ { n } \right) \right\}\) to \(\left\{ \left( \mathbf { z } _ { n } = \mathbf { \Phi } \left( \mathbf { x } _ { n } \right) , y _ { n } \right) \right\}\)
  • get a good perceptron \(\tilde { \mathbf { w } }\) using \(\left\{ \left( \mathbf { z } _ { n } = \mathbf { \Phi } \left( \mathbf { x } _ { n } \right) , y _ { n } \right) \right\}\) and your favorite linear classification algorithm \(\mathcal{A}\)。
  • return \(g ( \mathbf { x } ) = \operatorname { sign } \left( \tilde { \mathbf { w } } ^ { T } \mathbf { \Phi } ( \mathbf { x } ) \right)\)

常用的非线性转换 (General Nonlinear Transform)

General Quadratic Hypothesis Set

基本形式为:

\[\Phi _ { 2 } ( \mathbf { x } ) = \left( 1 , x _ { 1 } , x _ { 2 } , x _ { 1 } ^ { 2 } , x _ { 1 } x _ { 2 } , x _ { 2 } ^ { 2 } \right) \]

其具有的特性是

  • can implement all possible quadratic curve boundaries: circle, ellipse, rotated ellipse, hyperbola, parabola, …
    适用于各种二次曲线边界:圆,椭圆,旋转椭圆,双曲线,抛物线…
  • include lines and constants as degenerate cases
    也包括直线型和常数型

General PolynomialHypothesis Set

基本形式为:

\[\begin{aligned} \Phi _ { 0 } ( \mathbf { x } ) = ( 1 ) , \Phi _ { 1 } ( \mathbf { x } ) & = \left( \Phi _ { 0 } ( \mathbf { x } ) , \quad x _ { 1 } , x _ { 2 } , \ldots , x _ { d } \right) \\ \Phi _ { 2 } ( \mathbf { x } ) & = \left( \Phi _ { 1 } ( \mathbf { x } ) , \quad x _ { 1 } ^ { 2 } , x _ { 1 } x _ { 2 } , \ldots , x _ { d } ^ { 2 } \right) \\ \Phi _ { 3 } ( \mathbf { x } ) & = \left( \Phi _ { 2 } ( \mathbf { x } ) , \quad x _ { 1 } ^ { 3 } , x _ { 1 } ^ { 2 } x _ { 2 } , \ldots , x _ { d } ^ { 3 } \right)\\ \Phi _ { Q } ( \mathbf { x } ) &= \left( \begin{array} { c c } \Phi _ { Q - 1 } ( \mathbf { x } ) , & \left. x _ { 1 } ^ { Q } , x _ { 1 } ^ { Q - 1 } x _ { 2 } , \ldots , x _ { d } ^ { Q } \right) \end{array} \right.\end{aligned} \]

那么在经过特征转换后的 hypothesis set 可以表示为

\[\begin{array} { c c c c c c c c c } \mathcal { H } _ { \Phi _ { 0 } } & \subset & \mathcal { H } _ { \Phi _ { 1 } } & \subset & \mathcal { H } _ { \Phi _ { 2 } } & \subset & \mathcal { H } _ { \Phi _ { 3 } } & \subset & \ldots & \subset & \mathcal { H } _ { \Phi _ { Q } } \\ \| & & \| & & \| & & \| & & & &\| \\ \mathcal { H } _ { 0 } & & \mathcal { H } _ { 1 } & & \mathcal { H } _ { 2 } & & \mathcal { H } _ { 3 } & & \ldots & & \mathcal { H } _ { Q } \end{array} \]

可以绘制出结构图:

image-20200415224250868.png

所以其结构叫做嵌套(nested) \(\mathcal { H } _ { i }\) 。

非线性转换代价(Price)

对于多项式非线性转换来说,求取 \(g _ { i } = \operatorname { argmin } _ { h \in \mathcal { H } _ { i } } E _ { \mathrm { in } } ( h )\),可以获得以下结果:

\[\begin{array} { c c c c c c c c c} \mathcal { H } _ { 0 } & \subset & \mathcal { H } _ { 1 } & \subset & \mathcal { H } _ { 2 } & \subset & \mathcal { H } _ { 3 } & \subset & \cdots \\ d _ { \mathrm { VC } } \left( \mathcal { H } _ { 0 } \right) & \leq & d _ { \mathrm { VC } } \left( \mathcal { H } _ { 1 } \right) & \leq & d _ { \mathrm { VC } } \left( \mathcal { H } _ { 2 } \right) & \leq & d _ { \mathrm { VC } } \left( \mathcal { H } _ { 3 } \right) & \leq & \cdots \\ E _ { \mathrm { in } } \left( g _ { 0 } \right) & \geq & E _ { \mathrm { in } } \left( g _ { 1 } \right) & \geq & E _ { \mathrm { in } } \left( g _ { 2 } \right) & \geq & E _ { \mathrm { in } } \left( g _ { 3 } \right) & \geq & \cdots \end{array} \]

根据之前推导的公式可知:\(\underbrace { 1 } _ { W _ { 0 } } + \underbrace { \tilde { d } } _ { \text {others } } \text { dimensions } = O \left( Q ^ { d } \right)\),所以 \(Q\) large 意味着 large \(d_{\mathbf{vc}}\)。即能力越来越大,复杂度会随之不断增加。

而在分析 VC Dimension 时得出了下面关于\(E_{\text {in}}\),\(E_{\text {out}}\)以及模型复杂度随 \(d_{\mathbf{vc}}\) 的变化曲线图:

所以说能力越大,不一定越适用,在实际运用时,线性先行,从最简单的试起。许多情况下线性模型:简单(simple), 有效(efficient), 安全(safe), 且可行(workable)!

标签:subset,Phi,Nonlinear,mathbf,right,mathcal,left,Transformation,基石
来源: https://www.cnblogs.com/FlameBlog/p/14715271.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有