The talk is an intro to Bayesian Inference from the point of view of a software developer rather than from the one of a mathematician. If we read a textbook about Bayesian Inference, we need to go through tow-three chapters about probability theory. This can be hard and pointless for who is just seeking a few practical examples or a few use cases. The talk is suitable for those that are not interested in the math behind such methods but want to apply them. When is Bayesian Inference useful? What’s its advantage? How can I implement it? The talk shows few use cases where Bayesian Inference is a killer feature through PyMC library.
This document is a transcript of an entrepreneurial podcast between hosts Travis and Sandra and their guest Mark del Guercio. Mark shares his personal story of starting a successful dry cleaning business at a young age, but then facing catastrophic failure when environmental regulations changed and contaminated his business sites, preventing their sale. This led to Mark losing his business and having to move back in with his parents. However, Mark was able to pivot his career into financial services and insurance, becoming very successful again. The discussion focuses on the importance of learning from failures and pivoting to new opportunities.
This document provides tips for dating a widower to make it a success. It discusses that widowers can make great partners as they likely know how to love, commit, compromise, and work through issues from their past marriage. The document encourages acknowledging that a new partner may still have feelings for their late spouse but that this does not mean less love for a new partner. It provides tips like allowing them to grieve on anniversaries and discussing expectations openly. Overall it presents widowers as potential good partners if the relationship makes one feel good and respected.
1. The document discusses four case studies of mistakes the author made in data science projects. The first case involved incorrectly predicting mail return rates without considering sample sizes. The second was backtesting a trading strategy without accounting for data leakage. The third was developing statistical software without proper testing. The fourth was incorrectly calculating an A/B test statistic without considering sample size.
2. In each case, the author explains what went wrong and the lessons learned, such as considering sample sizes, understanding where data comes from, testing software appropriately, and not compounding uncertainties when calculating statistics. The author also discusses potential pitfalls in machine learning, like incorrectly sparsifying models or using PCA before regression.
Teori Faktor Kepastian menggunakan nilai faktor kepastian (CF) untuk mengekspresikan keakuratan sebuah hipotesis berdasarkan bukti yang ada. CF dihitung dari selisih antara ukuran kepercayaan dan ketidakpercayaan terhadap suatu hipotesis, dengan nilai berkisar antara -1 hingga 1. Teori ini dapat menggabungkan pendapat dari beberapa pakar dan mempertimbangkan adanya beberapa bukti maup
This document discusses Bayesian inference and Bayes' theorem. It provides examples of how Bayesian inference can be used to calculate conditional probabilities based on new evidence or data. Specifically, it discusses using Bayesian inference to determine the probability a die is "good" based on rolling results, and the probability a woman has breast cancer based on positive or negative mammogram results.
This document discusses various forms of inexact knowledge and reasoning, including uncertainty, incomplete knowledge, defaults and beliefs, contradictory knowledge, and vague knowledge. It provides examples of how probabilistic reasoning, fuzzy logic, truth maintenance systems, certainty factors, and other approaches can be used to represent and reason with inexact knowledge. Key concepts covered include uncertainty, incomplete knowledge, defaults, beliefs, contradictory knowledge, and vague knowledge.
Probabilistic programming in python with PyMC3- John SalvatierPyData
This document summarizes probabilistic programming in Python using PyMC3. PyMC3 allows users to write probabilistic models and automatically perform Bayesian inference to estimate unknown parameters. It features a simple and clear syntax for model specification, supports advanced sampling methods for large models, and can handle tasks like time series analysis, generalized linear models, and more. The document provides examples of disaster and stock volatility models in PyMC3 and directs readers to additional resources.
This document is a transcript of an entrepreneurial podcast between hosts Travis and Sandra and their guest Mark del Guercio. Mark shares his personal story of starting a successful dry cleaning business at a young age, but then facing catastrophic failure when environmental regulations changed and contaminated his business sites, preventing their sale. This led to Mark losing his business and having to move back in with his parents. However, Mark was able to pivot his career into financial services and insurance, becoming very successful again. The discussion focuses on the importance of learning from failures and pivoting to new opportunities.
This document provides tips for dating a widower to make it a success. It discusses that widowers can make great partners as they likely know how to love, commit, compromise, and work through issues from their past marriage. The document encourages acknowledging that a new partner may still have feelings for their late spouse but that this does not mean less love for a new partner. It provides tips like allowing them to grieve on anniversaries and discussing expectations openly. Overall it presents widowers as potential good partners if the relationship makes one feel good and respected.
1. The document discusses four case studies of mistakes the author made in data science projects. The first case involved incorrectly predicting mail return rates without considering sample sizes. The second was backtesting a trading strategy without accounting for data leakage. The third was developing statistical software without proper testing. The fourth was incorrectly calculating an A/B test statistic without considering sample size.
2. In each case, the author explains what went wrong and the lessons learned, such as considering sample sizes, understanding where data comes from, testing software appropriately, and not compounding uncertainties when calculating statistics. The author also discusses potential pitfalls in machine learning, like incorrectly sparsifying models or using PCA before regression.
Teori Faktor Kepastian menggunakan nilai faktor kepastian (CF) untuk mengekspresikan keakuratan sebuah hipotesis berdasarkan bukti yang ada. CF dihitung dari selisih antara ukuran kepercayaan dan ketidakpercayaan terhadap suatu hipotesis, dengan nilai berkisar antara -1 hingga 1. Teori ini dapat menggabungkan pendapat dari beberapa pakar dan mempertimbangkan adanya beberapa bukti maup
This document discusses Bayesian inference and Bayes' theorem. It provides examples of how Bayesian inference can be used to calculate conditional probabilities based on new evidence or data. Specifically, it discusses using Bayesian inference to determine the probability a die is "good" based on rolling results, and the probability a woman has breast cancer based on positive or negative mammogram results.
This document discusses various forms of inexact knowledge and reasoning, including uncertainty, incomplete knowledge, defaults and beliefs, contradictory knowledge, and vague knowledge. It provides examples of how probabilistic reasoning, fuzzy logic, truth maintenance systems, certainty factors, and other approaches can be used to represent and reason with inexact knowledge. Key concepts covered include uncertainty, incomplete knowledge, defaults, beliefs, contradictory knowledge, and vague knowledge.
Probabilistic programming in python with PyMC3- John SalvatierPyData
This document summarizes probabilistic programming in Python using PyMC3. PyMC3 allows users to write probabilistic models and automatically perform Bayesian inference to estimate unknown parameters. It features a simple and clear syntax for model specification, supports advanced sampling methods for large models, and can handle tasks like time series analysis, generalized linear models, and more. The document provides examples of disaster and stock volatility models in PyMC3 and directs readers to additional resources.
Ed Batista, Interpersonal Dynamics (aka Touchy Feely) @StanfordBiz, Class 4: ...Ed Batista
1) This document outlines the agenda and topics for a class on interpersonal dynamics and feelings and feedback.
2) The class will discuss emotions, how they serve us individually and as a species, and how emotional and threat responses can impact feedback and relationships.
3) Students will learn models for managing feelings and threats, including the SCARF model of social threats, and will practice giving and receiving feedback through exercises with partners and groups.
A technical talk discussing how to use the Markov Chain Monte Carlo methods inPyMC3 to deliver novel Bayesian Statistical models. Our case study is how to infer the strengths of Rugby teams from the Six Nations. This talk was delivered at the University of Cambridge in 2015.
Probabilistic programming is a new approach to machine learning and data science that is currently the focus of intense academic research, including an ongoing DARPA program. If successful, probabilistic programming systems will allow sophisticated predictive models to be written by a wide range of domain experts. Before we get to the promised land, though, some basic challenges need to be addressed, including performance on real-world datasets, programming tools support, and education.
The document discusses the expert system shell CLIPS (C Language Integrated Production System). It describes what an expert system is, the typical structure of an expert system including the knowledge base and inference engine, and how CLIPS allows defining facts, rules, templates, functions, and object-oriented programming concepts like classes and instances. It also covers how CLIPS provides mechanisms for pattern matching, rule execution, and message passing between rules and objects.
What is probabilistic programming? By analogy: if functional programming is programming with first-class functions and equational reasoning, probabilistic programming is programming with first-class distributions and Bayesian inference. All computable probability distributions can be encoded as probabilistic programs, and every probabilistic program represents a probability distribution.
What does it do? It gives a concise language for specifying complex, structured statistical models, and abstracts over the implementation details of exact and approximate inference algorithms. These models can be networked, causal, hierarchical, recursive, anything: the graph structure of the program is the generative structure of the distribution.
Who's interested? Cognitive scientists, statisticians, machine-learning specialists, and artificial-intelligence researchers.
MYCIN was an early expert system developed in the 1970s to diagnose and recommend treatments for infections. It used a knowledge base of around 200 rules, certainty factors, and backward chaining to evaluate patients' symptoms and test results. MYCIN was found to match expert physician recommendations for treating infections 52% of the time in evaluations. The system helped demonstrate the potential for rule-based and probabilistic reasoning in medical expert systems.
An mea mundi soleat, ne falli tacimates eum. Summo discere adversarium per te, ad usu nullam prompta blandit, id cum quot facilis vulputate.
Nam mutat mazim legere ut, cu summo essent recteque vis, eu impetus viderer platonem est. Eos verear antiopam intellegat ex.
Omnium malorum adversarium eam ad, usu in tollit singulis conceptam, eam agam constituam temporibus ea.
The document provides tips on creating effective advertising to generate leads, including understanding your target customer, crafting the right message for your audience, and ensuring your message includes important elements such as a compelling benefit-driven headline and call to action. It discusses the importance of knowing your target market through data analysis and developing advertising strategies tailored to reach your specific customer demographic through the appropriate media channels and messaging. Effective advertising messages are outlined as focusing on benefits rather than features and including trust symbols, social proof, guarantees, and writing style changes to focus on the customer's perspective.
LuxAnthropy.com is a website that sells new and gently used designer fashion items while generating funds for philanthropic causes. It taps into Hollywood influencers and fashion houses to source inventory. Visitors can shop closets of Hollywood insiders and support charities by purchasing items on the site. The site sells shoes, handbags, apparel and accessories from both women's and men's designers.
This PowerPoint presentation introduces an organization called The Power of PowerPoint. It provides an overview of the company's history, skills, key personnel, and growth over time. Charts are included showing increasing client numbers and sales trends in different cities. The presentation encourages the audience to recognize their potential and states that the future is being made now for people living in the future. It concludes by thanking the audience and asking if they have any questions.
This PowerPoint presentation introduces an organization called The Power of PowerPoint. It provides an overview of the company's history, skills, key personnel, growth in clients and sales over time. It also analyzes customer preferences through surveys on coffee consumption in different cities. The presentation aims to showcase the company's work and potential to take on new projects that help clients succeed in the digital content market. It emphasizes that life is an adventure and encourages the audience to help shape the future.
This PowerPoint presentation introduces SlideEasy 5, which provides ready-made elements and layouts to help users build presentations. It highlights features like the slide builder, visual content creation, and the ability to create beautiful presentations within minutes. The presentation includes examples of slide layouts, services offered, projects completed, and design principles. It promotes SlideEasy's promises to care about customers, create high-quality designs, share knowledge, and ensure satisfaction.
This document contains Sonia Jones' graphic design portfolio. It includes her experience working as a graphic designer and screen printer for various companies from 2008 to present. It also lists her education in business administration and graphic design from Central Maine Community College and Region Ten Technical High School. The portfolio highlights her skills in design, layout, logos, branding, photography and software like Photoshop, Illustrator and InDesign. It contains examples of her typography, pop art, logo and graphic design work.
Creating a slide share presentation is not easy. There are many design elements involved to take into account. The examples in this slide share are design pitfalls you should avoid.
The Secret to Building Passion and Desire with Your Guy
Lots of things matter in life. Your career. Your health. Your finances. But
nothing matters quite as much as your relationships.
I mean, think about it. What's the fun of "succeeding" if there's no one
there to celebrate it with you?
Even something as simple as a beautiful sunset loses much of its
significance if there's no one by your side to enjoy it with you.
Though I should confess...
Ed Batista, Interpersonal Dynamics (aka Touchy Feely) @StanfordBiz, Class 4: ...Ed Batista
1) This document outlines the agenda and topics for a class on interpersonal dynamics and feelings and feedback.
2) The class will discuss emotions, how they serve us individually and as a species, and how emotional and threat responses can impact feedback and relationships.
3) Students will learn models for managing feelings and threats, including the SCARF model of social threats, and will practice giving and receiving feedback through exercises with partners and groups.
A technical talk discussing how to use the Markov Chain Monte Carlo methods inPyMC3 to deliver novel Bayesian Statistical models. Our case study is how to infer the strengths of Rugby teams from the Six Nations. This talk was delivered at the University of Cambridge in 2015.
Probabilistic programming is a new approach to machine learning and data science that is currently the focus of intense academic research, including an ongoing DARPA program. If successful, probabilistic programming systems will allow sophisticated predictive models to be written by a wide range of domain experts. Before we get to the promised land, though, some basic challenges need to be addressed, including performance on real-world datasets, programming tools support, and education.
The document discusses the expert system shell CLIPS (C Language Integrated Production System). It describes what an expert system is, the typical structure of an expert system including the knowledge base and inference engine, and how CLIPS allows defining facts, rules, templates, functions, and object-oriented programming concepts like classes and instances. It also covers how CLIPS provides mechanisms for pattern matching, rule execution, and message passing between rules and objects.
What is probabilistic programming? By analogy: if functional programming is programming with first-class functions and equational reasoning, probabilistic programming is programming with first-class distributions and Bayesian inference. All computable probability distributions can be encoded as probabilistic programs, and every probabilistic program represents a probability distribution.
What does it do? It gives a concise language for specifying complex, structured statistical models, and abstracts over the implementation details of exact and approximate inference algorithms. These models can be networked, causal, hierarchical, recursive, anything: the graph structure of the program is the generative structure of the distribution.
Who's interested? Cognitive scientists, statisticians, machine-learning specialists, and artificial-intelligence researchers.
MYCIN was an early expert system developed in the 1970s to diagnose and recommend treatments for infections. It used a knowledge base of around 200 rules, certainty factors, and backward chaining to evaluate patients' symptoms and test results. MYCIN was found to match expert physician recommendations for treating infections 52% of the time in evaluations. The system helped demonstrate the potential for rule-based and probabilistic reasoning in medical expert systems.
An mea mundi soleat, ne falli tacimates eum. Summo discere adversarium per te, ad usu nullam prompta blandit, id cum quot facilis vulputate.
Nam mutat mazim legere ut, cu summo essent recteque vis, eu impetus viderer platonem est. Eos verear antiopam intellegat ex.
Omnium malorum adversarium eam ad, usu in tollit singulis conceptam, eam agam constituam temporibus ea.
The document provides tips on creating effective advertising to generate leads, including understanding your target customer, crafting the right message for your audience, and ensuring your message includes important elements such as a compelling benefit-driven headline and call to action. It discusses the importance of knowing your target market through data analysis and developing advertising strategies tailored to reach your specific customer demographic through the appropriate media channels and messaging. Effective advertising messages are outlined as focusing on benefits rather than features and including trust symbols, social proof, guarantees, and writing style changes to focus on the customer's perspective.
LuxAnthropy.com is a website that sells new and gently used designer fashion items while generating funds for philanthropic causes. It taps into Hollywood influencers and fashion houses to source inventory. Visitors can shop closets of Hollywood insiders and support charities by purchasing items on the site. The site sells shoes, handbags, apparel and accessories from both women's and men's designers.
This PowerPoint presentation introduces an organization called The Power of PowerPoint. It provides an overview of the company's history, skills, key personnel, and growth over time. Charts are included showing increasing client numbers and sales trends in different cities. The presentation encourages the audience to recognize their potential and states that the future is being made now for people living in the future. It concludes by thanking the audience and asking if they have any questions.
This PowerPoint presentation introduces an organization called The Power of PowerPoint. It provides an overview of the company's history, skills, key personnel, growth in clients and sales over time. It also analyzes customer preferences through surveys on coffee consumption in different cities. The presentation aims to showcase the company's work and potential to take on new projects that help clients succeed in the digital content market. It emphasizes that life is an adventure and encourages the audience to help shape the future.
This PowerPoint presentation introduces SlideEasy 5, which provides ready-made elements and layouts to help users build presentations. It highlights features like the slide builder, visual content creation, and the ability to create beautiful presentations within minutes. The presentation includes examples of slide layouts, services offered, projects completed, and design principles. It promotes SlideEasy's promises to care about customers, create high-quality designs, share knowledge, and ensure satisfaction.
This document contains Sonia Jones' graphic design portfolio. It includes her experience working as a graphic designer and screen printer for various companies from 2008 to present. It also lists her education in business administration and graphic design from Central Maine Community College and Region Ten Technical High School. The portfolio highlights her skills in design, layout, logos, branding, photography and software like Photoshop, Illustrator and InDesign. It contains examples of her typography, pop art, logo and graphic design work.
Creating a slide share presentation is not easy. There are many design elements involved to take into account. The examples in this slide share are design pitfalls you should avoid.
The Secret to Building Passion and Desire with Your Guy
Lots of things matter in life. Your career. Your health. Your finances. But
nothing matters quite as much as your relationships.
I mean, think about it. What's the fun of "succeeding" if there's no one
there to celebrate it with you?
Even something as simple as a beautiful sunset loses much of its
significance if there's no one by your side to enjoy it with you.
Though I should confess...
Similar to Applied Bayesian Inference with PyMC (9)
What to do when you have a perfect model for your software but you are constrained by an imperfect business model?
This talk explores the challenges of bringing modelling rigour to the business and strategy levels, and talking to your non-technical counterparts in the process.
Liberarsi dai framework con i Web Component.pptxMassimo Artizzu
In Italian
Presentazione sulle feature e l'utilizzo dei Web Component nell sviluppo di pagine e applicazioni web. Racconto delle ragioni storiche dell'avvento dei Web Component. Evidenziazione dei vantaggi e delle sfide poste, indicazione delle best practices, con particolare accento sulla possibilità di usare web component per facilitare la migrazione delle proprie applicazioni verso nuovi stack tecnologici.
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...XfilesPro
Wondering how X-Sign gained popularity in a quick time span? This eSign functionality of XfilesPro DocuPrime has many advancements to offer for Salesforce users. Explore them now!
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
Microservice Teams - How the cloud changes the way we workSven Peters
A lot of technical challenges and complexity come with building a cloud-native and distributed architecture. The way we develop backend software has fundamentally changed in the last ten years. Managing a microservices architecture demands a lot of us to ensure observability and operational resiliency. But did you also change the way you run your development teams?
Sven will talk about Atlassian’s journey from a monolith to a multi-tenanted architecture and how it affected the way the engineering teams work. You will learn how we shifted to service ownership, moved to more autonomous teams (and its challenges), and established platform and enablement teams.
Project Management: The Role of Project Dashboards.pdfKarya Keeper
Project management is a crucial aspect of any organization, ensuring that projects are completed efficiently and effectively. One of the key tools used in project management is the project dashboard, which provides a comprehensive view of project progress and performance. In this article, we will explore the role of project dashboards in project management, highlighting their key features and benefits.
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...kalichargn70th171
In today's business landscape, digital integration is ubiquitous, demanding swift innovation as a necessity rather than a luxury. In a fiercely competitive market with heightened customer expectations, the timely launch of flawless digital products is crucial for both acquisition and retention—any delay risks ceding market share to competitors.
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
2. Which color will sell more?
Page A
A Tea Pot
Lorem ipsum dolor sit amet, nemore accusam mel ne, usu offendit
delicata id, idque splendide constituam ex vel. Sea in nemore impedit
singulis, vivendo sadipscing cum ea. Eum debet torquatos prodesset cu.
Mel id mollis comprehensam, nemore verear mei cu.
Mei meis iuvaret vituperata ad, ne cetero iisque singulis eum. Ex magna
latine virtute nam, ne graecis dissentias eloquentiam ius. Nam alienum
omittam no. Eu vix docendi maiestatis signiferumque, alienum officiis
delicata te pri, commodo corrumpit deterruisset eu cum. An mei
tincidunt incorrupte dissentias, prompta diceret delenit vis ad.
Sea ad sadipscing intellegebat, quod sumo mea cu, ei eos feugait alienum
nominavi. Ei vix simul possit. Recteque tincidunt incorrupte pri no, ipsum
constituam eu quo. Per ne populo quodsi persius, molestie efficiantur et
his. Munere discere vis id, te sea homero suscipiantur definitionem, quot
dicam vis ne.
BUY
Page B
A Tea Pot
Lorem ipsum dolor sit amet, nemore accusam mel ne, usu offendit
delicata id, idque splendide constituam ex vel. Sea in nemore impedit
singulis, vivendo sadipscing cum ea. Eum debet torquatos prodesset cu.
Mel id mollis comprehensam, nemore verear mei cu.
Mei meis iuvaret vituperata ad, ne cetero iisque singulis eum. Ex magna
latine virtute nam, ne graecis dissentias eloquentiam ius. Nam alienum
omittam no. Eu vix docendi maiestatis signiferumque, alienum officiis
delicata te pri, commodo corrumpit deterruisset eu cum. An mei
tincidunt incorrupte dissentias, prompta diceret delenit vis ad.
Sea ad sadipscing intellegebat, quod sumo mea cu, ei eos feugait alienum
nominavi. Ei vix simul possit. Recteque tincidunt incorrupte pri no, ipsum
constituam eu quo. Per ne populo quodsi persius, molestie efficiantur et
his. Munere discere vis id, te sea homero suscipiantur definitionem, quot
dicam vis ne.
BUY
3. Page A
A Tea Pot
Lorem ipsum dolor sit amet, nemore accusam mel ne, usu offendit
delicata id, idque splendide constituam ex vel. Sea in nemore impedit
singulis, vivendo sadipscing cum ea. Eum debet torquatos prodesset cu.
Mel id mollis comprehensam, nemore verear mei cu.
Mei meis iuvaret vituperata ad, ne cetero iisque singulis eum. Ex magna
latine virtute nam, ne graecis dissentias eloquentiam ius. Nam alienum
omittam no. Eu vix docendi maiestatis signiferumque, alienum officiis
delicata te pri, commodo corrumpit deterruisset eu cum. An mei
tincidunt incorrupte dissentias, prompta diceret delenit vis ad.
Sea ad sadipscing intellegebat, quod sumo mea cu, ei eos feugait alienum
nominavi. Ei vix simul possit. Recteque tincidunt incorrupte pri no, ipsum
constituam eu quo. Per ne populo quodsi persius, molestie efficiantur et
his. Munere discere vis id, te sea homero suscipiantur definitionem, quot
dicam vis ne.
BUY
Page B
A Tea Pot
Lorem ipsum dolor sit amet, nemore accusam mel ne, usu offendit
delicata id, idque splendide constituam ex vel. Sea in nemore impedit
singulis, vivendo sadipscing cum ea. Eum debet torquatos prodesset cu.
Mel id mollis comprehensam, nemore verear mei cu.
Mei meis iuvaret vituperata ad, ne cetero iisque singulis eum. Ex magna
latine virtute nam, ne graecis dissentias eloquentiam ius. Nam alienum
omittam no. Eu vix docendi maiestatis signiferumque, alienum officiis
delicata te pri, commodo corrumpit deterruisset eu cum. An mei
tincidunt incorrupte dissentias, prompta diceret delenit vis ad.
Sea ad sadipscing intellegebat, quod sumo mea cu, ei eos feugait alienum
nominavi. Ei vix simul possit. Recteque tincidunt incorrupte pri no, ipsum
constituam eu quo. Per ne populo quodsi persius, molestie efficiantur et
his. Munere discere vis id, te sea homero suscipiantur definitionem, quot
dicam vis ne.
BUY
#buy / N #buy / N
4. • What if N is small?
• What is N to have 90% confidence?
• What if N is different on A and B?
16. Only one difference between A and B
Page A
A Tea Pot
Lorem ipsum dolor sit amet, nemore accusam mel ne, usu offendit
delicata id, idque splendide constituam ex vel. Sea in nemore impedit
singulis, vivendo sadipscing cum ea. Eum debet torquatos prodesset cu.
Mel id mollis comprehensam, nemore verear mei cu.
Mei meis iuvaret vituperata ad, ne cetero iisque singulis eum. Ex magna
latine virtute nam, ne graecis dissentias eloquentiam ius. Nam alienum
omittam no. Eu vix docendi maiestatis signiferumque, alienum officiis
delicata te pri, commodo corrumpit deterruisset eu cum. An mei
tincidunt incorrupte dissentias, prompta diceret delenit vis ad.
Sea ad sadipscing intellegebat, quod sumo mea cu, ei eos feugait alienum
nominavi. Ei vix simul possit. Recteque tincidunt incorrupte pri no, ipsum
constituam eu quo. Per ne populo quodsi persius, molestie efficiantur et
his. Munere discere vis id, te sea homero suscipiantur definitionem, quot
dicam vis ne.
BUY
Page B
A Tea Pot
Lorem ipsum dolor sit amet, nemore accusam mel ne, usu offendit
delicata id, idque splendide constituam ex vel. Sea in nemore impedit
singulis, vivendo sadipscing cum ea. Eum debet torquatos prodesset cu.
Mel id mollis comprehensam, nemore verear mei cu.
Mei meis iuvaret vituperata ad, ne cetero iisque singulis eum. Ex magna
latine virtute nam, ne graecis dissentias eloquentiam ius. Nam alienum
omittam no. Eu vix docendi maiestatis signiferumque, alienum officiis
delicata te pri, commodo corrumpit deterruisset eu cum. An mei
tincidunt incorrupte dissentias, prompta diceret delenit vis ad.
Sea ad sadipscing intellegebat, quod sumo mea cu, ei eos feugait alienum
nominavi. Ei vix simul possit. Recteque tincidunt incorrupte pri no, ipsum
constituam eu quo. Per ne populo quodsi persius, molestie efficiantur et
his. Munere discere vis id, te sea homero suscipiantur definitionem, quot
dicam vis ne.
BUY
17. Page A
A Tea Pot
Lorem ipsum dolor sit amet, nemore accusam mel ne, usu offendit
delicata id, idque splendide constituam ex vel. Sea in nemore impedit
singulis, vivendo sadipscing cum ea. Eum debet torquatos prodesset cu.
Mel id mollis comprehensam, nemore verear mei cu.
Mei meis iuvaret vituperata ad, ne cetero iisque singulis eum. Ex magna
latine virtute nam, ne graecis dissentias eloquentiam ius. Nam alienum
omittam no. Eu vix docendi maiestatis signiferumque, alienum officiis
delicata te pri, commodo corrumpit deterruisset eu cum. An mei
tincidunt incorrupte dissentias, prompta diceret delenit vis ad.
Sea ad sadipscing intellegebat, quod sumo mea cu, ei eos feugait alienum
nominavi. Ei vix simul possit. Recteque tincidunt incorrupte pri no, ipsum
constituam eu quo. Per ne populo quodsi persius, molestie efficiantur et
his. Munere discere vis id, te sea homero suscipiantur definitionem, quot
dicam vis ne.
BUY
Page B
A Tea Pot
Lorem ipsum dolor sit amet, nemore accusam mel ne, usu offendit
delicata id, idque splendide constituam ex vel. Sea in nemore impedit
singulis, vivendo sadipscing cum ea. Eum debet torquatos prodesset cu.
Mel id mollis comprehensam, nemore verear mei cu.
Mei meis iuvaret vituperata ad, ne cetero iisque singulis eum. Ex magna
latine virtute nam, ne graecis dissentias eloquentiam ius. Nam alienum
omittam no. Eu vix docendi maiestatis signiferumque, alienum officiis
delicata te pri, commodo corrumpit deterruisset eu cum. An mei
tincidunt incorrupte dissentias, prompta diceret delenit vis ad.
Sea ad sadipscing intellegebat, quod sumo mea cu, ei eos feugait alienum
nominavi. Ei vix simul possit. Recteque tincidunt incorrupte pri no, ipsum
constituam eu quo. Per ne populo quodsi persius, molestie efficiantur et
his. Munere discere vis id, te sea homero suscipiantur definitionem, quot
dicam vis ne.
BUY
18. Assume there is
p_a
probability of clicking BUY when landing on A
p_b
probability of clicking BUY when landing on B
How to compute p_a and p_b?
19. Page A
– N_a visitors
– C_a BUY-click on page A
Page B
– N_b visitors
– C_b BUY-click on page B
22. Page A
A Tea Pot
Lorem ipsum dolor sit amet, nemore accusam mel ne, usu offendit
delicata id, idque splendide constituam ex vel. Sea in nemore impedit
singulis, vivendo sadipscing cum ea. Eum debet torquatos prodesset cu.
Mel id mollis comprehensam, nemore verear mei cu.
Mei meis iuvaret vituperata ad, ne cetero iisque singulis eum. Ex magna
latine virtute nam, ne graecis dissentias eloquentiam ius. Nam alienum
omittam no. Eu vix docendi maiestatis signiferumque, alienum officiis
delicata te pri, commodo corrumpit deterruisset eu cum. An mei
tincidunt incorrupte dissentias, prompta diceret delenit vis ad.
Sea ad sadipscing intellegebat, quod sumo mea cu, ei eos feugait alienum
nominavi. Ei vix simul possit. Recteque tincidunt incorrupte pri no, ipsum
constituam eu quo. Per ne populo quodsi persius, molestie efficiantur et
his. Munere discere vis id, te sea homero suscipiantur definitionem, quot
dicam vis ne.
BUY
30. Confidence 90% that P is between X and Y?
There is 90% probability that p_A is between
0.0373019596856 and 0.0548052806892
p_A_samples = mcmc.trace('p_A')[:]
lower_bound = np.percentile(p_A_samples, 5)
upper_bound = np.percentile(p_A_samples, 95)
print 'There is 90%% probability that p_A is between %s and %s' %
(lower_bound, upper_bound)
35. Confidence 90% that P is between X and Y?
There is 90% probability that p_A is between
0.0160966147705 and 0.114655284797
p_A_samples = mcmc.trace('p_A')[:]
lower_bound = np.percentile(p_A_samples, 5)
upper_bound = np.percentile(p_A_samples, 95)
print 'There is 90%% probability that p_A is between %s and %s' %
(lower_bound, upper_bound)
37. Does the red have a larger probability of being clicked?
Page A
A Tea Pot
Lorem ipsum dolor sit amet, nemore accusam mel ne, usu offendit
delicata id, idque splendide constituam ex vel. Sea in nemore impedit
singulis, vivendo sadipscing cum ea. Eum debet torquatos prodesset cu.
Mel id mollis comprehensam, nemore verear mei cu.
Mei meis iuvaret vituperata ad, ne cetero iisque singulis eum. Ex magna
latine virtute nam, ne graecis dissentias eloquentiam ius. Nam alienum
omittam no. Eu vix docendi maiestatis signiferumque, alienum officiis
delicata te pri, commodo corrumpit deterruisset eu cum. An mei
tincidunt incorrupte dissentias, prompta diceret delenit vis ad.
Sea ad sadipscing intellegebat, quod sumo mea cu, ei eos feugait alienum
nominavi. Ei vix simul possit. Recteque tincidunt incorrupte pri no, ipsum
constituam eu quo. Per ne populo quodsi persius, molestie efficiantur et
his. Munere discere vis id, te sea homero suscipiantur definitionem, quot
dicam vis ne.
BUY
Page B
A Tea Pot
Lorem ipsum dolor sit amet, nemore accusam mel ne, usu offendit
delicata id, idque splendide constituam ex vel. Sea in nemore impedit
singulis, vivendo sadipscing cum ea. Eum debet torquatos prodesset cu.
Mel id mollis comprehensam, nemore verear mei cu.
Mei meis iuvaret vituperata ad, ne cetero iisque singulis eum. Ex magna
latine virtute nam, ne graecis dissentias eloquentiam ius. Nam alienum
omittam no. Eu vix docendi maiestatis signiferumque, alienum officiis
delicata te pri, commodo corrumpit deterruisset eu cum. An mei
tincidunt incorrupte dissentias, prompta diceret delenit vis ad.
Sea ad sadipscing intellegebat, quod sumo mea cu, ei eos feugait alienum
nominavi. Ei vix simul possit. Recteque tincidunt incorrupte pri no, ipsum
constituam eu quo. Per ne populo quodsi persius, molestie efficiantur et
his. Munere discere vis id, te sea homero suscipiantur definitionem, quot
dicam vis ne.
BUY
57. Date HomeTeam AwayTeam FTHG FTAG FTR HTHG HTAG HTR
24/08/2013 Sampdoria Juventus 0 1 A 0 0 D
24/08/2013 Verona Milan 2 1 H 1 1 D
25/08/2013 Cagliari Atalanta 2 1 H 1 1 D
25/08/2013 Inter Genoa 2 0 H 0 0 D
25/08/2013 Lazio Udinese 2 1 H 2 0 H
25/08/2013 Livorno Roma 0 2 A 0 0 D
25/08/2013 Napoli Bologna 3 0 H 2 0 H
25/08/2013 Parma Chievo 0 0 D 0 0 D
25/08/2013 Torino Sassuolo 2 0 H 1 0 H
26/08/2013 Fiorentina Catania 2 1 H 2 1 H
31/08/2013 Chievo Napoli 2 4 A 2 2 D
31/08/2013 Juventus Lazio 4 1 H 2 1 H
01/09/2013 Atalanta Torino 2 0 H 0 0 D
01/09/2013 Bologna Sampdoria 2 2 D 1 1 D
01/09/2013 Catania Inter 0 3 A 0 1 A
01/09/2013 Genoa Fiorentina 2 5 A 0 3 A
01/09/2013 Milan Cagliari 3 1 H 2 1 H
01/09/2013 Roma Verona 3 0 H 0 0 D
01/09/2013 Sassuolo Livorno 1 4 A 0 1 A
01/09/2013 Udinese Parma 3 1 H 1 0 H
14/09/2013 Inter Juventus 1 1 D 0 0 D
14/09/2013 Napoli Atalanta 2 0 H 0 0 D
14/09/2013 Torino Milan 2 2 D 0 0 D
15/09/2013 Fiorentina Cagliari 1 1 D 0 0 D
https://datahub.io/dataset/italian-football-data-serie-a-b
64. Let’s model this
• goal: infer unknown p1, p2, TAU
• FIRST STEP OF Bayesian Inference: assign a prior
probability to different possible values of p
• what would be a good prior for p1, p2? Use
uniform:
– p1 ~ Uniform(0,1)
– p2 ~ Uniform(0,1)
– TAU ~ DiscreteUniform(1, 38)
• P(TAU=k)=1/38 for all k
65. from pymc import Uniform, DiscreteUniform, deterministic, Bernoulli, Model, MCMC
p_1 = Uniform('p_1', lower=0, upper=1)
p_2 = Uniform('p_2', lower=0, upper=1)
tau = DiscreteUniform('tau', lower=1, upper=38)
print 'Random output: ', tau.random(), tau.random(), tau.random()
Random output: 14 24 33
@deterministic
def p_(tau=tau, p_1=p_1, p_2=p_2, num_matches=38):
# concatenate p_1 and p_2 based on tau
out = np.empty(num_matches)
out[:tau] = p_1
out[tau:] = p_2
return out
66. Load Data
import pandas as pd
df = pd.read_csv('serie_a.csv', parse_dates=['Date'], date_parser=parse_date)
matches = df[(df.HomeTeam == ‘Milan’) | (df.AwayTeam == ‘Milan’)]
matches = matches.set_index(['Date'])
matches = compute_extra_columns(matches, team)
# some pandas manipulations occur here
matches[‘Win’] = … # 1 if Milan won, 0 otherwise
70. Expected Win Probability
num_matches = 38
N = tau_samples.shape[0]
expected_p_per_match = np.zeros(num_matches)
for match in range(num_matches):
ix = match < tau_samples
p_samples_match = np.concatenate([p_1_samples[ix], p_2_samples[~ix]])
expected_p_per_match[match] = np.percentile(p_samples_match, 50)
71.
72. Compute Confidence Bounds
lower_p_per_match = np.zeros(num_matches)
upper_p_per_match = np.zeros(num_matches)
for match in range(num_matches):
ix = match < tau_samples
p_samples_match = np.concatenate([p_1_samples[ix], p_2_samples[~ix]])
lower_p_per_match[match] = np.percentile(p_samples_match, 5)
upper_p_per_match[match] = np.percentile(p_samples_match, 95)
73. Bayesian returns a distribution. What have we gained? We see uncertainty in our
estimates. The wider the distribution, the less certain our posterior belief should be.
Editor's Notes
imagine to build e-commerce website
choose color
set up experiment
Interpretation of probability
Freq: probability is the frequency of event
Difficult to understand for other scenario
E.g. Presidential Elections (happen only once)
Bayes: measure of belief or confidence in an event occurring.
Assign a belief of 0 to an event: certainty NO occur
You look for bugs in your code
You are starting to believe that there may be no bugs in this code
If you think this way, then congratulations: You already are thinking Bayesian!
Bayesian inference is simply updating your beliefs after considering new evidence
a Python library for performing Bayesian analysis that is undaunted by the mathematiccal monster we have created
The code is not random; it is probabilistic in the sense that we create probability models using programming variables as the model’s components.
We go through a simple example to understand some basic features of PyMC
Only one difference between A and B: any change in dynamics can be attributed to that change
No need to be same number on A or on B
Observed frequency <> true frequency (probability)
Only for large numbers (law of large numbers)
Only one difference between A and B: any change in dynamics can be attributed to that change
Define a model (random variables)
prior probabilities i.e. our prior belief
Fit to the dataset
compute posterior probabilities
random variable which takes the value 1 with success probability of p and the value 0 with failure probability of 1-p.
What is the value of p?
random value
value not determined
obs: observations of clicking BUY
random variable but unlike p_A we observed value
argument observed to True -> value should not be changed
Only one difference between A and B: any change in dynamics can be attributed to that change
N_A > N_B
Posterior of p_B is flatter
Most of Posterior of p_A – p_B is above 0. So we are confident p_A > p_B
If this probability is too low, one can try to get more samples from B (to make it less flat).
Fitting a model means characterizing its posterior distribution somehow.
the MCMC sampler randomly updates the values of p_A, p_B, delta over a specified number of iterations (iter).
burn parameter specifies a sufficiently large number of iterations for the algorithm to converge
Recommend it
Nice intro to BI and Probabilistic Programming
assumes NO prior knowledge of Bayesian inference and probability
HOW TO: Probability applied to real examples
Was there a change in the win rate?
Define a model (random variables)
prior probabilities i.e. our prior belief
Fit to the dataset
compute posterior probabilities
random variable which takes the value 1 with success probability of p and the value 0 with failure probability of 1-p.
What is the value of p?
What is the value of p?
seems to increase at some point during observations
Let’s assume that on some day TAU during the observation period the parameter p suddenly jumps to a higher value. So, we really have two p parameters: one for the period before TAU, and one for the rest of the observation period
Define a model (random variables)
prior probabilities i.e. our prior belief
Fit to the dataset
compute posterior probabilities