본문 바로가기
728x90

SML9

[SML] Marginal PDF Example codes Marginal PDF Example codes 포스트 난이도: HOO_Lead # Example codes # Library import numpy as np import pandas as pd from scipy.stats import norm, t import matplotlib.pyplot as plt #μX=μY= 0,σX=σY= 1 muX=0 muY=0 sigmaX=1 sigmaY=1 #interval [-3,3] xGrid=np.arange(-3,3,.01) yGrid=np.arange(-3,3,.01) #Normal X Pdf plt.figure() plt.plot(xGrid, norm.pdf(xGrid,muX,sigmaX)) plt.title("Marginal PDF(X)") plt.sh.. 2023. 2. 15.
[SML] Misclassification Rates Example Codes: guess, test data Misclassification Rates Example Codes: guess, test data 포스트 난이도: HOO_Lead # Example Codes # Library import numpy as np import pandas as pd from scipy.stats import norm, t import matplotlib.pyplot as plt def getClass1Prop(x,r): x=np.array(x) dist=np.zeros(len(x_train)) for i in range(len(x_train)): dist[i] = np.linalg.norm(x-x_train[i]) dist_label_1 = dist[y_train==1] dist_1r = dist_label_1[dist_.. 2023. 2. 15.
[SML] Critical Thinkings of The Linear Regression Critical Thinkings of The Linear Regression 포스트 난이도: HOO_Senior # Linear regression에서 고려해야 하는 것들 Linear regression에서 얻은 결과를 분석하는데 있어서 기본적으로 고려해야 될 것들이 있다. 마치 기본적으로 산출된 결과를 분석하는데 알아두어야 될 지침서와 비슷하다. 아래의 예시를 활용하면 산출된 결과를 분석하는데 매우 용이하다. Is there a relationship between X1 and Y? How strong is the relationship between X2 and Y? Which X contribute to Y? How accurately can we predict future Y? is the re.. 2023. 1. 30.
[Statistical Machine Learning] Linear regression, Estimation of the parameters, residual, RSS Linear regression, Estimation of the parameters, residual, RSS 포스트 난이도: HOO_Senior # Linear regression(선형 회귀) 선형 회귀로 알려져 있는 Linear regression는 모델링 분석에서 상당히 많이 사용되는 방식이다. "회귀"에서 알 수 있듯이 Linear regression은 Dependence of Y(종속 변수 Y)와 다수의 선형 X값들을 추정해서 상관관계를 산출해 낸다. 여기서 선형 X값들을 독립적 변수 X라고도 부른다. https://whoishoo.tistory.com/568 [Statistical Machine Learning] Parametric models: Linear model Parametric m.. 2023. 1. 28.
[Statistical Machine Learning] Parametric models: Linear model Parametric models: Linear model 포스트 난이도: HOO_Senior # Parametric models: Linear model Parametric models(매개변수 모델)에서 Linear model(선형 모델)은 대표적이면서도 중요한 모델에 해당된다. 매개변수 모델을 배우는 데 있어서 가장 우선적으로 배우는 모델임에 동시에 비교 분석에서 가장 많이 사용되는 모델이기도 하다. 선형 모델을 식으로 표현하면 아래와 같이 표현이 가능하다. 여기서 베타가 의미하는 바가 바로 매개변수이다. 매개변수라고 해서 어색할 수는 있지만 파라미터(Parameters)를 의미한다. 파라미터는 p+1로 선형 모델에 나타내지며, 우리는 파라미터를 예측할 수가 있다. 파라미터를 예측하기 위해서는 주어진.. 2023. 1. 27.
[Statistical Machine Learning] Estimate f(x): neighborhood, nearest neighbor averaging, curse of dimensionality Estimate f(x): neighborhood, nearest neighbor averaging, curse of dimensionality 포스트 난이도: HOO_Senior # Estimate f Statistical machine learning(SML)에서 f(function)는 데이터를 분석하는 데 있어서 중요하다. f를 어떻게 설정하느냐에 따라서 결과가 완전히 달라질 수 있기 때문이다. 그렇다 보니 f를 어떻게 설정하는지가 데이터 분석에 있어서 중요한 요소이고 데이터 분석가 또는 데이터사이언티스트의 능력을 보여준다. 하지만 아무리 능력이 좋은 데이터사이언티스트라고 할지라도 데이터를 보자마자 f를 만들어낼 수는 없다. f를 구성하는 데 있어서도 데이터를 기반으로 해서 알아내야 한다. SML에.. 2023. 1. 25.
[Statistical Machine Learning] Regression Function: f(x), irreducible error, reducible error, Bias, Variance Regression Function: f(x), irreducible error, reducible error, Bias, Variance 포스트 난이도: HOO_Senior # Irreducible Error 이전 포스트에서 Regression function과 Mean-squared prediction error(MSE)에 대해서 알아보았다. https://whoishoo.tistory.com/565 [Statistical Machine Learning] Regression Function: f(x), expected value, Mean-squared Prediction Error Regression Function: f(x), expected value, Mean-squared Prediction.. 2023. 1. 25.
[Statistical Machine Learning] Regression Function: f(x), expected value, Mean-squared Prediction Error Regression Function: f(x), expected value, Mean-squared Prediction Error 포스트 난이도: HOO_Senior # Ideal f(x) 저번 포스트에서 Statistical machine learning(SML)에 대해 무엇이며, 어떤 기본 공식을 가지고 있는지 알아보았다. https://whoishoo.tistory.com/562 [Statistical Machine Learning] Introduce Statistical Learning Introduce Statistical Learning 포스트 난이도: HOO_Senior # Statistical Learning 위의 예제는 Statistical learning에서 사용하는 기본적인 수식이다... 2023. 1. 25.
[Statistical Machine Learning] Introduce Statistical Learning Introduce Statistical Learning 포스트 난이도: HOO_Senior # Statistical Learning 위의 예제는 Statistical learning에서 사용하는 기본적인 수식이다. 우선 PL이라고 나와있는 Programming Languages라는 변수(Y)는 respons 또는 target에 해당한다. f라고 나와있는 function 안에는 여러 원소들이 포함되어 PL이라는 결과를 산출한다. f 안에 있는 원소(x)들을 input, feature, predictor이라고 부른다. 아래의 다른 예시들도 살펴보면 이해하는데 도움이 될 것이다. 위의 예시를 간단하게 수식을 표현하면 아래와 같다. 위와 같이 수식으로 표현할 수 있으며, function 안의 x로 표현된 원소들.. 2023. 1. 19.
728x90