Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Data Science : Probability Theory

Data Science : Probability Theory

Probability theory is the mathematical framework for reasoning under uncertainty.

Ronojoy Adhikari

April 25, 2015
Tweet

More Decks by Ronojoy Adhikari

Other Decks in Research

Transcript

  1. Resources • pylearn : machine learning resources in Python (github.com/ronojoy/pylearn)

    • slides on speakerdeck : (speakerdeck.com/ronojoy/data-science-theory)
  2. Introduction and motivation • Reasoning as the basis for a

    science of data • Reasoning under certainty and under uncertainty • Boolean logic and probability theory • Rules of probability theory • Assigning probabilities - indifference and maximum entropy • Inference and learning • Is this a fair coin ? Elementary example of reasoning under uncertainty
  3. Lots of data - where is the science ? Science

    : observation - hypothesis - experiment - theory What are we observing ? What is our hypothesis ? Can we experiment ? Will there be a theory ?
  4. The scientific method “Now this is the peculiarity of scientific

    method, that when once it has become a habit of mind, that mind converts all facts whatsoever into science. The field of science is unlimited; its solid contents are endless, every group of natural phenomena, every phase of social life, every stage of past or present development is material for science. The unity of all science consists alone in its method, not in its material. The man who classifies facts of any kind whatever, who sees their mutual relation and describes their sequence, is applying the scientific method and is a man of science. The facts may belong to the past history of mankind, to the social statistics of our great cities, to the atmosphere of the most distant stars, to the digestive organs of a worm, or to the life of a scarcely visible bacillus. It is not the facts themselves which form science, but the method in which they are dealt with.”
  5. The scientific method “Now this is the peculiarity of scientific

    method, that when once it has become a habit of mind, that mind converts all facts whatsoever into science. The field of science is unlimited; its solid contents are endless, every group of natural phenomena, every phase of social life, every stage of past or present development is material for science. The unity of all science consists alone in its method, not in its material. The man who classifies facts of any kind whatever, who sees their mutual relation and describes their sequence, is applying the scientific method and is a man of science. The facts may belong to the past history of mankind, to the social statistics of our great cities, to the atmosphere of the most distant stars, to the digestive organs of a worm, or to the life of a scarcely visible bacillus. It is not the facts themselves which form science, but the method in which they are dealt with.”
  6. The scientific method “Now this is the peculiarity of scientific

    method, that when once it has become a habit of mind, that mind converts all facts whatsoever into science. The field of science is unlimited; its solid contents are endless, every group of natural phenomena, every phase of social life, every stage of past or present development is material for science. The unity of all science consists alone in its method, not in its material. The man who classifies facts of any kind whatever, who sees their mutual relation and describes their sequence, is applying the scientific method and is a man of science. The facts may belong to the past history of mankind, to the social statistics of our great cities, to the atmosphere of the most distant stars, to the digestive organs of a worm, or to the life of a scarcely visible bacillus. It is not the facts themselves which form science, but the method in which they are dealt with.”
  7. Logical reasoning Cause Possible Causes Effects or Outcomes Effects or

    Observations Deductive logic Inductive logic Bayesian probability Boolean algebra
  8. Boolean algebra • Formalization of Aristotelian logic • Propositions :

    are either TRUE or FALSE • Operations : conjunction (AND), disjunction (OR), negation (NOT) • Laws : algebraic identities between compound propositions • Ex.1 : NOT(A AND B) = (NOT A) OR (NOT B) • Ex. 2 : NOT(A OR B) = (NOT A) AND (NOT B) • Rules for reasoning consistently with certain propositions.
  9. Probability Theory • Generalization of Boolean logic • Propositions have

    a truth value p, with p = 0 (FALSE) and p = 1 (TRUE) • Operations : conjunction (AND), disjunction (OR), negation (NOT) • sum rule : P(A) + P( NOT A) = 1 • product rule : P(A AND B) = P(A|B)P(B) = P(B|A) P(A) • => P(A OR B) = P(A) + P(B) - P(A AND B) • independent => P(A|B) = P(A) ; mutually exclusive => P(A OR B) = P(A) + P(B)
  10. Assigning probabilities • Probabilities are ALWAYS conditioned on information P(A)

    = P(A | I) • Consider a set of propositions A1, A2, ... An, that are exhaustive and mutually exclusive. In the absence of any other information, the principle of indifference says that P(Ai) = 1/N (Laplace) • When additional information is available, probabilities are assigned taking the additional information into account. The principle of maximum entropy says that P should be assigned by maximizing \sum P_i log P_i, subject to the constraints that derive from the additional information. • Maximum entropy reduces to indifference when there are no constraints.
  11. Bayes theorem • P(A and B) = P(A|B) P(B) =

    P(B|A)P(A) • P(A|B) = P(B|A) P(A) / P(B) • Looks trivial but is extremely deep! • P( disease | symptom) = want to know this. • P(symptom | disease) = can estimate this (even empirically!) • P(disease | symptom) = P(symptom | disease) P (disease) / P(symptom)
  12. Is this a fair coin ? P(n1 | , N)

    = N! n1 !(N n1 )! n1 (1 )N n1 P(H) = prior P(D|H) - likelihood P( ) = (a + b) (a) (b) a 1(1 )b 1 P( |n1, N) ⇥ n1+a 1(1 )n n1+b 1 P(H|D) = posterior ⇥ = a a + b https://github.com/ronojoy/pylearn/blob/master/scripts/ex1-coin-tossing.py