机器学习数学语言(8.3作业)

1.决策表

  • 写出本例中的 U \mathbf{U} U, C \mathbf{C} C, D \mathbf{D} D V \mathbf{V} V 注: 最后两个属性为决策属性
    在这里插入图片描述
    U = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 7 } \mathbf{U}=\{x_1, x_2, x_3, x_4, x_5, x_6, x_7\} U={x1,x2,x3,x4,x5,x6,x7} is the set of instances,
    C = {Headache,Temperature,Lymphocyte,Leukocyte,Eosinophil,Heartbeat} \mathbf{C}=\text{\{Headache,Temperature,Lymphocyte,Leukocyte,Eosinophil,Heartbeat\}} C={Headache,Temperature,Lymphocyte,Leukocyte,Eosinophil,Heartbeat}
    D = {Normal,Abnomal,Yes,No} \mathbf{D}=\text{\{Normal,Abnomal,Yes,No\}} D={Normal,Abnomal,Yes,No} is the set of decisional attributes,
    V = ⋃ a ∈ C ∪ D V a \mathbf{V}=\bigcup_{a \in \mathbf{C} \cup \mathbf{D}}\mathbf{V_a} V=aCDVa
    V a \mathbf{V_a} Va is the domain of a ∈ C ∪ D a \in \mathbf{C} \cup \mathbf{D} aCD

  • 定义一个标签分布系统, 即各标签的值不是 [ 0 , 1 ] [0, 1] [0,1] 区间的实数, 且同一对象的标签和为 1.
    A Label Distribution system is a tuple S = ( X , Y ) S = (\mathbf X, \mathbf Y) S=(X,Y), where

  • X = [ x i j ] n × m ∈ R n × m \mathbf X = [x_{ij}]_{n \times m} \in \mathbb R^{n \times m} X=[xij]n×mRn×m is the data matrix, and x i = [ x i 1 , … , x i m ] \mathbf{x}_i = [x_{i1}, \dots, x_{im}] xi=[xi1,,xim]is an instance;

  • Y = [ y i k ] n × l ∈ [ 0 , 1 ] n × l \mathbf Y = [y_{ik}]_{n \times l} \in [0, 1]^{n \times l} Y=[yik]n×l[0,1]n×l is the lable matrix, and y i = [ y i 1 , … , y i l ] \mathbf{y}_i = [y_{i1}, \dots, y_{il}] yi=[yi1,,yil]is the label vector of x i \mathbf{x}_i xi
    satisfying

    • ∀ y i ⊂ Y , ∑ t = 1 l y i t = 1 \forall \mathbf y_i \subset \mathbf Y, \sum_{t = 1}^{l}y_{it} = 1 yiY,t=1lyit=1.
  • n n n is the number of instances;

  • m m m is the number of features;

  • l l l is the number of distribution labels.

示例讲解

(1). ∑ i = 1 m ( y ^ − y i ) 2 \sum_{i=1}^{m} \left ( \hat{y} - y_{i}\right )^2 i=1m(y^yi)2
其中, y ^ \hat{y} y^ 表示 x x x 通过含 θ 1 ∘ \theta_{1}^{\circ} θ1 θ 2 ∘ \theta_{2}^{\circ} θ2​ 这两个参数的式子求得, y i y_{i} yi 表示实际的 x x x 对应的值, ( y ^ − y i ) 2 \left(\hat{y} - y_{i}\right )^2 (y^yi)2 是求对应同一个 x x x, 预测值和实际值的差距,即误差,该值越大,说明误差越大,前面的 ∑ i = 1 m \sum_{i=1}^{m} i=1m 求和符号表示,每一个例子的误差之和。整个式子就是求预测值和实际值的误差和,针对所有的例子。

(2). Θ 1 = Θ 0 − α × ∇ f ( Θ ) ∣ Θ 0 \Theta^1=\Theta^0-\alpha \times \nabla f\left ( \Theta \right )|\Theta ^0 Θ1=Θ0α×f(Θ)Θ0

(3). Θ 2 = Θ 1 − α × ∇ f ( Θ ) ∣ Θ 1 \Theta^2=\Theta^1-\alpha \times \nabla f\left ( \Theta \right )|\Theta ^1 Θ2=Θ1α×f(Θ)Θ1
其中(2), (3)都是相同的意思,都是为了找最小的 Θ ( θ 1 , θ 2 ) \Theta(\theta_{1},\theta_{2}) Θ(θ1,θ2)
对于(2), Θ 0 \Theta_{0} Θ0 表示储存一组参数 ( θ 1 0 , θ 2 0 ) (\theta_{1}^{0},\theta_{2}^{0}) (θ10,θ20), α \alpha α是一个常数,主要是记录 Θ 0 \Theta^0 Θ0 Θ 1 \Theta^1 Θ1 的方向, α \alpha α很小, ∇ f ( Θ ) ∣ Θ 0 \nabla f\left ( \Theta \right )|\Theta ^0 f(Θ)Θ0 是在 Θ 0 \Theta_{0} Θ0 这点的导函数所对应的值。式子最终的目的就是求 Θ 1 \Theta_{1} Θ1, 根据这个式子迭代,就可以一点一点逼近最小的 Θ ( θ 1 , θ 2 ) \Theta(\theta_{1},\theta_{2}) Θ(θ1,θ2).

(4). f ( Θ ) = 1 2 m ( X ⋅ Θ − Y ) T ( X ⋅ Θ − Y ) f(\Theta)=\frac{1}{2m}\left ( \mathbf{X}\cdot\Theta-\mathbf{Y} \right )^\mathbf{T}\left ( \mathbf{X}\cdot\Theta-\mathbf{Y} \right ) f(Θ)=2m1(XΘY)T(XΘY)
由文章上文知道: X = [ x 1 1 x 2 1 ⋮ ⋮ x 20 1 ] \mathbf{X}=\begin{bmatrix} x_1 & 1 \\ x_2 & 1 \\ \vdots & \vdots \\ x_{20} & 1 \end{bmatrix} X=x1x2x20111 , Θ = [ θ 1 θ 2 ] \mathbf{\Theta }=\begin{bmatrix} \theta_1 \\ \theta_2 \end{bmatrix} Θ=[θ1θ2], Y = [ y 1 y 2 ⋮ y 20 ] \mathbf{Y}=\begin{bmatrix} y_1\\ y_2 \\ \vdots \\y_{20} \end{bmatrix} Y=y1y2y20
其中, X ⋅ Θ − Y \mathbf{X}\cdot\Theta-\mathbf{Y} XΘY 的结果是一个 20 × 1 20\times1 20×1的矩阵(该文章上有20个例子),每一项表示对应的 x x x y ^ − y \hat{y}-y y^y ( X ⋅ Θ − Y ) T ( X ⋅ Θ − Y ) \left ( \mathbf{X}\cdot\Theta-\mathbf{Y} \right )^\mathbf{T}\left ( \mathbf{X}\cdot\Theta-\mathbf{Y} \right ) (XΘY)T(XΘY)的结果是一个数,这个数是 ∑ i = 1 m ( y ^ − y i ) 2 \sum_{i=1}^{m} \left ( \hat{y} - y_{i}\right )^2 i=1m(y^yi)2 1 m \frac{1}{m} m1是表示平均到每一份上, 1 2 \frac{1}{2} 21 是为了后续求导时不再有多余的常量(根据文章里说的)。
(4) 式表示损失函数。
(5). ∇ f ( Θ ) = 1 m X T ( X ⋅ Θ − Y ) \nabla{f}(\Theta)=\frac{1}{m} \mathbf{X}^{\mathbf{T}}\left ( \mathbf{X}\cdot \Theta -\mathbf{Y} \right ) f(Θ)=m1XT(XΘY) 是(4)式的导函数,当导函数在某处可导且为0时,该点的 Θ \Theta Θ值就是最小的值。

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值