concept observation in category probabilistic programming

appears as: n observation, An observation, observations, observation, observation, The observation, observations
Practical Probabilistic Programming

This is an excerpt from Manning's book Practical Probabilistic Programming.

2.  Given an observation that today’s greeting is “Hello, world!” infer whether today is sunny.

3.  Learn from an observation that today’s greeting is “Hello, world!” to predict tomorrow’s greeting.

You also saw another method related to observations:

greetingToday.unobserve()

This removes the observation on greetingToday (if it had one), so that no random executions are ruled out. As a result, there will be no effect from evidence about greetingToday on the probabilities of other elements.

By the way, an observation is just a special case of a condition in which you require that an element take on a single particular value. To summarize the methods associated with conditions:

  • setCondition is a method on an element that takes a predicate as an argument. The predicate must be a function from the element’s value type to a Boolean. The setCondition method makes this predicate the only condition on the element, removing existing conditions and observations.
  • addCondition is also a method on an element that takes a predicate as an argument that must be a function from the element’s value type to a Boolean. The addCondition method adds this predicate to any existing conditions and observations.
  • removeConditions is a method on an element that removes all conditions and observations from the element.
  • You’re going to be extending this model and running more queries with different evidence, so you’ll want to remove the observation on the variable greetingToday. You can do this with the following command:

    Figure 8.2. A hidden Markov model. Confident is a hidden state variable, and Possession represents an observation. The hidden state variables make a Markov chain, and the observation depends only on the hidden state at that time point.