<?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 Ifunanya on Medium]]></title>
        <description><![CDATA[Stories by Ifunanya on Medium]]></description>
        <link>https://medium.com/@ifyobi21?source=rss-1c19610f8dc2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Ifunanya on Medium</title>
            <link>https://medium.com/@ifyobi21?source=rss-1c19610f8dc2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 04:08:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ifyobi21/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[An Analysis of the Starbucks Mobile App Rewards]]></title>
            <link>https://medium.com/@ifyobi21/an-analysis-of-the-starbucks-mobile-app-rewards-f36f95b0707e?source=rss-1c19610f8dc2------2</link>
            <guid isPermaLink="false">https://medium.com/p/f36f95b0707e</guid>
            <dc:creator><![CDATA[Ifunanya]]></dc:creator>
            <pubDate>Tue, 31 Oct 2023 09:09:32 GMT</pubDate>
            <atom:updated>2023-10-31T12:01:55.126Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qg514dek_E_qdnoNcBbxMw.jpeg" /><figcaption>Starbucks</figcaption></figure><h3>Project Overview</h3><p>Starbucks, the global coffeehouse giant, has always been at the forefront of customer engagement. With its rewards mobile app, Starbucks occasionally sends out personalized offers to its users, ranging from drink advertisements to enticing discounts. This analysis seeks to understand the behavior of Starbucks customers in response to promotional offers. By predicting which offers are most likely to resonate with which customer segments, Starbucks can enhance user engagement and drive sales. Addressing this challenge has significant business implications, improving marketing ROI and personalizing the customer experience. One question to answer is do all users engage with these offers in the same way? Let’s dive deep into the Starbucks rewards program to unravel the mysteries of customer behavior!</p><h3><strong>Problem Statement</strong></h3><p>There’s a long-standing debate on the effectiveness of advertisements. For regular consumers of a product, like Starbucks coffee, promotions may not significantly influence purchasing behavior. With this in mind, this analysis aims to answer who responds to offers and which demography is likely to be more responsive.</p><h3>Description of Input Data</h3><p>The data is divided into three main files:</p><p><strong>portfolio.json:</strong> This file contains offer IDs and metadata about each offer, including:</p><ul><li>Offer type (e.g., BOGO, discount, informational)</li><li>Minimum required spend to complete an offer</li><li>Reward for completing an offer</li><li>Duration the offer is open, in days</li><li>Communication channels for the offer</li></ul><p><strong>profile.json:</strong> This file provides demographic data for each customer, such as:</p><ul><li>Age</li><li>Date when the customer created an app account</li><li>Gender (with values like M, F, or O for other)</li><li>Customer ID</li><li>Customer’s income</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jzyr1bKxRbfUhDvmzo78lQ.png" /><figcaption>Portfolio Head</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*qLYOe9FnNVt26sRA8CAQFg.png" /><figcaption>Profile Head</figcaption></figure><p><strong>transcript.json:</strong> This file contains records for transactions, offers received, offers viewed, and offers completed. Details include:</p><ul><li>Event description (e.g., transaction, offer received, offer viewed)</li><li>Customer ID</li><li>Time since the start of the test</li><li>Offer ID or transaction amount, depending on the record</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gYpnHVyL846HKc32pFaLPg.png" /><figcaption>Transcript Head</figcaption></figure><p>The dataset provides various insights:</p><ol><li>Every offer comes with a validity period, post which the offer expires. For instance, a BOGO offer might only be valid for 5 days.</li><li>Informational offers, even though they merely advertise a product, also have a validity period. If such an offer has a validity of 7 days, we can infer that the customer is under the influence of that offer for the said period.</li><li>The dataset also includes transactional data, which shows user purchases on the app. This data comprises the timestamp of the purchase and the amount spent. This transactional data has records of each offer a user receives, views, and completes.</li><li>An essential aspect to remember is that users might make a purchase without ever receiving or seeing an offer.</li></ol><p>These datasets together provide a comprehensive view of user interactions, forming the backbone of our analysis.</p><h3>Strategy for Problem Solving</h3><p>The approach will leverage data preprocessing, exploratory analysis, and modelling. By ensuring clean, meaningful data and employing suitable models, we can predict offer completion based on user demographics and behavior.</p><p>The solution pipeline is as follows:</p><ol><li>Data Cleaning: Ensuring datasets are devoid of anomalies.</li><li>Data Merging: Combining datasets to get a unified view.</li><li>Exploratory Analysis: Understanding data distributions and patterns.</li><li>Model Building: Employing machine learning to make predictions.</li><li>Evaluation: Using metrics to gauge model performance.</li></ol><h3>Metrics</h3><p>I’ll employ <em>Accuracy</em> (to gauge overall prediction correctness). As stated on the SciKit learn website, the accuracy_score function computes the accuracy, either the fraction (default) or the count (normalize=False) of correct predictions.</p><h3><strong>Data Preprocessing and Cleaning</strong></h3><p>Before diving into modeling, the data required some cleaning and preprocessing:</p><ul><li>Portfolio Data: Separated channels (like web, email) into distinct columns with binary values.</li><li>Profile Data: Handled missing data, categorized age groups, and converted membership start dates into years.</li><li>Transcript Data: Extracted necessary information from complex columns and merged datasets to obtain a comprehensive view of user interactions.</li></ul><h3>Exploratory Data Analysis (EDA)</h3><p>EDA provided insightful visualizations:</p><ul><li>Profile Data: There was a higher representation of males, with most users aged between 50–60 years. Membership showed a steady increase over the years.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uLz2fnRJdZSgdHGtAkB6Ig.png" /></figure><ul><li>Portfolio Data: The distribution between offer types and channels was quite balanced.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eZJfTRAY9_OgHspsoixd0Q.png" /></figure><ul><li>Transcript Data: A significant number of transactions occurred without any offer, indicating the possibility of organic sales.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Yk_6tb1fRmosDzNX8G7hg.png" /></figure><h3>Modelling</h3><p>For this section, I devised a predictive model to determine if a new customer would both view and complete an offer, taking into account various influencing factors. The data was set up as follows:</p><ul><li>Merged all individual dataframes into a singular primary dataframe.</li><li>Converted categorical columns like offer_type, gender, event, and age into binary columns.</li><li>Generated a fresh dataframe containing only the entries of customers who viewed and subsequently completed the offers.</li><li>Removed unrequired columns such as offer_type, gender, year, event, gained_reward, person, offer_id, time, offer received, offer viewed, and age.</li><li>Scanned for and addressed any missing values. The model’s input dataframe encompasses these columns: amount, income, reward, difficulty, duration, mobile, email, web, social, bogo, discount, informational, F, M, NA, O, children, YA, 20s, 30s, 40s, 50s, 60s, 70s, 80+, NA, and offer completed.</li></ul><p>To proceed, I defined a function that takes a classifier and a dataframe as inputs. This function handles feature and target extraction, divides the data into training and test sets, trains the given model, makes predictions, and subsequently evaluates the model’s performance. To guage accuracy, I then executed multiple classifiers, including AdaBoostClassifier, GaussianNB, DecisionTreeClassifier, and RandomForestClassifier, using the DataFrame. Each model’s accuracy was gauged on both training and test data. A snippet of the code is seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xjUaxrDtcPhOsawy2YxYew.png" /></figure><p>Upon executing the code, AdaBoost emerged as the top-performing model, prompting me to choose it for additional refinements.</p><h3>Evaluation</h3><p>Using accuracy as the metric, I obtained the accuracy scores for each of the models trained.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*9ZOUFIDG9JVD7jzNrSAjMg.png" /></figure><p>From the results, I concluded that the AdaBoostClassifier is the most suitable to achieve our objective, given its consistent training and testing scores relative to the other models. The scores from the other models suggest a potential overfitting problem.</p><h3>Hyper Parameter Tuning</h3><p>After settling on AdaBoost, I utilized grid search to identify the best parameters. Initially, in the model comparison phase, I operated the classifier using its default settings, which were:</p><ul><li>n_estimators: default=50</li><li>learning_rate: values between 0.8 and 1.2</li><li>algorithm: ‘SAMME.R’</li></ul><p>Despite experimenting with various parameter combinations during grid search, the default ones consistently emerged as optimal. To possibly enhance accuracy, I narrowed my parameter values to be closer to the defaults:</p><ul><li>n_estimators: values between 40 and 60</li><li>learning_rate: values between 0.8 and 1.2</li><li>algorithm: both ‘SAMME’ and ‘SAMME.R’</li></ul><p>This approach yielded a variation from the default. The grid search indicated the best parameters to be:</p><ul><li>n_estimators: 45</li><li>learning_rate: 0.9</li><li>algorithm: ‘SAMME.R’</li></ul><p>Upon implementing the model with these updated parameters, I observed a slight increase in accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*grU6NUWNOmaXFmNWvAlHJA.png" /></figure><h3>Results</h3><p>During the modeling phase, I experimented with several algorithms, including AdaBoostClassifier, GaussianNB, DecisionTreeClassifier, and RandomForestClassifier. Of these, AdaBoost emerged as the most suitable for our needs, judging by its accuracy metrics. Post the grid search process, there was an accuracy enhancement of 0.11%.</p><h3>Key Findings</h3><ol><li>Demographics and Offers: Users aged between 30–60 viewed and completed the most offers. They also made the highest number of transactions.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*yBC-zvjks-QJxdiwV4Y4ZA.png" /></figure><p>2. Offer Type Preferences: While both genders completed a good number of offers, more males seemed to complete discount offers. This corresponds with the higher male representation in the dataset.</p><p>3. People in their 50s and 60s are more likely to respond to offers</p><p>4. Sending offers through all channel that have longer durations have higher chances of being used even if the reward is less and the difficulty is higher.</p><p>5. Model Performance: After hyperparameter tuning, the AdaBoostClassifier showcased improved accuracy in predicting offer completions.</p><h3>Conclusion</h3><p>Understanding customer behavior and preferences is crucial for any business, and Starbucks is no exception. Through this analysis, Starbucks can tailor its offers to be more effective and resonate better with different demographic groups. As technology advances and data collection becomes even more sophisticated, companies will have an even greater opportunity to fine-tune their marketing strategies for maximum impact.</p><h3>Improvements</h3><p>Future iterations could integrate temporal data (e.g., offer send time) and delve into deep learning models, potentially unveiling deeper behavioral patterns.</p><p>See more indepth analysis <a href="https://github.com/Nanyaa/Starbucks_Capstone/blob/main/Starbucks%20Capstone%20Challenge.ipynb">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f36f95b0707e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep Dive into AirBnB Data: Boston vs. Seattle]]></title>
            <link>https://medium.com/@ifyobi21/deep-dive-into-airbnb-data-boston-vs-seattle-319bafbf6840?source=rss-1c19610f8dc2------2</link>
            <guid isPermaLink="false">https://medium.com/p/319bafbf6840</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-modelling]]></category>
            <dc:creator><![CDATA[Ifunanya]]></dc:creator>
            <pubDate>Mon, 28 Aug 2023 14:44:36 GMT</pubDate>
            <atom:updated>2023-08-28T14:46:02.866Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZiPLZC4mW8JdO6MUGyn7xw.jpeg" /><figcaption>AirBnB: Yes? No?</figcaption></figure><p>By: Ifunanya Obieli</p><p>AirBnB has revolutionized the way we travel, offering more localized experiences in hundreds of countries. Today, I’ll be taking a closer look at two iconic U.S. cities: Boston and Seattle. Using rich datasets, we’ll uncover interesting trends and insights that can inform both hosts and travelers alike. So, let’s jump right in!</p><p><strong>Exploring the Data Landscape</strong></p><p>First things first, I loaded the listings, calendars and reviews datasets for both cities. It’s always enlightening to start with a bird’s eye view, and that’s precisely what I did. I found a myriad of columns, from listing URLs and names to detailed neighborhood descriptions and review scores.</p><p><strong>Merging the Data</strong></p><p>Merging datasets can sometimes feel like fitting puzzle pieces together. In this case, I merged the Boston and Seattle listings by rows and then columns. Columns that weren’t common to both datasets? Dropped them! This ensures we’re comparing apples to apples.</p><p><strong>Price Distributions: Boston vs. Seattle</strong></p><p>Starting with prices, my analysis revealed a clear difference between the two cities. Most listings in both cities fall in the lower price range, hovering around $20 to $200. Boston, however, seems to lean a tad pricier with a denser concentration of listings between $100 and $200. On the contrary, Seattle offers more affordable stays, which could be an incentive for budget travelers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*rGTtxjrQqCH20UrSl1KS1g.png" /></figure><p><strong>Busiest Seasons: When to Book?</strong></p><p>One would assume that summer, being the vacation season, would be the busiest for both cities. But the data tells a different story. Boston sees its peak season in the fall, particularly around September to November. In contrast, Seattle’s summer months, especially June to August, are bustling. If you’re looking for a quieter experience (or perhaps better deals), consider traveling during off-peak months.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*XMx7KPmrmr_wMExIDkjceQ.png" /></figure><p><strong>Does Demand Influence Price?</strong></p><p>A burning question for most travelers (and hosts) is the interplay between demand and price. In both cities, the peak season does come with a heftier price tag. Boston’s fall months, which are the busiest, see a surge in prices. Similarly, Seattle’s summer prices are noticeably higher. This trend underscores the importance of booking in advance if you’re traveling during peak seasons.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*nlbWWWGV78Uy3Csr9MRYsA.png" /></figure><p><strong>Neighborhoods: Where’s Everyone Staying?</strong></p><p>In Boston, neighborhoods like “Jamaica Plain”, “South End” and “Back Bay” lead the pack in terms of the number of listings. On the other hand, Seattle travelers seem to prefer “Broadway”, “Belltown”, and “Wallingford”. These neighborhoods are buzzing hubs, offering a mix of local experiences, amenities, and attractions.</p><p>For those who don’t compromise on quality, the best-reviewed AirBnBs in Boston are predominantly in “Leather District”, “Roslindale”, and “West Roxbury”, while Seattle’s top reviews are concentrated in “Riverview”, “Arbor Heights”, and “Southeast Magnolia”.</p><p><strong>Boston vs. Seattle: A Quick Snapshot</strong></p><p>Comparing these two cities was quite interesting. Some summary insights can be found below:</p><ul><li><strong>Average Price</strong>: Boston’s mean listing price stands at $173.93, a tad higher than Seattle’s $127.98.</li><li><strong>Listings</strong>: Seattle trumps with 3,818 listings against Boston’s 3,585.</li><li><strong>Reviews</strong>: Seattle listings, on average, have a slightly higher review score (94.54) compared to Boston (91.92).</li></ul><p><strong>Predicting Prices</strong></p><p>Lastly, being the data enthusiast that I am, I couldn’t resist building a predictive model.</p><p><strong>Model Overview: </strong>I used a <strong>Linear Regression</strong> model, which is a fundamental algorithm in the realm of supervised learning. It’s particularly suited for understanding relationships between one dependent variable and one or more independent variables.</p><p><strong>Features Considered</strong></p><p>The features (or independent variables) I selected, based on domain knowledge and data availability, were:</p><ul><li>Property type</li><li>Room type</li><li>Number of people the property can accommodate</li><li>Number of bathrooms, bedrooms, and beds</li><li>Review scores rating</li></ul><p><strong>Model Performance: The</strong>model achieved an <strong>R-squared (R²) value of 0.47</strong>, meaning it can explain approximately 47% of the variability in the listing prices. The <strong>Mean Squared Error (MSE) was 6173.42</strong>. While the R² isn’t exceptionally high, it’s a decent starting point, especially considering the myriad of factors that can influence AirBnB prices.</p><p><strong>Insights &amp; Recommendations</strong></p><ol><li><strong>Correlations</strong>: The number of people a property can accommodate, bedrooms, and beds showed moderate positive correlations with the price. This means listings with more beds, bedrooms, or larger accommodation capacities generally have higher prices.</li><li><strong>Busy Seasons &amp; Price</strong>: Iobserved from the data that busy seasons (times with higher bookings) tend to have higher prices. This is a classic demand-supply interplay.</li><li><strong>Improvements</strong>: The model can be further improved by considering more features, trying more complex algorithms, or incorporating external data.</li></ol><p><strong>Sample Predictions</strong></p><p>For a quick glance, here are some sample predictions our model made:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*WxowWx7yfRRye0XHlXHwqg.png" /></figure><p>While there are differences between actual and predicted prices, the model does provide ballpark estimates that can be refined with more data and feature engineering.</p><p><strong>Concluding Thoughts</strong></p><p>While our model provides insights into the factors influencing AirBnB prices, there’s always room for improvement in the dynamic world of machine learning. With more data, refined features, and advanced algorithms, we can get even closer to understanding the intricate tapestry of factors that dictate AirBnB listing prices.</p><p>Would you like to dive deeper into any specific aspect of the model or explore further?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=319bafbf6840" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>