본문 바로가기

카테고리 338

[Classification] Rule-based Classification IF-THEN Rules 모델이 if-then과 같은 rule의 형태로 나타난다. "IF age = youth AND student = yes THEN buys_computer = yes"와 같은 형태이다. rule antecedent = rule precondition IF 문 안에 있는 조건 예시 : "age = youth AND student = yes" rule consequent IF의 결과 THEN절 예시 : "buys_computer = yes" Coverage, Accuracy coverage attribute의 값이 antecedent와 일치하는 샘플의 수 training sample 중에서 몇개가 cover 되는가 $coverage(R) = n_{covers} / |D|$ accurac.. 2022. 4. 18.
[Classification] Bayesian Classification Bayesian Classification 특징 statistical classifier bayes theorem에 기반을 둔 statistical classifier이다. Probabilistic prediction을 수행한다.(확률적으로 예측을 한다.) comparable performance Naive bayesian classifier는 decision tree나 neural network에 대해 comparable한 성능을 보인다. Incremental 미리 mining한 knowledge가 새로 들어온 정보에 의해 찾아진 knowledge와 쉽게 combine될 수 있다. scratch에서 다시 training하는 것보다 combine하는 것이 훨씬 빠르다. Bayesian Theorem ev.. 2022. 4. 18.
[Decision Tree] Gini Index Gini Index Information gain과 마찬가지로 더 homogeneous하게 나뉘도록 한다. Gini index는 일반적으로 attribute가 binary value를 가질 때만을 고려한다. 따라서 value를 binary하게 묶어서 classification을 해야 한다. Gini Gini의 값이 더 클수록 heterogenity하다는 것을 의미하므로 gini의 값은 작게 해야 한다. $gini(D) = 1 - \Sigma ^n _{j=1} p^2 _j$ $p_j$ : j라는 class에 속할 확률 * Info(D) = $-\Sigma ^n _{j=1} p_j log_2 p_j$ 따라서 dataset $D$가 attribute A로 인해 $D_1$과 $D_2$로 나뉘었을 때의 $gini.. 2022. 4. 18.
[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.