<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Robbie Geoghegan on Medium]]></title>
        <description><![CDATA[Stories by Robbie Geoghegan on Medium]]></description>
        <link>https://medium.com/@bondicrypto?source=rss-240750323b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BF8zfH93brReUoB_h7bH6g@2x.jpeg</url>
            <title>Stories by Robbie Geoghegan on Medium</title>
            <link>https://medium.com/@bondicrypto?source=rss-240750323b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 11:32:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bondicrypto/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Your End-to-End Product Analytics Strategy]]></title>
            <link>https://medium.com/data-science/your-end-to-end-product-analytics-strategy-648ecfa586c2?source=rss-240750323b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/648ecfa586c2</guid>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[product-analytics]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[editors-pick]]></category>
            <dc:creator><![CDATA[Robbie Geoghegan]]></dc:creator>
            <pubDate>Tue, 28 May 2024 10:38:01 GMT</pubDate>
            <atom:updated>2024-06-02T00:39:57.840Z</atom:updated>
            <content:encoded><![CDATA[<h3>What gets measured gets managed</h3><p>“What gets measured gets managed” was coined by Peter Drucker, regarded as the father of modern management, in 1954. It is an often quoted saying which is actually part of a larger, and I think more powerful quote “What gets measured gets managed — even when it’s pointless to measure and manage it, and even if it harms the purpose of the organization to do so.”</p><p>Drucker’s insight underscores that, while gathering and measuring data is essential, the real challenge lies in identifying and prioritizing the right metrics that will drive a business in the right direction. By focusing on and prioritizing the right metrics, you can ensure that what gets measured and managed is truly impactful.</p><p>This blog focuses on product analytics in technology companies, however this idea rings true for all businesses and types of analytics. Below is a summary of what I’ve learnt and applied working as a data professional in a start-up (<a href="https://www.linkedin.com/company/digivizer/posts/?feedView=all">Digivizer</a>), a scale-up (<a href="https://www.linkedin.com/company/immutable-1/posts/?feedView=all">Immutable</a>), and a big tech company (<a href="https://www.linkedin.com/company/meta/posts/?feedView=all">Facebook</a>) across a range of different products.</p><h3>How should you prioritize metrics?</h3><p>The most important metrics for a company change over time. Uber was not profitable for around 15 years, yet the company is considered one of the most successful businesses in recent time. Why? Uber focused intensely on rapid growth in its initial years rather than immediate profitability. The company prioritized metrics like user growth and user retention to establish a dominant presence in the ride-sharing market. Then, once Uber became the dominant ride-sharing company, its focus shifted towards profitability and financial sustainability. It, like many others, anchored their metrics to the stages of the product lifecycle.</p><p>You should prioritize metrics based on the product lifecycle stages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10tIwSr6bMIS4Mi7FXItqA.png" /><figcaption>Product Lifecycle Stages (Image by Author)</figcaption></figure><p>The metrics you focus on during each stage should help answer the urgent problems that each stage presents. The tactical problems can vary but will derive from the following high level questions:</p><ul><li>Stage 1 — Introduction: Do we have product-market-fit?</li><li>Stage 2 — Growth: How do we scale effectively?</li><li>Stage 3 — Maturity: How can we be profitable?</li><li>Stage 4 — Decline: How do we maintain user interest and slow decline?</li></ul><h3>Stage 1 — Introduction: Do we have product-market-fit?</h3><p>The first and most crucial stage in the product lifecycle is the Introduction stage, where the primary focus is on achieving product-market-fit. At this stage, product owners must determine whether their product meets a genuine market need and resonates with the target audience. Understanding product-market-fit involves assessing whether early adopters are not only using the product but also finding value in it. Being confident in product-market-fit sets the foundation for future growth and scalability.</p><p>There are 3 metrics that can provide clarity on whether you have achieved product-market-fit. These are, in order of importance:</p><ol><li><strong>Retention:</strong> Do users find value in the product? <strong>Example metrics:</strong> D30 Retention, Cohort Retention Curves.</li><li><strong>Active Users:</strong> How many users does the product have? Is this increasing? <strong>Example metrics:</strong> Daily Active Users (DAU), Monthly Active Users (MAU), Growth Accounting.</li><li><strong>Stickiness:</strong> Is the product engaging and used frequently? <strong>Example metrics:</strong> DAU/MAU, Activity Frequency Histogram (sometimes called L28 Histogram).</li></ol><p>Used together, these three metrics can quantitatively measure whether there is product-market-fit or point to the most critical product issue. There are 5 potential scenarios you will fall into:</p><ol><li><strong>No long-term retention and low user growth (worst case):</strong> In this scenario there is no product-market-fit. Users are not returning to use the product and there is a small market. This requires large changes in the product and/or the target market.</li><li><strong>No long-term retention but high user growth:</strong> This is the leaky bucket problem. Users are being acquired, using the product for a short period, but all eventually churn. Focus here is on fixing retention and slowing down growth.</li><li><strong>Long-term retention but low user growth:</strong> Focus in this scenario is to either adjust the acquisition funnel to improve user growth or, if the market proves to be small, pivot to a larger market.</li><li><strong>Long-term retention, high user growth, but low stickiness:</strong> This is a utility product that users find value in, but are using infrequently. Examples include tax preparation apps, travel websites and event ticketing sites. Focus should be exploring new features that make the product more engaging.</li><li><strong>Long-term retention, high user growth, and high stickiness (ideal state):</strong> Users are returning to the product, using it frequently and the user numbers are growing. This shows product-market-fit.</li></ol><p>Once an organization has confidence in product-market-fit, the attention can shift to growth. This approach avoids spending large amounts on user acquisition only to have to pivot the product or market, or have the majority of users churn.</p><h3>Stage 2 — Growth: How do we scale effectively?</h3><p>The Growth stage is where a product has the potential to move from promising to dominant. A perfect example of effective scaling is Facebook’s famous “8 friends in 10 days” rule. By using funnel analysis and experimentation, Facebook discovered that new users who connected with at least 8 friends within their first 10 days were far more likely to remain active on the platform. This insight led to focused efforts on optimizing user onboarding and encouraging friend connections, significantly boosting user retention and stickiness. In this stage, the key question is: how do we scale effectively while maintaining product quality and user satisfaction?</p><p>Analytics in this stage should broaden to include 3 types:</p><ol><li><strong>User Journey Analysis:</strong> How do we optimize the user experience? <strong>Example metrics:</strong> Conversion Rate, Time to Convert, Funnels.</li><li><strong>Experimentation:</strong> How can we determine whether a change will positively improve key metrics? <strong>Example methods:</strong> A/B Testing, Multivariate Testing.</li><li><strong>‘Aha’ Analysis:</strong> What is the moment that causes a step-change in a users retention and stickiness. <strong>Example metrics:</strong> A combination of user journey analysis, experimentation and product-market-fit metrics.</li></ol><p>When implementing user journey analysis, less is more. The temptation may be to instrument every page and every button in a product, but this can often be onerous for engineering to implement and difficult to maintain. Instead, start with just a beginning and end event — these two events will allow you to calculate a conversion rate and a time to convert. Expand beyond two events to only include critical steps in a user journey. Ensure that events capture user segments such as device, operating system and location.</p><p>Experimentation is a muscle that requires exercise. You should start building this capability early in a product and company’s lifecycle because it is more difficult to implement than a set of metrics. Build the muscle by involving product, engineering and data teams in experiment design. Experimentation is not only crucial in ‘Stage 2 — Growth’ but should remain a fundamental part of analytics throughout the rest of the product lifecycle.</p><p>‘Aha’ Analysis helps identify pivotal moments that can turbocharge growth. These are the key interactions where users realize the product’s value, leading to loyalty and stickiness. Facebook’s 8 friends in 10 days was their users ‘aha’ moment. This analysis requires analysts to explore a variety of potential characteristics and can be difficult to identify and distil down to a simple ‘aha’ moment. Be sure to use the <a href="https://www.linkedin.com/pulse/what-i-learned-mckinsey-part-3-how-hypothesis-driven-devin-kasper/">hypothesis driven approach</a> to avoid boiling the ocean.</p><h3>Stage 3 — Maturity: How can we be profitable?</h3><p>In the Maturity stage, the focus shifts from rapid growth to optimizing for profitability and long-term sustainability. This phase is about refining the product, maximizing efficiency, and ensuring the business remains competitive. Companies like Apple, Netflix and Amazon have successfully navigated this stage by honing in on cost management, increasing user revenue, and exploring new revenue streams.</p><p>Focus in this stage shifts to:</p><ol><li><strong>Monetization Metrics:</strong> How can we be profitable while maintaining a high-quality product and satisfied customer base? <strong>Example metrics:</strong> Customer Acquisition Cost (CAC), Customer Lifetime Value (LTV), LTV:CAC Ratio, Monthly Recurring Revenue (MRR).</li></ol><p>Monetization metrics have clear objectives in terms of trying to increase revenue and decrease costs. Marketing and Go-To-Market teams often own CAC reduction and product teams often own LTV and MRR improvement. Strategies can range from optimizing advertising spend, reducing time to close sales deals through to cross-selling and bundling products for existing users. Broadly, a LTV:CAC ratio of 3:1 to 4:1 is often used as a target for B2B software companies while B2C targets are closer to 2.5:1.</p><h3>Stage 4 — Decline: How do we maintain user interest and slow decline?</h3><p>“Your margin is my opportunity” — Jeff Bezos. As products mature, profitability inevitably declines. Competitors identify your opportunity and increase competition, existing users migrate to substitutes and new technologies, and markets become saturated, offering little growth. In this phase, maintaining the existing user base becomes paramount.</p><p>In Stage 4, there are a broad set of useful metrics that can be adopted. Some key types are:</p><ul><li><strong>Churn Prediction Modelling:</strong> Can we identify users likely to churn and intervene? <strong>Example models:</strong> Logistic Regression, Tree Models, Neural Networks.</li><li><strong>Power User Analysis:</strong> What can we learn from the most engaged users? <strong>Example metrics:</strong> Stickiness, Feature Usage, Transaction Volume.</li><li><strong>Root Cause Analysis:</strong> What are the root cause drivers of key metrics? <strong>Example analysis:</strong> Quarterly Business Reviews, Issue Driver Trees.</li></ul><p>By creating churn prediction models and analyzing the feature importance, characteristics of users who are likely to churn can be identified and intervention measures deployed. Given new user growth has slowed, retaining existing users is critical. This analysis may also help resurrect previously churned users too.</p><p>Power user analysis seeks to understand the most engaged users and their characteristics. These users are the highest priority to retain, and have the product-usage behavior that would ideally be shared across all users. Look for users active every day, who spend long periods of time in the product, who use the most features and who spend the most. Deploy measures, such as loyalty programs, to retain these users and identify pathways to increase the number of power users.</p><p>Root cause analysis is essential for delving into specific problem areas within a mature product. Given the complexity and scale of products at this lifecycle stage, having the capability to conduct bespoke deep dives into issues is vital. This type of analysis helps uncover the underlying drivers of key metrics, provides confidence in product changes that are costly to implement and can help untangle the interdependent measures across the product ecosystem.</p><p>A product or company who finds themselves in this final stage may choose to create new products and enter new markets. At that point, the cycle begins again and the focus shifts back to product-market-fit at the start of this blog.</p><h3>Conclusion</h3><p>“Focus is about saying no.” — Steve Jobs. Product analytics is a bottomless pit of potential metrics, dimensions and visualizations. To effectively use product analytics, companies must prioritize metrics down to a few focus areas at any one time. These metrics can be supported by a range of other measures, but must have the following:</p><ul><li>Teams aligned on which metrics should be prioritized</li><li>Teams who deeply understand the definition of key metrics</li><li>Metrics that are tied to a key product question</li><li>A tangible action which can be taken to improve the metric</li></ul><p>This can be achieved by prioritizing the right metrics at each product lifecycle stage — Introduction, Growth, Maturity, and Decline. From achieving product-market fit to scaling effectively, optimizing for profitability, and maintaining user interest, each phase demands a clear focus on the most relevant problems to solve.</p><p>Remember, it’s not about measuring everything; it’s about measuring what matters. In the words of Steve Jobs, let’s say no to the noise and yes to what truly drives our products forward.</p><h3>Addendum</h3><p>I avoided listing too many specific metrics in the sections above and only provided some example metrics for each product lifecycle stage. Instead I focused on the over-arching themes to focus analytics against. But, if you are looking for the long list of options, there are some good resources linked below.</p><ul><li><a href="https://huryn.medium.com/product-metrics-the-ultimate-guide-00e3201a6303">Product Metrics: The Ultimate Guide</a></li><li><a href="https://sacks.substack.com/p/the-saas-metrics-that-matter">The SaaS Metrics That Matter</a></li><li><a href="https://andremourapm.medium.com/product-analytics-metrics-comprehensive-guide-for-growth-c1c30f9157a">Product Analytics Metrics: Comprehensive Guide for Growth</a></li><li><a href="https://amplitude.com/blog/product-metrics-guide">15 Important Product Metrics You Should Be Tracking</a></li><li><a href="https://userpilot.com/blog/product-analytics-metrics/">Product Analytics Metrics: What To Track &amp; How To Optimize Them?</a></li><li><a href="https://www.fullview.io/blog/product-metrics">15 Important Product Metrics You Should Track, How &amp; Why</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=648ecfa586c2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/your-end-to-end-product-analytics-strategy-648ecfa586c2">Your End-to-End Product Analytics Strategy</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Reasons Why Blockchain Will Revolutionize AI-Generated Content]]></title>
            <link>https://bondicrypto.medium.com/5-reasons-why-blockchain-will-revolutionize-ai-generated-content-6efcbd6bb79?source=rss-240750323b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/6efcbd6bb79</guid>
            <category><![CDATA[ai-generated-content]]></category>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[decentralization]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Robbie Geoghegan]]></dc:creator>
            <pubDate>Wed, 14 Dec 2022 23:58:28 GMT</pubDate>
            <atom:updated>2022-12-15T00:00:56.359Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3pVe_Lx-dp2aC3cj.png" /></figure><p>Blockchain technology has the potential to revolutionize the way we think about and interact with artificially generated content created by AI. Here are five key reasons why blockchain will be important for this type of content:</p><ol><li>Blockchain provides a secure and transparent way to verify the ownership and authenticity of AI-generated content. By using blockchain-based digital tokens called non-fungible tokens (NFTs), creators of AI-generated content can easily prove that their work is original and ownership can be tracked and verified. This can help to prevent the spread of counterfeits and plagiarized works, protecting the rights of creators and ensuring the integrity of the content.</li><li>Blockchain allows for the creation of decentralized marketplaces for AI-generated content. These marketplaces can be accessed by anyone with an internet connection, providing a global platform for creators of AI-generated content to sell their work and for buyers to discover and purchase unique and valuable pieces. The use of blockchain-based smart contracts can also help to automate the buying and selling process, reducing the need for intermediaries and enabling seamless transactions.</li><li>Blockchain can enable new ways of monetizing AI-generated content. By using blockchain-based tokens, creators of AI-generated content can easily receive payment for their work, either through direct sales or through the use of decentralized finance (DeFi) protocols that allow for the creation of new forms of income streams. This can provide creators with new opportunities to earn revenue from their creations and help to support the development of the AI-generated content ecosystem.</li><li>Blockchain can help to foster collaboration and creativity in the creation of AI-generated content. By using blockchain-based tools and platforms, creators can easily share their work with others and collaborate on new projects. This can help to accelerate the development of the AI-generated content space and foster a sense of community among creators.</li><li>Blockchain can provide a new level of security and privacy for AI-generated content. By using blockchain-based technologies, creators of AI-generated content can protect their work from unauthorized access and ensure that their data remains private and secure. This can help to safeguard against potential misuse or abuse of AI-generated content and provide creators with peace of mind.</li></ol><p>Overall, blockchain technology has the potential to greatly enhance the way we think about and interact with AI-generated content. By providing secure and transparent ownership verification, enabling decentralized marketplaces, enabling new forms of monetization, fostering collaboration, and providing enhanced security and privacy, blockchain has the potential to greatly benefit the creators and users of AI-generated content.</p><h4>Support me by buying my children’s book: <a href="https://t.co/MqawDdMQ2X">mybook.to/atozofweb3</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6efcbd6bb79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimistic and Zero-Knowlege Proof Rollups: The Future of Scalability and Privacy on Ethereum]]></title>
            <link>https://bondicrypto.medium.com/optimistic-and-zero-knowlege-proof-rollups-the-future-of-scalability-and-privacy-on-ethereum-1b311a9bf9e?source=rss-240750323b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b311a9bf9e</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[optimistic-rollup]]></category>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <category><![CDATA[immutable-x]]></category>
            <dc:creator><![CDATA[Robbie Geoghegan]]></dc:creator>
            <pubDate>Sat, 10 Dec 2022 14:19:16 GMT</pubDate>
            <atom:updated>2022-12-10T14:19:16.949Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MZ36yYKnNJF3QeL4.jpg" /></figure><p>Optimistic and zero-knowledge proof rollups are two types of layer 2 solutions that have gained traction in the Ethereum community as a way to improve the scalability of the network. These solutions aim to move some transactions off of the main blockchain, known as layer 1, and onto separate, secondary blockchains known as layer 2, in order to reduce congestion and lower fees.</p><p>Optimistic rollups use a technique called “optimistic concurrency” to allow transactions to be processed off of the main chain without needing to be confirmed on-chain. This allows for faster and cheaper transactions, as they are not subject to the same fees and confirmation times as on-chain transactions.</p><p>For example, an optimistic rollup may allow users to conduct multiple transactions off-chain, and then submit a single on-chain transaction to the main chain that includes the results of all of the off-chain transactions. This reduces the number of on-chain transactions and therefore the amount of congestion on the main chain.</p><p>However, this approach relies on the assumption that the off-chain transactions are valid, and therefore requires a mechanism to ensure that invalid transactions are not included in the on-chain transaction. This is typically done through the use of a fraud-proof mechanism, which allows any user to challenge an invalid transaction and have it overturned.</p><p>Here’s a code snippet demonstrating how this works:</p><pre>// create a new optimistic rollup<br>const rollup = new OptimisticRollup();<br>// conduct transactions off-chain<br>rollup.transact(...);<br>rollup.transact(...);<br>// submit a single on-chain transaction that includes the results of all off-chain transactions<br>rollup.submitBatch(...);<br>// if a transaction is found to be invalid, any user can challenge it and have it overturned<br>rollup.challengeTransaction(...);</pre><p>Zero-knowledge proof rollups, on the other hand, use a technique called “zero-knowledge proofs” to allow transactions to be processed off-chain without revealing the details of the transactions to the main chain. This allows for greater privacy, as the main chain is not aware of the specifics of the off-chain transactions.</p><p>For example, a zero-knowledge proof rollup may allow users to conduct private transactions off-chain, and then submit a single on-chain transaction to the main chain that includes a proof that the transactions are valid without revealing any details about the transactions themselves. This allows for both scalability and privacy, as the main chain is not burdened with processing the individual transactions and the transactions themselves remain private.</p><p>Here’s a code snippet demonstrating how this works:</p><pre>// create a new zero-knowledge proof rollup<br>const rollup = new ZKPRollup();<br>// conduct private transactions off-chain<br>rollup.transact(...);<br>rollup.transact(...);<br>// submit a single on-chain transaction that includes a proof of the validity of the off-chain transactions<br>rollup.submitBatch(...);</pre><p>Optimistic and zero-knowledge proof rollups offer significant advantages over traditional on-chain transactions, as they allow for greater scalability and privacy without sacrificing security or decentralization. However, they also come with their own challenges and limitations, and it will be important for the Ethereum community to continue working on these solutions in order to fully realize their potential.</p><h4>Support me by buying my children’s book: <a href="https://t.co/MqawDdMQ2X">mybook.to/atozofweb3</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b311a9bf9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to run better and more intuitive A/B tests using Bayesian statistics]]></title>
            <link>https://medium.com/data-science/how-to-run-better-and-more-intuitive-a-b-tests-using-bayesian-statistics-480acf4b8679?source=rss-240750323b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/480acf4b8679</guid>
            <category><![CDATA[bayesian-statistics]]></category>
            <category><![CDATA[markov-chains]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ab-test]]></category>
            <category><![CDATA[ab-testing]]></category>
            <dc:creator><![CDATA[Robbie Geoghegan]]></dc:creator>
            <pubDate>Sun, 03 Jan 2021 20:53:04 GMT</pubDate>
            <atom:updated>2022-10-13T05:29:53.605Z</atom:updated>
            <content:encoded><![CDATA[<h4>A guide to Bayesian A/B testing with examples and code</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/235/1*F5FgLQ12mLBMMByUCNdHhQ.jpeg" /></figure><h4>Why you should use Bayesian A/B Tests instead of traditional approaches</h4><p>A/B testing is one of the most useful statistical techniques used in technology, marketing and research today. Its value is that A/B testing allows you to determine causation, while most analysis only uncovers correlation (i.e. the old adage “correlation not causation”). Despite the power and prevalence of A/B testing, the vast majority follow a single methodology based on t-tests that draws from the frequentist school of statistics. This note will walk through an alternative approach using the Bayesian school of statistics. This approach returns more intuitive results than the traditional, frequentist approach as well as some useful, additional insights.</p><p>The traditional, frequentist approach uses hypotheses as the framework for an A/B test. The null hypothesis is often the status quo, e.g. mean of A is equal to mean of B, and the alternative hypothesis tests whether there is a difference, e.g. mean of A is larger than mean of B. A confidence level, e.g. 5%, is selected and the experiment can have one of two conclusions:</p><ol><li>We reject the null hypothesis and accept the alternative hypothesis with 95% confidence, e.g. mean of A is larger than mean of B, or</li><li>We do not reject the null hypothesis with 95% confidence, i.e. we can make no conclusion about the difference in means between A and B.</li></ol><p>This sort of language isn’t how we tend to speak in business and can be difficult to understand for people less familiar with A/B testing. In particular, the second conclusion doesn’t provide much insight; having spent time and money to run a test you are only able to conclude that no conclusion is possible. (For more information about this approach check-out my previous post about <a href="https://medium.com/@robbiegeoghegan/implementing-a-b-tests-in-python-514e9eb5b3a1">implementing A/B tests in Python</a>).</p><p>The Bayesian approach instead focuses on probabilities. If testing the same example above, the null hypothesis being mean of A is equal to mean of B, the Bayesian method calculates the estimated difference in means as well as the probability one is larger than the other — rather than just whether the difference in means is 0. In my opinion, the Bayesian approach is superior to the frequentist approach because it can effectively accept and reject the null hypothesis with a specific probability. This approach makes for more useful recommendations. Two example conclusions (analogous to the frequentist conclusions) are:</p><ol><li>Mean A has a 99% probability of being larger than Mean B (this example would have rejected the null hypothesis)</li><li>Mean A has a 65% probability of being larger than Mean B (this example would not have rejected the null hypothesis)</li></ol><p>This sort of language gives a sense of how probable the conclusions are so that decision makers are empowered to choose their own risk tolerance and it avoids situations where the null hypothesis cannot be rejected and no conclusion drawn.</p><p>Even more useful is that it calculates the estimated difference between means. Together this means a possible conclusion from a Bayesian test is “Mean A is estimated to be 0.8 units larger than Mean B and there is an 83% probability Mean A is larger than Mean B”. As a bonus, the Bayesian approach also enables comparisons between variances of A and B and inherently manages for outliers.</p><p>The drawback to the Bayesian approach is that the mathematics underpinning it can be more challenging. A good understanding of Bayesian statistics and Markov chain Monte Carlo sampling is helpful but not completely critical.</p><p>The following sections walk through an example of how to use the Bayesian approach for A/B testing and code examples in R.</p><h4>Overview of data for the A/B test</h4><p>To demonstrate the Bayesian approach I’ll use data from a set of surveys I performed in early 2020. The surveys comprised 13 questions around 3 themes regarding respondents’ opinions on the measures implemented to combat Coronavirus (4 questions), respondents’ approval of the government response to Coronavirus (3 questions) and general household activity questions (5 questions). A full list of questions is included <a href="https://github.com/RobbieGeoghegan/bayesian_abtesting/blob/main/Survey%20Questions.pdf"><strong>here</strong></a>. For this example we’ll focus on questions that had a numerical answer such as “How many hours a day are you spending with your family members or roommates?”</p><p>The surveying was designed to comprise 6 similar but distinct survey versions. The purpose of running these slightly different surveys was to A/B test whether the differences between them caused statistically different results. The difference between each survey was either the ordering of questions or the way questions were phrased in either a positive or negative way. An example of a positively worded vs negatively is:</p><ul><li>Positive: For how long do you expect the government <strong>advised</strong> social distancing to last beyond today?</li><li>Negative: For how long do you expect the government <strong>mandated</strong> social distancing to last beyond today?</li></ul><p>The table below shows a summary of the different survey versions. 291 survey responses were recorded in total comprising 45–47 responses for each of the survey versions. This means the results of Survey 1 can be compared with Survey 3 and Survey 5 for differences in ordering and with Survey 2 for differences in wording.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xjSGUO274-ShT7uw5yd0sg.png" /><figcaption>Overview of Survey Versions</figcaption></figure><h4>Bayesian Analysis</h4><p>The following analysis is largely based on the 2012 research paper “<a href="https://cran.r-project.org/web/packages/BEST/vignettes/BEST.pdf">Bayesian Estimation Supersedes the t Test</a>” by Kruschke and the R package BEST. Code is available in my <a href="https://github.com/RobbieGeoghegan/bayesian_abtesting"><strong>Github</strong></a>.</p><p>This Bayesian technique, as with any Bayesian estimation, draws on a set of prior beliefs which are updated with evidence from data to return a set of posterior distributions. The following analysis uses a t distribution and Markov Chain Monte Carlo algorithm per Kruschke - 2012 and a noncommittal prior that has limited impact on the posterior distribution. The noncommittal prior has a minimal impact on the posterior distributions which is useful for this study as there was no baseline or set of prior beliefs this study could easily compare against. This methodology is also effective for managing outliers and required adjusting for only one data point that was an error.</p><p>If the previous paragraph is a bit complex, don’t worry. You can still go through the steps below and get an easy to interpret output. To learn more, read the paper by <a href="https://cran.r-project.org/web/packages/BEST/vignettes/BEST.pdf">Kruschke</a>.</p><p><strong>Step 1: Load packages and data</strong></p><p>First step is to install the required packages. We will be using the BEST package that uses the JAGS package. <a href="https://sourceforge.net/projects/mcmc-jags/files/">Download JAGS </a>first prior to running BEST. Next install BEST. Once this is all completed, load the packages.</p><p>Also load in the data and set it up for analysis. We’re using survey_data_v2.csv which can be found <a href="https://github.com/RobbieGeoghegan/bayesian_abtesting/blob/main/survey_data_v2.csv">here</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89adc981f4af4d132a8f86a73fc88e30/href">https://medium.com/media/89adc981f4af4d132a8f86a73fc88e30/href</a></iframe><p><strong>Step 2: Create the function for Bayesian analysis</strong></p><p>Next we want to create a function that will allow us to choose which survey versions are to be compared and which survey question the test will compare. The function runs a Markov chain Monte Carlo sampling method that constructs a posterior distribution of our test, i.e. the probability one mean is larger than the other and the estimated difference in means.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/287b488777a4b9a04ebe4f7bd59eb0be/href">https://medium.com/media/287b488777a4b9a04ebe4f7bd59eb0be/href</a></iframe><p><strong>Step 3: Run test</strong></p><p>Finally, select the two sets of data to compare. In this example we will use survey version 1 and 2, and compare question 2. Change the function variables to test different surveys and questions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b004b81c639e761c769337934c7a71a6/href">https://medium.com/media/b004b81c639e761c769337934c7a71a6/href</a></iframe><p><strong>Step 4: Interpret output</strong></p><p>After running the above code a pop-up will show the following output. It mainly shows histograms of 100,000 credible parameter-value combinations that are representative of the posterior distribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*JJmfBczY32YBktTOzYjUiQ.jpeg" /><figcaption>Output from Bayesian A/B Test</figcaption></figure><p>The most important output for A/B testing is the mid-right distribution that shows the difference of means. For our example, it shows that on average Mean A is 0.214 units larger than Mean B and that Mean A has an 82.9% probability of being larger than Mean B. This result is the main conclusion for the A/B test. Note, a traditional t-test would have simply returned the result that we can’t reject the null hypothesis at the 95% level of confidence.</p><p>The other output shows other useful information for interpreting the data. The two top-right graphs with y as the axis show the actual distribution of test data. The other figures show the posterior distributions. The five histograms on left hand side figures show the individual posteriors corresponding to the five prior histograms. The bottom-right graphs show comparisons between the groups A and B.</p><h4>Key takeaways</h4><p>The Bayesian approach to A/B testing has three key benefits over the traditional, frequentist approach:</p><ol><li>A more intuitive set of results, e.g. Mean A has an 82.9% chance of being larger than Mean B.</li><li>Includes the size of the difference between A and B, e.g. Mean A is estimated to be 0.214 units larger than Mean B.</li><li>Is not constrained by a result where the null hypothesis is not rejected.</li></ol><p>These benefits combine for more useful and intuitive recommendations that empower decision makings to better understand test results and select their own level of risk.</p><h4>Support me by buying my children’s book: <a href="https://t.co/MqawDdMQ2X">mybook.to/atozofweb3</a></h4><h4>Github Repository</h4><p><a href="https://github.com/bondicrypto/bayesian_abtesting">https://github.com/bondicrypto/bayesian_abtesting</a></p><h4>References</h4><p>[1] Kruschke, John K. “Bayesian Estimation Supersedes the t Test.” Journal of Experimental Psychology . Vol. 142, no. 3, 2012, pg. 573–603, accessed 03 January 2021, &lt;https://cran.r-project.org/web/packages/BEST/vignettes/BEST.pdf&gt;</p><p>[2] Gallo, Amy 2017. A Refresher on A/B Testing , Harvard Business Review, accessed 03 January 2021, &lt;https://hbr.org/2017/06/a-refresher-on-ab-testing&gt;</p><p>[3] Hussain, Noor Zainab and Sangameswaran, S. 2018, Global advertising expenditure to grow 4.5 percent in 2018: Zenith , Reuters, accessed 03 January 2021, &lt;https://www.reuters.com/article/us-advertising-forecast/global-advertising-expenditure-to-grow-4–5-percent-in-2018-zenith-idUSKCN1M30XT&gt;</p><p>[4] Lavorini, Vincenzo, Bayesian A/B Testing with Python: the easy guide, Towards Data Science, accessed 03 January 2021,&lt;https://towardsdatascience.com/bayesian-a-b-testing-with-python-the-easy-guide-d638f89e0b8a&gt;</p><p>[5] Mazareanu, E. 2019, Market research in U.S. — Statistics &amp; Facts , Statista, accessed 03 January 2021, &lt;https://www.statista.com/topics/4974/market-research-in-us/&gt;.</p><p>[6] NSS 2016. Bayesian Statistics explained to Beginners in Simple English , Analytics Vidhya, accessed 03 January 2021, &lt;https://www.analyticsvidhya.com/blog/2016/06/bayesian-statistics-beginners-simple-english/&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=480acf4b8679" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/how-to-run-better-and-more-intuitive-a-b-tests-using-bayesian-statistics-480acf4b8679">How to run better and more intuitive A/B tests using Bayesian statistics</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing A/B Tests in Python]]></title>
            <link>https://bondicrypto.medium.com/implementing-a-b-tests-in-python-514e9eb5b3a1?source=rss-240750323b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/514e9eb5b3a1</guid>
            <category><![CDATA[experiment]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ab-test]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Robbie Geoghegan]]></dc:creator>
            <pubDate>Mon, 20 Jan 2020 07:50:30 GMT</pubDate>
            <atom:updated>2022-10-13T05:28:40.832Z</atom:updated>
            <content:encoded><![CDATA[<h4>A quick guide to experiment design and implementation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3w7ha4K0Sg3wxp4GWgtpkQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@jdent?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jason Dent</a> on <a href="https://unsplash.com/s/photos/comparison?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>A/B testing is one of the most important tools for optimizing most things we interact with on our computers, phones and tablets. From website layouts to social media ads and product features, every button, banner and call to action has probably been A/B tested. And these tests can be extremely granular; Google famously tested “<a href="https://www.theguardian.com/technology/2012/jul/16/marissa-mayer-appointment-mean-yahoo?newsfeed=true">40 shades of blue</a>” to decide what shade of blue should be used for links on the Google and Gmail landing pages.</p><p>I recently completed the Udacity course “<a href="https://www.udacity.com/course/ab-testing--ud257">A/B Testing by Google — Online Experiment Design and Analysis</a>” and wanted to share some of my key takeaways as well as how you can implement A/B testing using Python.</p><h3>What is A/B Testing?</h3><p>A/B testing is a general methodology used online when testing product changes and new features. You take two sets of users, show one set of users the changed product (experiment group) and show the second set of users the original product or set of features (control group). You then compare the two groups to determine which version of the product is better.</p><p>A/B Testing is important because it:</p><ul><li>Removes the need for guessing or relying on intuition</li><li>Provides accurate answers quickly</li><li>Allows for rapid iteration on ideas</li><li>Establishes causal relationships — not just correlations</li></ul><p>A/B testing works best when testing incremental changes, such as UX changes, new features, ranking and page load times. Generally there needs to be a material amount of users that enable statistical inference and experiments that can be completed within a reasonable amount of time.</p><p>A/B testing doesn’t work well when testing major changes, like new products, new branding or completely new user experiences. In these cases there may be novelty effects that drive higher than normal engagement or emotional responses that cause users to resist a change initially. The re-branding of Instagram is a great example of a bad use case for A/B testing which initially caused a major negative emotional response. Additionally, A/B tests on products that are purchased infrequently and have long lead times is a bad idea — waiting to measure the repurchase rate of customer’s buying houses is going to blow out experiment timelines.</p><h3>Designing an A/B Test</h3><h4>1. Research</h4><p>Before diving into any experiment, do some research. Research can help you design an experiment, ensure you use best practices and may even unearth results of similar experiments. There are several useful data sources that may help design or support an experiment:</p><ol><li><strong>External Data and Research:</strong> the adage “if you’ve thought of it, someone’s probably tried it” is true for experiments; doing some research may reveal the insights you need or at least provide ideas for experiment design</li><li><strong>Historical Data:</strong> retrospective analysis is cheap and easy and can provide insight into historical correlations (but not causation!)</li><li><strong>User Experience Research:</strong> actually getting to see how a user interacts with a product can be invaluable for setting up and testing an experiment</li><li><strong>Focus Groups:</strong> while not accessible for most analysts, focus groups can be great for testing major changes and new products</li><li><strong>Surveys:</strong> surveys can be effective for gathering information that is not revealed online</li></ol><h4>2. Choose Metrics</h4><p>Metric choice is, unsurprisingly, fundamental to successful A/B testing. Many common experiments have clear, best practice metrics to use however every company faces its own nuances and priorities that should be considered when choosing metrics; developing the metrics should leverage experience, domain knowledge and exploratory data analysis. My experience is that metrics work best when cascaded top-down from a company or business unit strategy. This way there is a clear link between the goals of the experiment and the goals of the company. This approach means experiments can anchor to one or two clear metrics (e.g. customer conversions or number of active users) that are simple to report and understandable to all stakeholders.</p><p>Having one or two key metrics is usually not enough though. Most decision makers will want to understand what has driven change, and so key metrics should be supported by more detailed metrics that help explain results. One framework that can provide this explainability is tracking metrics across the user journey or customer funnel. Having metrics across these frameworks helps clearly identify where changes have occurred and where additional experimentation and attention could be focused.</p><p>Four categories of metrics should be considered when designing an experiment, namely:</p><ol><li><strong>Sums and counts </strong>— e.g. how many cookies visit a webpage</li><li><strong>Distributed metrics such as mean, median and quartiles</strong> — e.g. what is the mean page load time</li><li><strong>Probability and rates</strong> — e.g. clickthrough rates</li><li><strong>Ratios</strong> — e.g. ratio of the probability of a revenue generating click to the probability of any click</li></ol><h4>3. Define Metrics</h4><p>Once you have decided on a set of metrics, you then need to specifically define the metrics. This step seems simple on the surface until you begin to dig into your metrics. For example, the number of active users is a core metric used by most technology companies — but what does this actually mean? When defining this metric some considerations would include:</p><ul><li>What is the time period for a user to be active? Is someone active who used the product today, in the last 7 days, in the last month?</li><li>What activity constitutes active? Is it logging in, spending a certain amount of time using the product? What if the activity is only an automatic notification?</li><li>Does how active the user is matter, e.g. one user spends 10 seconds per day vs another user who spends 5 hours per day?</li><li>Are we measuring paying and non-paying users differently?</li></ul><p>Many metrics have industry defined standards which can be leveraged for experiments, but these questions need to be fleshed out upfront so that everyone is clear on exactly what is being considered and how to implement the experiment.</p><h4>4. Determine Sample Size Required</h4><p>Next we want to figure out how many data points will be required to run an experiment. There are four test parameters that need to be set to enable the calculation of a suitable sample size:</p><ol><li><strong>Baseline rate</strong> — an estimate of the metric being analyzed before making any changes</li><li><strong>Practical significance level </strong>— the minimum change to the baseline rate that is useful to the business, for example an increase in the conversion rate of 0.001% may not be worth the effort required to make the change whereas a 2% change will be</li><li><strong>Confidence level </strong>— also called significance level is the probability that the null hypothesis (experiment and control are the same) is rejected when it shouldn’t be</li><li><strong>Sensitivity </strong>— the probability that the null hypothesis is not rejected when it should be</li></ol><p>The baseline rate can be estimated using historical data, the practical significance level will depend on what makes sense to the business and the confidence level and sensitivity are generally set at 95% and 80% respectively but can be adjusted to suit different experiments or business needs.</p><p>Once these are set, the sample size required can be calculated statistically using a calculator such as <a href="https://www.evanmiller.org/ab-testing/sample-size.html">this</a>.</p><h4>5. Finalize Experiment Design</h4><p>Armed with well-defined metrics and sample size requirements, the final step in experiment design is to consider the practical elements of conducting an experiment. Some things to keep in mind for this step is deciding:</p><ul><li>When the experiment should run (e.g. every day or only business days) and how long the experiment should run (e.g. 1 day or 1 week)</li><li>How many users to expose to the experiment per day, where exposing fewer users means longer experiment time periods</li><li>How to account for the learning effect i.e. allow for users to learn the changes before measuring the impact of a change</li><li>What tools will be used to capture data, such as Google Analytics</li></ul><p>Before running any experiments you should also conduct some tests to make sure there are no bugs that will throw experiment results, such as issues with certain browsers, devices or operating systems. It is also very important to ensure users are selected randomly when being assigned into the control and experiment groups.</p><h3>Implementing an A/B Test using Python</h3><p>The real difficulty in conducting A/B tests is designing the experiment and gathering the data. Once you have done these steps the analysis itself follows standard statistical significance tests. To demonstrate how to conduct an A/B test I’ve downloaded a public dataset from Kaggle available <a href="https://www.kaggle.com/zhangluyuan/ab-testing">here</a>, which is testing the conversion rates of two groups (control and treatment) exposed to different landing pages. The dataset comprises twenty-nine thousand rows of datapoints, access to the Python code outlined below can be found on my Github <a href="https://github.com/RobbieGeoghegan/AB_Testing">here</a>.</p><p>For this example, I’ll test the null hypothesis that the probability of conversion in the treatment group minus the probability of conversion in the control group <strong>equals zero</strong>. And set the alternative hypothesis to be that the probability of conversion in the treatment group minus the probability of conversion in the control group <strong>does not equal zero</strong>.</p><h4>1. Clean Data</h4><p>As with any analysis, the first step is to clean up the data that has been collected. This step is important to ensure that the data aligns with the metric definitions determined during the experiment design.</p><p>You should start by running some sanity checks to make sure the experiment results reflect the initial design, e.g. did roughly an equal number of users see the old and new landing page or are the conversion rates in the realm of possibilities.</p><p>I found one issue in this dataset, that some users in both groups were exposed to the wrong landing page. The control group should have been exposed to the old landing page while the treatment group should have been exposed to the new page. I dropped the almost 4,000 rows where this issue was present.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/75ea0da6b8da0e276ba17ae29398cfae/href">https://medium.com/media/75ea0da6b8da0e276ba17ae29398cfae/href</a></iframe><h4>2. Input Test Parameters and Check Sample Size is Large Enough</h4><p>As mentioned in the “Designing an A/B Test, Section 4 — Determine Sample Size Required” there are four test parameters to set: the baseline rate, practical significance level, confidence level and sensitivity. I used the control group probability as a proxy for the baseline significance level and set the practical significance level, confidence level and sensitivity to 1%, 95% and 80% respectively. Using these values I calculated the minimum sample size required for each test group to make sure there was sufficient data to draw statistically robust conclusions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4312b8adabbccc566cdae8e06480ae4d/href">https://medium.com/media/4312b8adabbccc566cdae8e06480ae4d/href</a></iframe><p>The minimum sample size of 17,209 is slightly less than the 17,489 users in the control group and 17,264 users in the treatment group and is therefore sufficient to conduct the hypothesis testing.</p><h4>3. Run A/B Test</h4><p>Finally, we can run the A/B Test, or more specifically, test whether we can reject the null hypothesis (that the two groups have the same conversion rate) with 95% confidence. To do this we calculate a pooled probability and pooled standard error, a margin of error and the upper and lower bounds of <br>the confidence interval. If these terms are unfamiliar its worth working through the modules in the <a href="https://www.udacity.com/course/ab-testing--ud257">Udacity course about A/B Testing</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e567b4f11d49a3c5d9be37bed0e06390/href">https://medium.com/media/e567b4f11d49a3c5d9be37bed0e06390/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e01579406912555b74c5e20d59286ba3/href">https://medium.com/media/e01579406912555b74c5e20d59286ba3/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c25a2ba580e2c89bf09c317bde523338/href">https://medium.com/media/c25a2ba580e2c89bf09c317bde523338/href</a></iframe><p>In this example the confidence interval is between -0.39% and 0.08%. Given the minimum level defined in the practical significance level is 1%, we could only reject the null hypothesis if the confidence interval lower bound was above 1%. Therefore we cannot reject the null hypothesis and conclude which landing page drives more conversions.</p><h4>4. Reducing random chance and managing small sample sizes</h4><p>The above approach should provide a starting point for conducting A/B testing in Python, however you should be mindful that as you begin running more and parallel experiments a 95% confidence interval will sometimes reject the null hypothesis due to random chance. Another issue that can arise will be when you may be unable to gather sufficient data points, such as on a low traffic website.</p><p>One solution for this is to use bootstrapping, a technique that samples the original dataset with replacement to create new and unique datasets. It assumes that the original dataset is a fairly good reflection of the population as a whole so therefore sampling with replacement roughly simulates random sampling from the population.</p><p>By bootstrapping the data, you can run the same test multiple times to reduce the chance of randomly rejecting the null hypothesis. Additionally, it can enable you to create larger sample sets that may be needed for hypothesis testing.</p><h4>Support me by buying my children’s book: <a href="https://t.co/MqawDdMQ2X">mybook.to/atozofweb3</a></h4><p>If you’d like to expand your understanding of A/B testing further, see my blog: <a href="https://towardsdatascience.com/how-to-run-better-and-more-intuitive-a-b-tests-using-bayesian-statistics-480acf4b8679">How to run better and more intuitive A/B tests using Bayesian statistics</a>.</p><h3>Github Repository</h3><p><a href="https://github.com/bondicrypto/AB_Testing">GitHub - bondicrypto/AB_Testing: Implementing A/B Tests in Python</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=514e9eb5b3a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Download Twitter Data with 10 Lines of Code]]></title>
            <link>https://bondicrypto.medium.com/download-twitter-data-with-10-lines-of-code-42eb2ba1ab0f?source=rss-240750323b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/42eb2ba1ab0f</guid>
            <category><![CDATA[social-media]]></category>
            <category><![CDATA[twitter-data]]></category>
            <category><![CDATA[twitter]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Robbie Geoghegan]]></dc:creator>
            <pubDate>Tue, 31 Dec 2019 21:16:03 GMT</pubDate>
            <atom:updated>2022-10-13T05:27:27.474Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Using the Python package “GetOldTweets3” to access Twitter Data — no developer license needed.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*od2o74mBdjx23D8QcgHM0Q.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@konkarampelas?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Kon Karampelas</a> on <a href="https://unsplash.com/s/photos/twitter?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>I should start out by saying that the most robust approach for downloading Twitter data is to go to the source, sign up for a developer license with Twitter and access their API directly using <a href="https://www.tweepy.org/">Tweepy</a>. However there is a much faster way to get your hands on Twitter data.</p><p>This guide is instead intended for those wanting to do one of the following:</p><ul><li>Conduct some quick and simple analysis with Twitter data (this code can be executed in less than 10 minutes)</li><li>Access Tweets older than 1 week (the Twitter API only serves Tweets from the past week)</li><li>Download a large volume of Tweets (Twitter API limits the number of Tweets you can download after around 3,000)</li></ul><p>The below guide will show how to download Twitter data using the Python package “GetOldTweets3” (documentation can be found <a href="https://pypi.org/project/GetOldTweets3/">here</a>). This package allows you to set many useful filters for more targeted Tweet downloads including filtering by keywords, Twitter usernames, location and date ranges. To get started install the package.</p><pre>pip install GetOldTweets3</pre><p><strong>FILTERING BY KEYWORD AND LOCATION</strong></p><p>First define what keyword and location to filter Tweets by, include date ranges and the maximum number of tweets.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e516432461cf8e577a80a29e22cd35f/href">https://medium.com/media/7e516432461cf8e577a80a29e22cd35f/href</a></iframe><p>Next use the package functions to download the Twitter data. Set up a DataFrame with the Twitter information.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6b48f6992262cf538536ce729e246b4a/href">https://medium.com/media/6b48f6992262cf538536ce729e246b4a/href</a></iframe><p>Specific Twitter information needs to be extracted from the filtered data we’ve stored in the DataFrame above. We can extract several data points for each Tweet, including:</p><ul><li>Tweet text</li><li>Username</li><li>Date of Tweet</li><li>Hashtags</li><li>Links to each Tweet</li><li>Retweets</li><li>Favorites</li><li>Mentions</li></ul><p>Let’s define a function to extract text, dates, hashtags and links to Tweets.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47006b005394b44978c5ea21111be630/href">https://medium.com/media/47006b005394b44978c5ea21111be630/href</a></iframe><p>Finally execute the get_twitter_info function to return a DataFrame containing the 10 tweets we searched for with columns for each of the data points we extracted above.</p><p><strong>FILTERING BY USERNAME</strong></p><p>The package also enables you to filter by specific usernames in a similar way to keywords and locations. Simply define the username and run the code below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4fe512dc686d1bd44f43ead163ac2cc1/href">https://medium.com/media/4fe512dc686d1bd44f43ead163ac2cc1/href</a></iframe><p><strong>FILTERING BY MULTIPLE LOCATIONS + EXPORT TO CSV</strong></p><p>To gather tweets from multiple locations we can build a simple loop that leverages what we’ve defined above. First define a list of the locations of interest; useful if you want to analyze multiple cities or if you are searching variations of a specific location (e.g. New York, NY, Big Apple).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d85bd1d258d43544266c6877fb8d25b/href">https://medium.com/media/8d85bd1d258d43544266c6877fb8d25b/href</a></iframe><p><strong>CONCLUSION</strong></p><p>While this package isn’t perfect in its data coverage of tweets, it enables quick and easy access to Twitter data using Python. Furthermore it has some advantages to the Twitter API I outlined in the introduction. The full Python code is accessible at my Github. I hope you enjoy!</p><h4>Support me by buying my children’s book: <a href="https://t.co/MqawDdMQ2X">mybook.to/atozofweb3</a></h4><p><strong>GITHUB REPOSITORY</strong></p><p><a href="https://github.com/bondicrypto/Get_Old_Tweets">https://github.com/bondicrypto/Get_Old_Tweets</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42eb2ba1ab0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>