본문 바로가기
728x90

HOOAI749

[Python Examples] Matplotlib 예제코드: Horizontal Bar Chart(수평 막대 그래프) 데이터 시각화 Matplotlib 예제코드: Horizontal Bar Chart(수평 막대그래프) 데이터 시각화 포스트 난이도: HOO_Junior # Example Codes import matplotlib.pyplot as plt import numpy as np fig, ax = plt.subplots() locationName = ('Gangwon-do', 'Gyeonggi-do', 'Gyeongsangnam-do', 'Gyeongsangbuk-do', 'Busan-si') y_hd = np.arange(len(locationName)) values = [13, 1, 19, 14, 3] error = 0 ax.barh(y_hd, values, xerr=error, align='center') ax.set_yt.. 2023. 2. 15.
[미국 유학생] 미국 연말정산, 학비 세금 환급 받는 방법: 터보텍스(turbotax)/추천인 링크 포함 미국 연말정산, 학비 세금 환급받는 방법: 터보텍스(turbotax)/추천인 링크 포함 # 미국 연말 정산과 학비 환급받기 (터보텍스는 "세법상 미국 거주자(장기 유학생)"이 사용하는 것을 권장합니다.) 우선 터보텍스(turbotax) 추천인 링크가 필요한 브로들을 위해서 거두절미하고 링크를 공유한다. https://turbo.tax/cabqtqdy Save up to 20% on TurboTax I just filed my taxes with TurboTax! It was easy to use & they have real experts to help you with your taxes or even do them for you. If you use my link I can get a gift card.. 2023. 2. 11.
[C Examples] 달러를 동전으로 바꾸는 예제코드 달러를 동전으로 바꾸는 예제코드 포스트 난이도: HOO_Intern # Example Codes #include int main() { int cents, halfDollars, quarters, dimes, nickels, pennies; printf("Enter change in [cents]: "); scanf("%d",&cents); printf("The change that has been entered is %d \n",cents); halfDollars = (cents*2)/100; printf("Half dollars: %d \n",halfDollars); cents=cents - ((halfDollars*100)/2); quarters=cents/25; printf("Quarters: %.. 2023. 2. 8.
[Python Examples] 변수 선언하고 출력하기 예제 코드: myString, print() 변수 선언하고 출력하기 예제 코드: myString, print() 포스트 난이도: HOO_Intern # Example Codes myString ='my first: \n \'hello\'' print(myString) my first: 'hello' 2023. 2. 8.
[C Examples/Q&A] 체질량 지수(BMI) 계산하는 예제코드: if, else if, && 체질량 지수(BMI) 계산하는 예제코드: if, else if, && 포스트 난이도: HOO_Junior # Example code 1 #include #include int main() { int bmi, height, weight; printf("Enter the weight: "); scanf("%d",&weight); printf("Enter the height: "); scanf("%d", &height); bmi= (703*weight)/(height*height); if(bmi< 18.5) printf("Underweight"); if(18.5 2023. 2. 7.
[AI/ML Examples] Factorization criterion in action in the special case of the bivariate normal pdf Factorization criterion in action in the special case of the bivariate normal pdf 포스트 난이도: HOO_Senior # Example 1 Find the marginals (i.e., the marginal pdfs of Xand Y from the joint pdf). If you are unable to do this analytically (which is fine, nopenalties), assume μX=μY= 0,σX=σY= 1, and ρ= 0.5; specifically, use numerical integration to find the values of the marginal pdfs on a fine grid from.. 2023. 2. 6.
[AI/ML Examples] MLE with data from exponential distribution MLE with data from exponential distribution 포스트 난이도: HOO_Senior # Example LetX1, . . . , X100be independent rvs from the exponential distribution with rateλ(i.e., rate is thereciprocal of the population mean here). Nature uses the following code to generate the data: set.seed(0); x = rexp(100,10); I.e., in the game theory setup, Nature chosesλ= 10, but this is not known to the Statistician. # Ex.. 2023. 2. 6.
[C Examples] 별 모양으로 정사각형 만들기 별 모양으로 정사각형 만들기 포스트 난이도: HOO_Intern # Example codes #include #include int main() { printf("* * * * * * * * * *\n"); printf("* *\n"); printf("* *\n"); printf("* *\n"); printf("* *\n"); printf("* *\n"); printf("* *\n"); printf("* *\n"); printf("* *\n"); printf("* * * * * * * * * *\n"); printf("Posted by HOO."); return 0; } * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Pos.. 2023. 2. 1.
[C Examples] 적금 계산기 적금 계산기 포스트 난이도: HOO_Intern # Example codes #include #include int main() { float A, r; int P, t; printf("Enter inital balance\n"); scanf("%d", &P); printf("Enter Annual interest rate\n"); scanf("%f", &r); printf("Enter how many years\n"); scanf("%d", &t); A=P*(1+r*t); printf("The balance after %d years will be (%.2f $)\n", t, A); printf("Posted by HOO."); return 0; } Enter inital balance 3000 Ent.. 2023. 1. 31.
[C Examples] Circle area, circumference of circle 계산기 Circle area, circumference of circle 계산기 포스트 난이도: HOO_Intern # Example codes #include #include int main() { float area, circumference; int r; printf("Enter radius\n"); scanf("%d", &r); circumference=2*3.14*r; area=3.14*r*r; printf("Circumference of the Circle is %.2f and the Area is %.2f \n", circumference, area); printf("Posted by HOO."); return 0; } Enter radius 15 Circumference of the Circle .. 2023. 1. 31.
[C Examples] 킬로미터(Km)를 마일(Miles)로 변환하기: scaf(), %.f 킬로미터(Km)를 마일(Miles)로 변환하기: scaf(), %.f 포스트 난이도: HOO_Intern # Example codes #include #include int main() { float miles, distance; printf("Enter the distance (in Km): \n"); scanf("%f", &distance); miles= (distance/1.6); printf("%.2f Kilometers = %.2f Miles\n", distance, miles); printf("Posted by HOO."); return 0; } Enter the distance (in Km): 5600 5600.00 Kilometers = 3500.00 Miles Posted by HOO. 2023. 1. 31.
[C Examples] 총 지불액 계산기(팁, 세금 포함): float, scanf, %.f 총 지불액 계산기(팁, 세금 포함): float, scanf, %.f 포스트 난이도: HOO_Intern # Example codes #include #include int main() { int numPeople; float bill, tips, tax, billAfter, amountPerson, tipPerson; printf("총 액수를 입력하세요.\n"); scanf("%f",&bill); printf("총 사람 수를 입력하세요.\n"); scanf("%d",&numPeople); printf("Tip percentage를 입력하세요.\n"); scanf("%f",&tips); tax = bill*0.05; printf("Tax: %.2f $\n", tax); billAfter=bill+tax;.. 2023. 1. 30.
[C Examples] 도시의 인구 수 예측하기, 예제코드: scanf(), putchar() 도시의 인구 수 예측하기, 예제코드: scanf(), putchar() 포스트 난이도: HOO_Intern # Example Codes #include int main() { double hooPopulation; int t; printf("Enter a year after 2022>"); putchar ('\n'); scanf("%d",&t); hooPopulation = 88.732+(5.889*(t-2022)); printf("Predicted HOO City population for %d (in thousands): ",t); putchar ('\n'); printf("%.5f",hooPopulation); putchar ('\n'); printf("Posted by HOO"); return 0.. 2023. 1. 30.
[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.
[R] R 언어 설치(다운로드): R 4.2.2 R 언어 설치(다운로드): R 4.2.2 # R 언어 R studio를 사용하기에 앞서서 R 언어를 설치해 줘야 사용이 가능하다. 콘솔만 쓸 거면 상관이 없지만 너무나도 편리한 R studio를 포기할 사람은 없을 것이라고 본다. 아래의 링크는 R 공식 사이트이다. https://www.r-project.org/ R: The R Project for Statistical Computing www.r-project.org R 언어를 설치하기 위해서는 먼저 R를 다운로드 받아야 한다. 위에 라이언이 표시되어 있는 "download R" 또는 "CRAN"을 클릭하면 R를 다운로드할 수 있는 링크가 나온다. 나라 및 지역별로 각 R 언어가 저장되어 있어 다운로드가 가능한 링크들이 나타난다. 글쓴이는 미국에 있기.. 2023. 1. 22.
[미국 논문] 논문 쓸때 유의해야 하는 문법 표현: Nominalization, Passive voice and Non-active verbs, Expletive, Repetition, Double Descriptor 논문 쓸 때 유의해야 하는 문법 표현: Nominalization, Passive voice and Non-active verbs, Expletive, Repetition, Double Descriptor # 문법 표현 미국 논문을 작성하는 데 있어서 논문이 가져야 하는 작성 스타일이 존재한다. 그중에 가장 기본적인 게 바로 문법적 표현이다. 한국에서도 논문을 작성할 때와 일반 글을 쓸 때 쓰는 스타일이나 방식이 다르듯이 영어도 마찬가지인 셈이다. 글쓴이가 "문법"이 아니라 "문법적 표현"이라고 얘기한 이유는 일반 글과 논문이 가지는 표현의 차이가 있기 때문이다. 한마디로 문법적으로는 맞는 문장일지라도 논문에서 사용되는 표현으로는 적절하지 않을 수가 있다. 이번 포스트에서는 논문에서 사용하는 문법적 표현.. 2023. 1. 20.
[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.
[미국 논문] 모호한 접속사를 사용하지 않는다 모호한 접속사를 사용하지 않는다 # 모호한 접속사 우선 접속사라는 표현을 써본 지가 하도 오래되어서 맞는 말인지 검색해 보았다. 글쓴이처럼 미국에서 공부를 하고 있는 유학생들에게는 한글을 사용할 일도 적은데 "접속사"라는 표현을 사용하는 경우는 더더욱 드물기 때문이다. 아무튼 논문을 작성하는데 있어서 모호한 접속사를 사용하는 게 좋지 않다. 사실 논문이 아닌 다른 글들을 사용하다 보면, 접속사를 많이 사용하는 것이 글의 흐름을 유지하는데 있어서 매우 간단한 방법 중 하나이다. 특히 원인과 근거에 대한 로직이 중요한 미국식 글쓰기에서 접속사는 매우 중요한 부분이다. # 논문 작성의 우선순위는 명확한 작성이다 그럼에도 불구하고 논문을 작성하는데 있어서는 추상적이거나 모호한 접속사는 제외하고 사용하는 것이 좋.. 2023. 1. 17.
[미국 논문] Abstract의 예시는 괄호로 간단하게 나타낸다 Abstract의 예시는 괄호로 간단하게 나타낸다 # Abstract 본 내용에 들어가기 앞서서 Abstract, 한국말로는 초록 부분에 글을 작성할 때에는 예시를 줄일 필요가 있다. 초록은 논문의 전체적인 요약본의 역할을 하면서도 연구의 방향성을 나타내주는 역할을 담당한다. 그렇다 보니 보다 구체적인 예시는 본 내용에서 언급하고 자세하게 작성하면 된다. 하지만 문제는 그렇다고 해서 예시 자체를 작성하지 않을 수가 없다는 것이다. 미국 논문 스타일을 보면 정말 해당 분야를 잘 모르는 사람도 이해할 수 있게끔 작성이 되어야 한다. 그렇다보니 예시가 정말 필수적인데 이때 괄호를 통해서 간단하게 예시를 표현해 주는 것이다. (eg., sth) 위와 같이 해당 문제의 예시라는 점을 괄호를 통해서 간단하게 나타낼.. 2023. 1. 17.
[미국 논문] 부수적인 예시를 넣을 필요가 없다 부수적인 예시를 넣을 필요가 없다 # 명확한 예시가 중요하다 미국 논문을 작성하다보면 구체적이고 특정한 예시를 제시해야 하는 경우가 있다. 이때 명확한 예시가 중요하지 부수적인 예시까지 포함할 필요가 없다. 논문의 로직을 구성할 때 항상 Dummy 기준으로 작성되어야 한다고 하다 보니 여러 예시를 나열해서 설명하려는 경우가 종종 있다. (필자 또한 마찬가지이다) 하지만 나열된 여러 예시보다 하나의 구체적이고 명확한 예시가 논문 작성에 필요하며 꼭 그렇게 작성되어야 한다는 것이다. # 여러 예시는 논문의 방향성에 혼란을 야기한다 예시가 많아지다보면 논문을 읽는 사람들에게 있어서는 초점이 예시로 맞춰진다. 왜냐하면 예시라는 것 자체가 특정한 정의에 대해서 이해하기 쉽게 풀어서 작성되거나 상대적으로 비교하여 .. 2023. 1. 16.
[Blockchain] Digital Commodity (디지털 상품) Digital Commodity (디지털 상품) 포스트 난이도: HOO_Senior # 디지털 상품(Digital Commodities) Digital commodity는 한국말로 디지털 상품이라고 불리며, 가상의 환경에서 제공되는 상품을 의미한다. 디지털 상품(Digital commdoities)은 가상의 공간에서 거래되는 상품들을 의미하며 실질적으로 경제적 가치를 지니고 있는 상품들을 말한다. 예를 들면, 게임이나 노래와 같이 물리적으로 존재하지는 않지만 무형의 가치를 지니고 있으면서 인터넷상에서 거래가 되는 경제적 상품들이 디지털 상품에 해당한다. 최근에는 기존에 디지털 상품이라고 부르던 것 외에도 다양한 디지털 상품들이 생겨나기 시작했다. 대표적인 예가 바로 가상 화폐이다. 가상 화폐 또한 디지털.. 2023. 1. 15.
[Python Examples] 파이썬 타입 예제코드: type() 파이썬 타입 예제코드: type() 포스트 난이도: HOO_Intern # Example codes x= 5 type(x) int type() function의 경우에는 변수(variables)의 data type이 무엇인지를 나타내주는 역할을 수행한다. 따라서 위의 예제코드를 보면 x라는 변수가 5라는 값을 가지고 있다. 5는 ""로 구분된 문자열(string)이 아니라 숫자(int) 또는 정수로 표기가 되어 있기 때문에 우리는 int 타입인 것을 알 수 있다. 이때 type(x)을 통해서 코드를 실행해주면 x라는 타입에 대한 결과가 산출되어 int라는 결과가 출력되는 걸 확인할 수 있다. 마찬가지로 다른 예시를 살펴보도록 하자. x= "HOOAI" type(x) str 위의 코드도 방식은 이전 예제코.. 2023. 1. 13.
[Python Examples] 리스트 예제 코드: 리스트에서 int와 string 구분하여 출력하기, #isinstance() 리스트 예제 코드: 리스트에서 int와 string 구분하여 출력하기 포스트 난이도: HOO_Junior # Example codes 이전 "리스트 예제 코드" 포스트에서 int인 원소(elements)를 구분하여 산출해 내는 코드를 살펴보았다. https://whoishoo.tistory.com/554 [Python Examples] 리스트 예제 코드: 리스트에서 int만 골라서 출력하기 리스트 예제 코드: 리스트에서 int만 골라서 출력하기 포스트 난이도: HOO_Junior # Example codes LIST = [5,26,33,"5",115,120,9,"0",88,1] for x in LIST: if type(x) == int: print("number", x) number 5 number 26.. 2023. 1. 13.
[Python Examples] 파이썬 랜덤 예제 코드: np.random.choice() 파이썬 랜덤 예제 코드: np.random.choice() 포스트 난이도: HOO_Junior # Example codes import numpy as np colors = ['black', 'white'] np.random.choice(colors, p=[0.75,0.25], size=10) array(['black', 'black', 'black', 'white', 'black', 'black', 'white', 'black', 'white', 'white'], dtype=' 2023. 1. 13.
[Python Examples] 리스트 예제 코드: 리스트에서 int만 골라서 출력하기 리스트 예제 코드: 리스트에서 int만 골라서 출력하기 포스트 난이도: HOO_Junior # Example codes LIST = [5,26,33,"5",115,120,9,"0",88,1] for x in LIST: if type(x) == int: print("number", x) number 5 number 26 number 33 number 115 number 120 number 9 number 88 number 1 리스트(List)의 경우에는 int와 string 타입을 모두 하나의 리스트에 저장할 수 있다. 따라서 특정 타입에 해당하는 원소(elements)들만 골라서 출력하거나 별도로 산출해내고 싶다면 위의 예제 코드를 참고하면 된다. 위의 예제코드를 살펴보면 for문과 if문을 사용하여 간.. 2023. 1. 13.
728x90