Major/Linear Algebra

    Matrices,Matrix-vector multiplication,Numpy with python

    maxtrixA.shape : 벡터의 사이즈 row,col 순서대로. import numpy as np A = np.array([[0,1,-2.3,0.1], [1.3, 4, -0.1, 0], [4.1,-1.0, 0, 1.7]]) A.shape m,n= A.shape print("row #: " + str(m) + ", cor #: " + str(n)) shape비교 by using a function bool값 리턴한다. wide = lambda x: x.shape[0] < x.shape[1] wide(A) indexing entries A = [[0,1,-2.3,0.1], [1.3, 4, -0.1, 0], [4.1,-1.0, 0, 1.7]] print("A[0,2]: " + str(A[0][2]) + ..

    K-means algorithm

    -about steps... 1. prepare data(vectors) 2. decide how many clusters I need -> group_num(k) 3. choose initial center of cluster(=centroid) 랜덤으로 지정해서 배열에 담고 np로 설정해주기 4. assign data point to nearest cluster **여기서 5번 과정까지..진짜 한참 헤맸다... 가장 어려웠던 스텝 initial center를 제외한 데이터들의 거리를 비교한다. 가장 가까운 centroid 값의 cluster에 data 지정한다. 5. move centroid to the center of its cluster data point & cluster point가 움직였으..

    Vector with python 01

    Vector with python 01

    -Each element can be accessed using index. same as normal array Can edit elements by using index. -Can assignment - 배정,배치 -Can copying... using copy method "copy()" In this case, copy address value. -Vector Equality : "==" operateor checks whether the two vectors (operand) are the same or not. And return boolean value. On NUMPY : "==" on numpy arrays perform element-wise comparison. -Be careful ..

    Vector notation & operations & my proof

    Vector notation & operations & my proof

    Vector is: an ordered finite list of numbers Each Elements called elements / entries... *Unit vectors When you proof something about vector, you should check dimension first and then element-wise. Remeber how to proof Commutative / Associative / Left and Right distrubutive Also Remeber rotation "+" is different compared to calculation rotation "+". The former is VECTOR Addition. New Topic : Line..