전체 글 (84) 썸네일형 리스트형 LASSO, Ridge regression LASSO$$\min_{\beta}(y-X\beta)^T(y-X\beta)$$$$\mathrm{subject\;to}\quad||\beta||_1\leq t$$\(\beta_i\)가 0이 되는 걸 허용한다. 0이 됨으로써 variable selection도 되는 듯.Ridge regression$$\min_{\beta}(y-X\beta)^T(y-X\beta)$$$$\mathrm{subject\;to}\quad||\beta||_2= c$$ Lagrangian당연히 둘 다 constraint를 Lagrangian을 이용해 objective에 포함시킬 수 있다. Referenceshttps://en.wikipedia.org/wiki/Lasso_(statistics)https://en.wikipedia.org/.. rm -rf * 를 쓰자.. rm -rf ./* 말고 rm -rf * 를 쓰자... 최악의 참사를 보통의 참사로 바꿔준다... 하.. 방금 rm -rf ./*하려다 rm -rf /*를 하고 자료를 날렸다. 다행히 도커여서 연결된 볼륨만 날라갔다... 근데 그게 다 손수 정제한 데이터셋이었다는게 문제... 2d symmetric KL-divergence Implementation import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D def normal2d(mu:np.array, sigma): def normal2d_(x, y): x = np.array([x,y]) x = x.reshape((2,1)) I = np.eye(2) V = sigma**2*I V_inv = np.linalg.inv(V) mul = np.linalg.det(2*np.pi*V)**(-0.5) px = -0.5*(x-mu).T@V_inv@(x-mu) result = mul*np.exp(px[0]) return result[0] return normal2d_ def calcul.. Inequalities 모음 Triangle Inequality \[|A+B| \leq |A| + |B|\] \[\left|\int_0^tf(t)g(t)dt\right| \leq \int_0^t|f(t)g(t)|dt\] proof: \[-|A|\leq A \leq |A|\] \[-|B| \leq B \leq |B| \] \[-|A|-|B| \leq A+B \leq |A|+|B|\] \[|A+B| \leq |A|+|B|\] Cauchy-Schwarz Inequality \[|\langle\textbf{v},\textbf{w}\rangle|^2\leq\langle\textbf{v},\textbf{v} \rangle\cdot\langle\textbf{w},\textbf{w} \rangle\] \[\left|\int_0^tf(t)g(t)d.. M=H'H 일때 M은 nonnegative eigenvalue를 가짐을 증명 \[ M=H'H \] \[ Mv = \lambda v\] \[ v'Mv = \lambda v'v \] \[ v'H'Hv = \lambda v'v \] \[ (Hv)'Hv = \lambda v'v \] \[ w = Hv, w'w \geq 0\] \[ \lambda v'v \geq 0\] \[ \lambda \geq 0\] Proof done by ChatGPT. Metric vs distance measure Metric은 symmetry를 만족해야함. d(x,y)=d(y,x) Distance measure는 symmetry를 만드시 만족할 필요 없음. ex) KL-divergence. 그러면 \(Metric \subset Distance \: Measure\)인가? Metric은 distance measure의 특수한 경우가 되는건가?? ------------------------------------------------------------------------ (2024.01.31 수정) "Although the KL divergence measures the “distance” between two distributions, it is not a distance measure. This is beca.. Is a pdf a probability measure? No. Conditions of a Probability Measure (\(P\)) 1) \(P\) must return results in \([0,1]\) ... Conditions of a PDF (\(f\)) 1) \(\int_{-\infty}^\infty f(x)dx=1\) ... Differences Pdf는 output이 1을 넘을 수 있음. 그러나 probability measure는 output이 [0,1]에 있어야 함. 또한 pdf는 리만-스틸체스 적분을 사용. Probability measure는 르벡적분을 사용. 따라서 pdf는 probability measure가 아님. 의미를 보면 다음과 같음. \(f: \mathbb{R} \rightarrow \mathbb{R}\) \(P: .. Covariance matrix의 다양한 이름들 & Autocorrelation matrix Covariance matrix $$Cov(\mathbf{x})=\mathbb{E}[(\mathbf{x}-\mathbb{E}[\mathbf{x}])(\mathbf{x}-\mathbb{E}[\mathbf{x}])^T]$$ Covariance matrix = auto-covariance matrix = variance-covariance matrix = variance matrix = dispersion matrix 진짜 헷갈린다. 각자 다 다른 것 같이 보이지만 모두 covariance matrix를 의미한다. Autocorrelation matrix $$\mathbf{R}_{xx}=\mathbb{E}[\mathbf{x}\mathbf{x}^T]$$ 이전 1 2 3 4 5 6 ··· 11 다음