zoukankan      html  css  js  c++  java
  • Machine learning(3-Linear Algebra Review )

    1、Matrices and vectors

    • Matrix :Rectangular array of numbers

    image.png

    a notation R3×3

    • Vector : An n×1 matrix

    image.png

    this is a three dimensional vector , a notation R3

    • image.png

    2、Addition and scalar multiplication

    • image.png
    • image.png
    • image.png

    3、Matrix-vector multiplication

    4、Matrix-matrix multiplication

    • Same as above

    5、Matrix multiplication properties

    • No commutative A×B ≠ B×A (B is not identity matrix)
    • Yes associative (A×B)×C=A×(B×C)
    • image.png
    • For any matrix A, A×I = I×A = A

    6、Inverse and transpose

    • Inverse :

    we can use python to implement and for example :

    from numpy import *
    
    # 自行判断|A|≠0
    # 求逆矩阵 ,建议:取小数点后一位化为分数
    
    A = mat([[1, -1, 1],
             [1, 1, 0],
             [-1, 0, 1]])
    
    B = A.I
    print(B)
    
    #  [ 0.33333333  0.33333333 -0.33333333]
    #  [-0.33333333  0.66666667  0.33333333]
    #  [ 0.33333333  0.33333333  0.66666667]
    # 0.333≈ 1/3 ,0.667≈ 2/3
    
    • Transpose :

    image.png

  • 相关阅读:
    使用XStream解析xml
    分享功能
    上拉加载 下拉刷新
    点击button倒计时
    正则表达式验证手机号码
    第三方登陆
    test
    横向滑动菜单HorizontalScrollView
    slidingmenu侧滑侧单
    2017/4/25 afternoon
  • 原文地址:https://www.cnblogs.com/wangzheming35/p/14861953.html
Copyright © 2011-2022 走看看