목차
- Predicting Performance
- Comparing Data Mining Schemes
- Predicting Probabilities
- Counting the Cost
- Evaluating Numeric Prediction
Predicting Performance
베르누이 프로세스(Bernoulli process)로 test할 수 있다.
베르누이 과정은 이산 시간의 확률 과정이고, 유한 또는 무한의 독립 확률 변수열 {\displaystyle X_{1},X_{2},X_{3},\dots }로 표현한다. 이 확률 변수 항목은 다음과 같이 구성된다.
- 각 i에 대해 {\displaystyle X_{i}}의 값이 0 또는 1이다.
- i의 모든 값에 대해 {\displaystyle X_{i}=1}일 확률 p는 항상 동일하다.
베르누이 과정은 독립적이어서 확률 분포가 동일한 베르누이 시행의 나열이다.
(출처) 위키백과
* For N trials with success rate p, the expected success rate f = S/N is a random variable with mead p and variance p(1-p)/N. For large N, the distribution of this random variable f approaches the normal distribution.(N이 충분히 클 때, 확률변수 f에 대한 분포는 정규 분포에 근사한다.)
* The probability that a random variable X, with 0 mean, lies within a certain confidence range 2z is P(-z <= X <= z) = c.
(c는 신뢰도)
* 정규 분포에서 c와 z의 값은 특정 테이블에 주어진다.
* Note that the normal distribution assumption is only valid for large N(N> 100)
Comparing Data Mining Schemes
We can compare two learning schemes by comparing the acerage error rate over several cross-validation.(cross-validation을 사용해 average error rate를 비교함으로써, 두 learning schemes를 비교할 수 있다.)
* 유의미하게 다른지 어떻게 알 수 있을까?
* t-test라 불리는 통계적 장치를 쓸 수 있다.
* Paired t-test: tenfold cross-validation을 사용한다. xi, yi는 i번째 cross-validation에 대한 서로 다른 모델의 error rate이다. di = xi - yi라 하면, di == 0이면 같은 모델이라 할 수 있다. If the means are the same(null hypothesis), the difference is 0.
* _d is a average/mean of di. We can reduce this mean of the difference to a 0-mean, unit-variance variable called the t-statistic:
Example:
- Suppose k = 10 and the confidence level is 1%
- We reject the null hypothesis if t > 3.25 or t < -3.25, and conclude that there really is a significant difference.(서로 다른 두 모델에 성능 차이가 있다! 1%만큼 다르다!)
* Non-paired t-test: 관측값이 쌍을 이루지 않을 때 어떻게 모델을 비교할 것인가.
Predicting Probabilities
0/1 Loss Function is not appropriate when a learning scheme associates a probability each prediction.(0/1 손실 함수는 모델의 성능 평가에 적합하지 않다.) 0/1 Loss Function should be taken into account when judging correctness.(이 함수는 정확성을 판단할 때만 사용되어야 한다.)
대신 회귀분석처럼 결과가 확률일 때는, 다음의 Loss Function을 사용한다. Quadratic loss function & Informational Loss Function
Counting the Cost
wrong classification에 대한 cost를 고려하지 않고 classification을 최적화하는 것은 이상한 결과를 낼 수 있다! 2-class의 경우, 4가지 가능한 결과가 있다. true positives(TP), true negatives(TN), false positives(FP), false negatives(FN). 이를 Confusion Matrix를 표현한다.
* Accuracy: (TP + TN) / (TP + TN + FP + FN)
* Recall: TP / (TP + FN)(Actual positives)
* Precision: TP / (TP + FP)(Predicted positives)
* Multi class의 경우, 각 클래스에 대한 행과 열을 가지는 confusion matrix를 가진다.
* 대각선 지표가 클수록, 좋은 모델이라고 할 수 있다.
* Kappa statistic
실제 모델에서 random predictor를 고려한다.
Cost-Sensitive Classification
- FP and FN have different costs.
- TP and TN have different benefits.
For cost-sensitive classification, Costs are ignored at trainingtime, but used at prediction time.(cost는 예측할 때만 고려된다.) The model should output the probability associated with each prediction.(모델은 각 예측과 관련된 확률을 출력해야한다.) Then the model can predict the class with the smallest expected misclassification cost.(그러면, 모델은 cost가 가장 적은 클래스를 예측할 수 있다.)
Cost-sensitive Learning
cost-sensitive classification과 반대로, 학습할 때만 cost를 고려한다. 학습 데이터는 두 클래스의 비율이 다르게 생성될 수 있다. 이때, 틀린 instance에 가중치를 주거나 양을 늘리도록 중복시켜 모델을 sensitive하게 학습시킨다. Cost에 민감하게 학습시키는 기법이다.