3 ms·
A conditional probability is a probabilistic function. It goes from a value x to a probability distribution of Y. It is more general than a non-deterministic
by hackandthink 3y ago
A conditional probability is a probabilistic function.
It goes from a value x to a probability distribution of Y.
It is more general than a non-deterministic computation. You get a list of results with weights attached to it. (ignoring continuous distributions)
Grouping can be regarded as a non-deterministic computation.
It goes from a value x to a list of Y.
Computing averages or other aggregations from lists or distributions is another step.
https://dennybritz.com/posts/probability-monads-from-scratch/ https://dennybritz.com/posts/probability-monads-from-scratch...
https://github.com/mattearnshaw/lawvere/blob/master/pdfs/1962-the-category-of-probabilistic-mappings.pdf https://github.com/mattearnshaw/lawvere/blob/master/pdfs/196...
- alexmolas 3y ago> Grouping can be regarded as a non-deterministic computation. Can you elaborate on that? I don't see how grouping can be a non-deterministic computation. When you compute the groups of a set you always get the same ones, or am I missing something?
- hackandthink 3y agoI made that up beforehand and it may be exaggerated, I was inspired by the List Monad. The groups are deterministic. The non-determinism lies in which element of the group is then selected. "Calculate an even number" equals "Take any element from the group of even numbers" https://www.schoolofhaskell.com/school/starting-with-haskell/basics-of-haskell/13-the-list-monad#non-deterministic-computations https://www.schoolofhaskell.com/school/starting-with-haskell...
- alexmolas 3y agoYes, when you aggregate the group's values, you can have non-deterministic behaviors. Operations like "calculate an even number" can be non-deterministic, but other operations like "give me the group average" (which is what the post proposes) are deterministic. Anecdote time: some weeks ago I had a bug for this reason. I was doing a groupby + select the first element, and since the first element is not always the same I was getting some weird results. I solved it by sorting the group elements before selecting the first element.