Open jeremy886 opened 6 years ago
week 2
Note: Interesting to further explore how to find the equivalent and write down example code of the linear equations and solver functionality in Python.
https://www.safaribooksonline.com/library/view/data-science-essentials/9781680502237/f_0080.xhtml
Week 3
Mutual information: I(x; y) = H(x) - H(x|y)
Confusion matrix
actual class / prediction class | c | d |
---|---|---|
a | e=ac TP | f=ad FN |
b | g=bc FP | h=bd TN |
If independent, P(x, y) = P(x) * P(y) I(x; y) = 0
Probability of A given B: P(A, B) = P(A|B) * P(B)
To get P(B|A)
Learn from Facts: toss a coin, figure out if it's a fair or crooked coin.
A: the coin comes up tails
~A: the coin comes up heads
B: the coin is fair
~B: the coin is crooked
P(Y=B) = 0.5
P(Y=~B) = 0.5
P(X=A | Y=B) = 0.5
P(X=A| Y=~B) = 0.4
P(B|A) = P(A|B)P(B) / P(A)
P(A) = P(A, B) + P(A, ~B) = P(A | B) * P(B) + P(A | ~B) * P(~B) = .5 * .5 + .4 * .5 = .45
P( coin is fair | observe TAILs) = p(B | A) = p(A | B) P(B) / P(A) = .5 * .5 / .45 = .556
P( coin is crooked | observe TAILs) = P (~B | A) = P(A | ~B) * P(~B) / P(A) = .4 * .5 / .45 = .444
(P fair, P crooked): (.5, .5) --data: TAILs--> (.556, .444)
H(.5, .5) - H(X|Y) = H(.5, .5) - H(.556, .444) = 1 - .9909 = .0091 bits PIG = .0091 / 1 = .91 %
variance = δ**2
covariance == 0 (independent distribution)
covariance != 0
Coursera 6 weeks