전체 글
-
반복문백준 2022. 5. 18. 21:12
#1 N = int(input()) for i in range(1,10): print(N, "*", i, "=", N*i) #2 case = int(input()) for i in range(0, case): a, b = map(int, input().split()) print(a+b) #3 num = int(input()) sum = 0 for i in range(1, num+1): sum = sum+i print(sum) #4 case = int(input()) import sys for i in range(0, case): a, b = map(int, sys.stdin.readline().split()) print(a+b) #5 num = int(input()) for i in range(1, nu..
-
조건문백준 2022. 5. 18. 20:54
#1 a, b = map(int, input().split()) if a > b: print(">") elif a 90 or score ==90: print("A") elif score >80 or score ==80: print("B") elif score >70 or score ==70: print("C") elif score >60 or score ==60: print("D") else: print("F") #3 year = int(input()) if year % 4 == 0: if year % 100 != 0 or year % 400 == 0: print(1) else: print(0) else: print(0) #4 x = int(input()) y = int(input()) if x > 0 ..
-
입출력과 사칙연산백준 2022. 5. 18. 17:43
#1 print("Hello World!") #2 print("강한친구 대한육군\n강한친구 대한육군") #3 print("\\ /\\\n\ ) ( \')\n\ ( / )\n\ \\(__)|") \ /\ ) ( ') ( / ) \(__)| #4 print(" ,r\'\"7\n\ r`-_ ,\' ,/\n\ \\. \". L_r\'\n\ `~\\/\n\ |\n\ |") ,r'"7 r`-_ ,' ,/ \. ". L_r' `~\/ | | #5 a, b = map(int, input().split()) print(a+b) #6 a, b = map(int, input().split()) print(a-b) #7 a, b = map(int, input().split()) print(a*b) #8 a, b = map(i..
-
차원축소(Dimension Reduction)기계학습이론과실습 2022. 5. 16. 16:00
feature의 수가 너무 많을 경우 지도학습: 과적합 문제 비지도학습: 데이터 포인트들 간의 거리가 유사하게 됨 -> 군집화 결과가 좋지 않음 = 차원의 저주(curse of dimensionality) feature selection: 원래의 features 중에서 일부만 선택 선택되지 않은 features가 갖고 있는 정보를 최종 분석에서 사용하지 못함 feature extraction: 원래 features가 가지고 있는 정보를 사용하여 새로운 features 추출 PCA(Principal Component Analysis)는 feature extraction의 한 방법 * PC는 독립변수들이 가지고 있는 정보를 설명하는 축 먼저 고유값과 고유벡터에 대해 알아보겠다. (eigenvalue, eig..
-
Ensemble methods기계학습이론과실습 2022. 5. 11. 17:14
지금까지 Decision Tree에 대해 알아보았다. Decision Tree의 장단점은 다음과 같다. Decision Tree는 결과 해석이 직관적으로 가능해 비교적 쉽다. Decision Tree는 일반적으로 모형의 성능이 떨어진다. (=weak learner) Decision Tree의 단점을 보완하기 위해서 Ensemble methods를 사용한다. 앙상블(Ensemble)은 합주단이라는 의미를 갖고 있다. 다양한 악기가 어우러져 아름다운 소리를 낼 수 있다. Definition: To combine several (weak) learners into a stronger learner Approaches: 1) Bagging 2) Boosting 먼저 Bagging 방법에 대해 알아보겠다. Bag..
-
Decision Tree기계학습이론과실습 2022. 5. 4. 15:33
Decision Tree는 Dataset에 있는 관측치들을 독립변수의 값에 따라 종속변수의 값이 유사한 여러 개의 그룹으로 분리하고, 각 그룹에 속한 관측치들의 종속변수 값을 동일한 값으로 예측하는 알고리즘이다. 구성요소 * root node * internal node = decision node -> cut-off or cut point value -> hyper-parameter: depth * leaf node = terminal node Decision Tree Regressor - RSS(Sum of Residual Squares)를 Minimize하는 Cut-off 적용 - 예측값은 해당 그룹의 평균값 : 변수의 값을 크기에 따라 정렬 -> 연속된 두 개의 평균값을 Cut-off로 적용했을 ..
-
Clustering기계학습이론과실습 2022. 5. 4. 15:02
군집화 분석을 이해하기 위해서는 벡터에서의 유사도를 먼저 이해할 필요가 있다. 1. 유클리디안 유사도: 거리 기반 유사도로 보통 관측치의 단위가 비슷할 때 쓴다 np.linalg.norm(b-a) 2. 코사인 유사도: 각도 기준 유사도로 보통 관측치의 단위가 크게 차이가 날 때 쓴다. np.dot(a,b)/(np.linalg.norm(a)*np.linalg.norm(b)) 그 외에 Manhattan distance, Jaccard distance, Hamming distance 등이 존재한다. A. K-Means Clustering : 해당 방법은 유클리디안 거리를 사용한다 K개의 점을 선택한다. K개의 점은 각 그룹의 중심이 된다. 모든 점을 K개의 중심이 되는 점들 중 가장 가까운 점이 속한 그룹에 ..
-
Course Intro기계학습이론과실습 2022. 5. 4. 13:43
Through this course we will learn about these topics and their mathmatical principles. Supervised Learning - Linear Regression - Logistic Regression - Decision Tree - Ensemble methods - Support Vecotr Machines Unsupervised Learning - Clustering: Hierarchical Clustering, DBSCAN, K-Means, GMM - Dimension Reduction: PCA Definition of AI, ML, DL AI: "smart computer", or "intelligent computer" / Rule..