Successfully reported this slideshow.
Upcoming SlideShare
×

# Bayesian Probabilistic Algorithms and Human Sciences for Modeling and Predicting Behaviors. Gabriele Lami - Elif Lab Srl

44 views

Published on

Tech 5. May 18th 2018. Data Driven Innovation 2018. Engineering Department, Univeristy of Roma Tre

Published in: Data & Analytics
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

### Bayesian Probabilistic Algorithms and Human Sciences for Modeling and Predicting Behaviors. Gabriele Lami - Elif Lab Srl

1. 1. Gabriele Lami - Founder Elif Lab Roma - 18 Maggio Data Driven Innovation Bayesian Probabilistic Algorithms and Human Sciences for Modeling and Predicting Behaviors www.eliflab.com
2. 2. www.eliflab.com Presentation ▪ INTRODUCTION - BAYESIAN MODELS ▪ HOW WE USE THEM IN ELIF LAB ▪ EXAMPLE: INFERENCE ▪ EXAMPLE: IMAGE ANALYSIS ▪ EXAMPLE: DATA GENERATION ▪ HOW EASY ARE THEY TO USE? ▪ CONCLUSION Predictable quote: “Probability does not exist” Bruno de Finetti
3. 3. www.eliflab.com Bayesian Models and social science Social science is the study of people and their relationships and interactions in society. There are several models to predict the behavior of individuals and groups. Many individual problems have one or more models with varying degrees of effectiveness. Like logic, probabilistic models provide tools to reason and make inductive hypotheses about phenomena whose precise structure is not known and where it is difficult to give a quantitative value to some variables.
4. 4. www.eliflab.com Bayesian Models Bayesian methods are tools that allow us to structure a probabilistic model. In a Bayesian model we have: - observable quantities (our data) - unknown quantities (statistical parameters, missing data) The goal is to estimate the unknown quantities by knowing the data and some characteristics of the unknown quantities.
5. 5. www.eliflab.com Bayesian Models A Bayesian analysis must: - state reasonable opinions about the plausibility of the different variables (a priori probability) - Use experimental data to define conditional probabilities (likelihood) It combines the two sources to give a final verdict (a posteriori probability). The combination is obtained by using Bayes theorem.
6. 6. www.eliflab.com Bayesian Models Bayesian methods have been applied to different disciplines: - Medicine epidemiology - Genetics - Ecology - Environmental Sciences - Social and political sciences - Finance - Archeology
7. 7. www.eliflab.com Bayesian Models Bayesian inference - Flexible to adapt to particular situations - Efficient use of available evidence - Effective in providing quantitative summaries - There is a vast literature and many models ready for different types of problems
8. 8. www.eliflab.com How we use them in Elif Lab Two main areas: - Inference and reasoning on data - Generative Models
9. 9. www.eliflab.com Better to know inaccurate information rather to ignore it completely. In general, getting more raw data on customers/users/etc is not an advantage if it doesn’t not answer any question. It is more useful to conjecture about potential behaviors and test ideas against data. In many cases we also have few and incomplete data. Inference and reasoning on data
10. 10. www.eliflab.com Generative models You can generate data compatible with a probabilistic model Useful to: - Test algorithms, models (understand if my algorithm captures the information for which it was thought) - Test systems (test them with plausible data, eg. millions of users with certain characteristics) - Generate content when interacting with users (eg. AI for chatbot)
11. 11. www.eliflab.com Examples 3 small examples: - Real estate - Image recognition - Generative model + inference when analyzing receipts
12. 12. www.eliflab.com Example - Real estate Inferring preferences from user behavior. User U can filter house on the website by area: - Brera - Navigli - Milan City Center (includes both Brera and Navigli and other areas as well) There are 3 types of house: - Loft, Two rooms apartment, Single room
13. 13. www.eliflab.com Example - Real estate Milano City Center: shows results from the three types with the same probability Brera: mainly offers lofts (90% prob.) and single rooms (10% prob.) Navigli: mainly offers two-room apartments (90% prob.) and single rooms (10% prob.) U is a regular user. What can we infer if we see that he chooses "Milano City Center"?
14. 14. www.eliflab.com The model leads us to think that U is interested in a single room even if the a priori probability of the three types when selecting Milano City Center is uniform. The result of the inference implicitly takes into account the counterfactual alternatives. The choice not to select the other two possibilities affects the posterior probability. Example - Real estate
15. 15. www.eliflab.com Image classifiers that use neural networks are high performing but they need an extensive training set. Although there are many datasets available, the training phase is expensive and not always easy to control. In specific cases, it is difficult to drive the training, the context knowledge can lead to faster hybrid algorithms. Example - Image recognition
16. 16. www.eliflab.com Example - Image recognition Neural Net + Bayes man-woman classifier In the example, we use official pictures of the Members of the Parliament (it’s not the brand new Italian Parliament). We can exploit a legitimate prejudice: the people in the picture follow a formal and predictable dress code. A very fast neural network (a bit imprecise) represents each image with tags. https://pjreddie.com/darknet/tiny-darknet/ Tiny Darknet
17. 17. www.eliflab.com Some of the tags are representative of the features that we can wire into a model such as “male vs female”: - male: Windsor tie, bow tie, suit, trench coat, lab coat, academic gown, trench coat, bolo tie - female: cardigan, fur coat, neck brace, pajama, poncho, stole, maillot, wig, jersey, trench coat In absence of a training set we can build a probabilistic model that uses our prejudice. To define the a priori probability we assume that the parliament counts about 50% women and 50% men. Example - Image recognition
18. 18. www.eliflab.com Example - Image recognition
19. 19. www.eliflab.com Example - Image recognition This step gives us an excellent classification that we can refine further by creating a training set both to: - estimate the model parameters or - train a machine learning - neural net algorithm
20. 20. www.eliflab.com Example - Receipts We want to build a generative model to create a (simplified) dataset of potential receipts starting from some hidden variables: - n-people, vegan, owner of animals We can use this dataset: - to understand how our model can be represented with concrete cases and have it tested by a group of people to understand if they correctly infer the variables (model validation) - to infer the value of n-variables in presence of real receipts (the model can give us a forecast even in presence of a single receipt or when basic data are uncertain)
21. 21. www.eliflab.com Example - Receipts { n. people: 3, vegan: true, has pet: true } ------------------ kleenex x 1 dog food cans apple pears celery ------------------ kleenex x 1 salad salad celery { n. people: 2, vegan: false, has pet: false } ------------------ kleenex x 3 pig beef ------------------ kleenex x 1 turkey beef veal { n. people: 2, vegan: false, has pet: true } ------------------ kleenex x 1 celery turkey beef ------------------ kleenex x 1 cat food cans turkey chicken { n. people: 4, vegan: true, has pet: true } ------------------ kleenex x 2 apple salad salad ------------------ kleenex x 1 salad salad celery { n. people: 4, vegan: false, has pet: true } ------------------ kleenex x 3 dog food cans veal veal salad ------------------ kleenex x 2 dog food cans turkey beef
22. 22. www.eliflab.com Example - Receipts A use-case scenario for this model: - I want to open a shop - I have no initial data but I know what data I can obtain later on - I have strategies (eg. vegan discounts) and I want to implement them from day 1 also because I know that with many customers I will have only one chance to “conquer” them.
23. 23. www.eliflab.com HOW EASY ARE THEY TO USE? They are not as simple as some ML algorithms but are very useful to clarify ideas. Strong expertise in probability theory is needed. In terms of calculation they are now tractable thanks to faster CPUs and numerical methods like Markov chain Monte-Carlo (MCMC).
24. 24. www.eliflab.com HOW EASY ARE THEY TO USE? Useful languages - tools: - Stan (mc-stan.org) - Webppl (webppl.org) - Pymc3 (docs.pymc.io) - Winbugs - Openbugs
25. 25. Gabriele Lami ELIF LAB srl http://www.eliflab.com Mail to: gabriele@eliflab.com