본문 바로가기

Computer Science/Data Science 86

[Decision Tree] Gain Ratio Gain Ratio Information gain은 가질 수 있는 value가 더 많은 attribute에 더 많은 score를 주는 경향이 있다. 더 잘게 나눌 수록 homogeneous할 가능성이 높기 때문이다. 이는 fair하지 않기 때문에 gain ratio는 비율에 따라 나눠서 info gain을 normalize 해준다. 얻은 gain의 값에 각 value에 대한 entropy를 나누는 작업을 한다. Information gain과 마찬가지로 maximum gain ratio를 얻는 attribute가 좋다. $GainRatio(A) = \frac{Gain(A)}{SplitInfo_A(D)}$ $SplitInfo_A(D) = -\Sigma ^v _{j=1} \frac{\vert D_j \ver.. 2022. 4. 18.
[Decision Tree] Information Gain Information Gain 더 높은 information gain 값을 가지는 attribute를 test attribute로 사용한다. Entropy Entropy는 heterogeneous한 정도, 즉 혼잡도를 의미한다. Entropy의 값이 높을 수록 heterogeneous하고, 작을 수록 homogeneous함을 의미한다. Entropy = $Info(D) = -\Sigma ^m _{i=1} p_i log_2 p_i$ $m$ : class의 수 Attribute A로 나눈 후의 data set D의 entropy는 아래와 같다. 이 때 나눠지는 sample들의 개수를 고려해야 하므로 그 비율을 곱한다. $Info_A(D) = \Sigma ^v _{j=1} \frac{\vert D_j \ver.. 2022. 4. 18.
[Classification] Decision Tree Decision Tree Classification을 위해서 tree를 생성하고 그 tree에 따라 분류한다. Model(Tree) 생성 방법 top-down recursive divide-and-conquer 방식 top-down : Root부터 시작해서 test attribute를 선택하며 divicde-and-conqure : 그 attribute에 대한 기준으로 sample들을 나눈다. recursive : 이 과정을 반복해서 leaf까지 내려가며 tree를 생성한다. 해당 branch까지 내려온 모든 sample이 같은 class를 갖거나 더 이상 test attribute로 선택할 attribute가 존재하지 않을 때 recursive를 중단한다. 만약 leaf까지 내려왔는데 모든 sample.. 2022. 4. 18.
Classification/Prediction에 대한 여러가지 Issues Data에 관한 Issues Data cleaning noise를 줄이고 missing value를 채우는 preprocessing 작업 실제 데이터에는 noise나 missing value(결측치)가 존재한다. 따라서 data cleaning 작업이 필요하다. Relevance analysis (feature selection) 불필요하거나 redundant한 attribute를 제거하는 작업 많은 attribute들 중에서 어떤 것을 feature로 사용할 것인지 결정해야 한다. classification에 도움이 되는 정보만 남긴다. Data transformation 데이터를 generalize/normalize 하는 작업 주로 값이 더 큰 attribute에 대해 score를 더 주는 경우가 있.. 2022. 4. 18.
Classification, Prediction 기본 지식 Traning Data, Test data, Model Training data model construction을 위한 tuple/sample의 집합 각 sample은 여러 개(하나 이상)의 attribute들과 하나의 predefined class label을 가지고 있다. Test data accuracy evaluation을 위한 tuple/sample의 집합 각 sample은 training data와 동일한 구조의 attribute들과 하나의 predefined class label을 가지고 있다. 각 sample의 label은 정확도 계산을 위해 모델에 의해 분류된/예측된 결과와 비교된다. Model 어떤 attribute가 class를 결정했는지 설명해준다. classificat.. 2022. 4. 18.