<?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 Ehmad Zubair on Medium]]></title>
        <description><![CDATA[Stories by Ehmad Zubair on Medium]]></description>
        <link>https://medium.com/@ehmadzubair?source=rss-529500bbdb43------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SaVZ_F3zEOxncarQ</url>
            <title>Stories by Ehmad Zubair on Medium</title>
            <link>https://medium.com/@ehmadzubair?source=rss-529500bbdb43------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 05:02:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ehmadzubair/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[LangChain Series: Uses of Generative AI in the Real World]]></title>
            <link>https://ehmadzubair.medium.com/langchain-series-uses-of-generative-ai-in-the-real-world-62da7cbdbf22?source=rss-529500bbdb43------2</link>
            <guid isPermaLink="false">https://medium.com/p/62da7cbdbf22</guid>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <category><![CDATA[generative-ai-solution]]></category>
            <category><![CDATA[langchain]]></category>
            <dc:creator><![CDATA[Ehmad Zubair]]></dc:creator>
            <pubDate>Thu, 15 Jun 2023 07:23:13 GMT</pubDate>
            <atom:updated>2023-06-15T07:23:13.364Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K033K1NQOK4tb1rN.png" /></figure><p>I’m excited to announce a series on my YouTube channel: the “LangChain Series”. This series is designed for anyone interested in exploring the practical applications of Generative AI, LangChain, ChatGPT, and Large Language Models.</p><p>The roadmap will be an evolving image/document and will be updated very often as new and more practical ideas come pouring in. Got any ideas or a practical use case that you’d like us to build, reach out to me on Twitter <a href="https://twitter.com/ehmadzubair">@ehmadzubair</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X_NOPEF4RTKTa48n.png" /></figure><p>LangChain, at its core, is a framework that simplifies the creation of applications using large language models, making it an ideal tool for various AI applications, from chatbots to summarization and beyond​. With its launch in early 2023,<a href="https://github.com/hwchase17/langchain"> LangChain</a> has unlocked new possibilities for AI enthusiasts and developers alike.</p><p>In the LangChain Series, we’ll explore these possibilities. Each video will feature a real-world use case of AI, showcasing how these powerful tools are being used today. We’ll walk through how to set up and use LangChain with different large language models, and how they can be applied to address real-world challenges.</p><p>My goal with this series is to demystify AI and its real-world applications, making it accessible to everyone, whether you’re a seasoned AI practitioner, an AI enthusiast, or simply curious about the field.</p><p>Stay tuned for the first video in the LangChain Series! I’m looking forward to embarking on this exciting journey with you all.</p><p>Happy coding and learning! See you in the first video.</p><h3>Resources:</h3><ul><li><a href="https://github.com/Cogent-Labs-Inc/langchain-series">Github Repository</a></li><li><a href="https://www.youtube.com/c/ehmadzubair">Youtube Channel</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62da7cbdbf22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lessons from how Starbucks’s customers respond to their offers]]></title>
            <link>https://ehmadzubair.medium.com/lessons-from-how-starbuckss-customers-respond-to-their-offers-5db838c10cd3?source=rss-529500bbdb43------2</link>
            <guid isPermaLink="false">https://medium.com/p/5db838c10cd3</guid>
            <category><![CDATA[random-forest-classifiers]]></category>
            <category><![CDATA[starbucks]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Ehmad Zubair]]></dc:creator>
            <pubDate>Thu, 29 Oct 2020 11:43:16 GMT</pubDate>
            <atom:updated>2020-10-29T11:43:16.578Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a0ev-yiJDqDOHnuz" /></figure><p>Almost all consumer facing food businesses around the world send offers and vouchers to their customers to boost their sales and reward customers for their loyalty. Business intelligence focused on the consumers is very crucial to plan the offers that are the most and have the most conversions.</p><p>One such example of a consumer facing food business is Starbucks. Starbucks has more than <strong>31,000</strong> stores worldwide across <strong>76</strong> countries. In this article, i will explain how I analyzed Starbucks’s mobile app data to find patterns in how users responded to various offers sent to them. I also try to build a predictive model which can accurately predict if a customer will respond to the offer we send to her.</p><blockquote>Note: This article is for a technical audience. It assumes that you have basic knowledge about Data Science concepts</blockquote><h3>Overview</h3><p>Apart from the usual cleaning and preprocessing of the data, I planned to:</p><ol><li>Do an exploratory data analysis on the complete dataset</li><li>Converge on the best ML model (binary classifier) to predict if a customer will complete the offer or not</li><li>Cross verify the results of the ML model with the original data</li></ol><p>The code for this whole article can be found at: <a href="https://github.com/ehmadzubair/starbucks-rewards-analysis">https://github.com/ehmadzubair/starbucks-rewards-analysis</a></p><h3>Data</h3><p>The dataset was provided by Udacity as part of their Data Science Nanodegree program. It has been anonymized and reduced to just one product for the sake of simplicity.</p><p><strong>Users — 17000 users</strong></p><ul><li>Age</li><li>Date of Membership</li><li>Gender — M, F, O (other)</li><li>Income</li></ul><p><strong>Offers — 10 offers</strong></p><ul><li>Offer Type — BOGO*, Discount, Informational (More details at …)</li><li>Minimum spend to complete the offer</li><li>Reward amount for the offer</li><li>Validity duration</li><li>Sending Channel — <strong>Email, Social, Web, Mobile</strong></li></ul><blockquote>*BOGO = Buy one get one free</blockquote><p><strong>Transcript (Time series data) — 306534 events</strong></p><ul><li>Event/User Action</li><li>User</li><li>Time series value</li><li>Event details</li></ul><p>The time series data shows the behavior of most of the 17,000 users in the User data.</p><h3>Exploratory Data Analysis</h3><p>After getting the basic understanding of the data, the next step was to do exploratory data analysis. This however couldn’t happen before preprocessing the data. Here are the steps that I took for exploratory data analysis.</p><h4><strong>Step 1 — Preprocessing</strong></h4><p><strong>Outliers</strong></p><p>Plotting the histograms for all numerical columns of all three dataframes helped highlight any outliers/invalid data that might be there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*ZlZLCj78Zv6AwdVI7KvRhQ.png" /><figcaption>Histogram of the Age column of Profile Dataframe</figcaption></figure><p>The age histogram showed ~2000 users from 110–120 years old. This is was an unexpected find. I dug deeper into this and found out that these were in fact missing data points with an incorrect default value for age. Replaced all the occurrences of age = 118 with NaN to deal with them later.</p><p><strong>Unstructured Data</strong></p><ol><li>The offer channel data was unstructured and stored as and array of strings. I split this out into one-hot encoded columns for all 4 channel types. Example: [web, email, mobile]</li></ol><p>2. The <strong>value</strong> column of the <strong>transcript</strong> dataframe was also unstructured. I split that out into one-hot encoded columns for every <strong>unique key</strong> in the value string. Doing that highlighted another issue in the underlying data. The <strong>Offer ID </strong>was represented as “offer_id” and “offer id” for different events in the dataset. I merged both of them into one column named “unified_offer_id”</p><p><strong>Null Values</strong></p><p>At this point, in the <strong>Profile </strong>dataframe the only Null values were the <strong>Age, Gender and Income</strong> for the <strong>2175</strong> Users we found in the “Outliers” section above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*URN5pDqrXayMnXjZooALlg.png" /><figcaption>Null values in Profile Dataframe</figcaption></figure><p>The Offers (portfolio) dataframe had no nulls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*cG1-2h_DIl_J6iXrN-Eidg.png" /><figcaption>Null values in Offers Dataframe</figcaption></figure><p>The <strong>Transcript </strong>dataframe had significant nulls in 3 columns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*xEsh6PKtdQZNLoNbw7u4rQ.png" /><figcaption>Null values in Transcript Dataframe</figcaption></figure><p>When seen in detail, these were all expected nulls. e.g Amount is only related to the “<strong>transaction</strong>” event type. Event <strong>“offer completed”</strong> had 0 records for the amount.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*6YsxU0yYXI7tF6Yo46_pzA.png" /></figure><p><strong>Data Types</strong></p><p>I fixed the data types for all three dataframes. Columns that had dates were converted to datetime and numeric fields were converted into int or float data types.</p><p><strong>Duplicates</strong></p><p>When looking for duplicates, I found out that the transcript dataframe had 397 duplicates for the event type “offer completed”. It’s highly unlikely that a user completed the same offer twice on the same time series value. Dropping it with caution. In a real world setting, I would have gotten in touch with the team that collected the data and doubled checked these duplicates.</p><h4>Step 2— Data Analysis</h4><p><strong>Users</strong></p><p>The age and income of all the customers of Starbucks was normally distributed with the income having right skewness. Right skewness is typical for income data.</p><p>User <strong>Income vs Age </strong>scatter plot however shows an unexpected scatter plot. The steps observed at the 38 and 48 y.o mark look like a sampling/recording error. Would love to check-in with the team that recorded the data to find out why this happened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B0LLqylYLgzOlQ9EH2Om9Q.png" /><figcaption>Age vs Income Spread</figcaption></figure><p>Exploring further, I wanted to compare the demographics of the top 20% spenders with all the customers. I found out that the top 20% spenders had close to zero skewness in their income spread and had a higher mean and median income compared to all the users. Also, the gender ratio changed significantly in the top 20% of the spenders (54% vs 36%).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c1d9EOZXRpy8sBYwouCPOA.png" /></figure><p>Looking at the membership dates, I found a year over year increase in new signups. I also found out that there were no new memberships recorded after <strong>2018–07–26. </strong>It’s very unlikely that users stopped signing up after that. So, I’m going to assume that we did not record data beyond 2018–07–26.</p><p>When I removed the data for 2018, I found that new memberships were increasingly higher in the second half of the year. My guess is that weather might be an important factor in influencing this trend but more can’t be said about this without knowing the location of the city it was recorded in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0dGEWSafknmURnZV_YQMuw.png" /></figure><p><strong>Offers</strong></p><p>Here’s how the offers funnel looked for the events “offer received”, “offer viewed” and “offer completed”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*1kNW3gRJT1kVRvSMVHcJoA.png" /></figure><p>The sending schedule of the offers had a consistent pattern. New offers were sent out after exactly seven days at the same time. The split between <strong>BOGO, Discount </strong>and<strong> Informational </strong>was 40%, 40% and 20% respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rFFmvojMoMnSvCDnlmYfJg.png" /></figure><p>When looking at the channels for the offers, I found out that <strong>Social </strong>had the highest open/view rate and <strong>Web </strong>had the highest completion rate. <strong>Email </strong>was the most frequently used medium.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GRVBW8pWF1GSAUPYYVajXw.png" /><figcaption>Channel vs Percentage events</figcaption></figure><p>When looking at completed offers, I found that although the number of sent offers were roughly equal for <strong>BOGO</strong> and <strong>Discount, Discount </strong>offers performed better (1.14x better than BOGO) among users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VicAh8Q7ekGjAbDGHsWQag.png" /></figure><p>And finally, here’s the ranked offer completions for all the offers sent out to Starbucks customers in the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rzqXsAcJY52EbYenCmm84A.png" /></figure><h3>Predictive Modelling</h3><p>Now that we’ve done some exploratory data analysis, we’ll attempt to create a predictive model that predicts if a user will end up completing the offer or not. For that, we have to transform the data from a time-series transcript to a dataframe that has the user demographics and offer data along with the label.</p><p><strong>Step 1 — Transforming the data</strong></p><p>This was the most challenging part of the whole analysis. The transformation was done using the following steps for each user (for details, see Creating a User x Offer dataframe section of the Jupyter notebook):</p><ol><li>Sort the user’s events chronologically</li><li>Remove any offers that have expired and not completed</li><li>For each transaction event, record all active offers that the user has viewed</li><li>For each completed transaction, record if the offer was completed deliberately or not (offer viewed)</li></ol><p>After this transformation, we ended up with a dataframe with the following columns:</p><ul><li>gender</li><li>age</li><li>person</li><li>offer_id</li><li>income</li><li>membership_date</li><li>reward</li><li>difficulty</li><li>duration</li><li>offer_type — BOGO, Discount, Informational</li><li>email</li><li>web</li><li>mobile</li><li>social</li><li>is_completed_deliberately — A boolean flag that determines if the user had viewed the offer before doing a transaction</li><li>is_complete — A boolean flag that determines if the user completed the offer</li><li>other_active_offers — Count of other active offers in parallel for the same user</li></ul><p><strong>Step 2 — Cleaning</strong></p><p>When I first ran a logistic regression model on the dataset, the “Informational” offer coefficient diluted all other coefficients and the model’s accuracy suffered. Since the completions of BOGO and Discount offers are more significant for the analysis, I decided to drop the “Informational” offer rows. The <strong>other_active_offers </strong>column however has the count of all three types of offers.</p><blockquote>An alternate approach would have been to set the completion criteria to zero and count any purchase after the “Informational” offer as the completion event of that offer.</blockquote><p>I also removed the rows for all the offers that were completed without the user’s knowledge of the offer.</p><p><strong>Step 3— Feature engineering</strong></p><p>At this point, we had the user’s complete demographic data in the dataframe but since we’re going to be removing the identifier of the user for training the model, I decided to compute aggregate features of the user and add them as new columns. total_spend , total_transactions and days_since_membership were added.</p><p><strong>Step 4— Preprocessing</strong></p><p>I encoded the offer_type and gender with one-hot encoded columns (with nulls). The only columns left with nulls were age and income . Imputing the mean made sense for me</p><p><strong>Step 5 — Modeling</strong></p><p>I did a basic train-test split with 0.8 as the training size. It took 5 iterations to converge at the best features and data to use with the models below.</p><p>Each iteration involved:</p><ul><li>Experimenting with data (remove nulls rather than impute, include/exclude features etc.)</li><li>Run grid search with <strong>Logistic Regression</strong></li><li>Measure f-1 score and review the confusion matrix</li><li>Validate coefficients with Exploratory Data Analysis</li><li>Repeat</li></ul><p>Once, I reached an f1 score of 0.80, I ran a grid search on other classifiers because they are both computationally expensive. <strong>Logistic Regression</strong>, <strong>Random Forest</strong> and <strong>SVM </strong>were used to converge on the final classifier.</p><p><strong>Logistic Regression</strong></p><p>Removing the “informational” offers had a very significant affect on the accuracy of logistic regression. The weighted average of f1 score jumped from <strong>0.74 </strong>to<strong> 0.81.</strong></p><p>Here’s the classification report and the confusion matrix for the final run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*bDnaMb4RLzM2EaM85YTcyg.png" /><figcaption>Logistic Regression classification report</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HTNhuQrnQyW5aVY4G0Zv6Q.png" /><figcaption>Logistic Regression confusion matrix</figcaption></figure><p>Upon inspecting the coefficients of the final run, I found out that the 5 most important features are:</p><ul><li>total spend of the customer</li><li>number of other active offers</li><li>difficulty — Negative impact</li><li>social channel — Consistent with our exploratory data analysis</li><li>gender_nan — This corresponds to the customers who didn’t fill the data for age, income or gender. It turns out, that people who didn’t fill the form as lesser likely to complete offers.</li></ul><p>Further coefficients also check out with our exploratory data analysis e.g gender_f and age</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2akx1WQ7dkBc5nzP4yUjZg.png" /></figure><p><strong>Random Forest</strong></p><p>Best parameters</p><pre>&#39;max_features&#39;: 0.8, <br>&#39;min_samples_leaf&#39;: 100,<br>&#39;min_samples_split&#39;: 25, <br>&#39;n_estimators&#39;: 4000</pre><p>Random forest classifier is very computationally expensive (especially with a higher number of estimators). So, I used the test dataset to converge on the general range of hyperparameters first.</p><p>After converging on the correct parameters (using the training dataset), here’s the classification report and the confusion matrix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*G51mKtBV7qcL4wxZOhFL2A.png" /><figcaption>Random Forest Classification Report</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dlg-KuS_LTyNuaNC6a3ncg.png" /><figcaption>Random Forest Confusion matrix</figcaption></figure><p>The classification report shows a significant improvement from the Logistic Regression Classifier</p><p><strong>Support Vector Machine</strong></p><p>Best parameters</p><pre>{&#39;C&#39;: 100.0, &#39;gamma&#39;: 0.01}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*99e14npe8h6FNoo8-yyq3A.png" /><figcaption>SVM classification report</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OLEifwYOZUP6FxIzO58leg.png" /><figcaption>SVM confusion matrix</figcaption></figure><p><strong>Conclusion</strong></p><p>Both the classification report and the confusion matrix show that <strong>Random Forest</strong> performed slightly better than <strong>SVM </strong>for classification. At a weighted average 0.84 f1 score, I feel that this model will add a lot of value for Starbucks. They can fairly accurately run a prediction on all of their customers so they only send the offers that are most relevant to their customers. This will help them save both time and resources for their next campaign.</p><p>For a layman, here are the top 5 findings from this complete analysis:</p><ul><li>Surprisingly, the offer types doesn’t significantly impact the likelihood of people responding or completing offers</li><li>Top spenders are the most likely to complete offers</li><li>Offers received via the <strong>Social</strong> channel have the highest likelihood of completion</li><li>Female customers are more likely to spend more on Starbucks</li><li>Older customers tend to have a higher likelihood of completion of the offers</li></ul><h3>Potential Improvements</h3><ul><li>Given enough compute power, do a more granular grid search to converge on the hyperparameters or use one of the approaches from <a href="https://scikit-learn.org/stable/modules/grid_search.html#">here</a></li><li>Investigate the reason behind the age vs income anomaly in the scatter plot</li><li>Experiment with including “informational” offers as a separate feature. Perhaps something on the lines of has_parallel_informational_offer</li><li>Test other classifiers e.g Decision Trees</li><li>Make customer segments using some clustering algorithm</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5db838c10cd3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The top 10 reasons why children stay in schools in Pakistan]]></title>
            <link>https://ehmadzubair.medium.com/the-top-5-reasons-why-children-stay-in-schools-in-pakistan-5c225c87720b?source=rss-529500bbdb43------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c225c87720b</guid>
            <category><![CDATA[pakistan]]></category>
            <category><![CDATA[literacy]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[children]]></category>
            <dc:creator><![CDATA[Ehmad Zubair]]></dc:creator>
            <pubDate>Tue, 21 Jul 2020 11:20:43 GMT</pubDate>
            <atom:updated>2020-07-28T08:15:01.514Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l2ZRndv_Hn0ugC24mRfclw.jpeg" /></figure><p>A data based approach using <a href="http://aserpakistan.org/index.php">ASER</a>’s 2019 Annual Report Data</p><h3><strong>Introduction</strong></h3><p>Intuitively, one might be inclined to say that the <em>location</em> of a child’s house and the household’s <em>income</em> are the most important factors in deciding if the child will enroll in a school or not. Some might argue that parents’ <em>education</em> is a very huge factor in deciding the child’s prospects to receive education.</p><p>You may have heard Napoleon Bonaparte’s famous quote:</p><blockquote>“Give me an educated mother, I shall promise you the birth of a civilized, educated nation”</blockquote><p>But do these intuitions/quotes hold true when we analyze the underlying data?</p><p>In this article, we will see all the interesting things I found out when deep diving into the data set for <strong>288,776 </strong>Children from all over Pakistan.</p><p>We’ll also try to answer what it is about households, locations and parents that keeps children in schools.</p><h3>Part 1: Top factors influencing the child’s education</h3><p>After training a (trivial) statistical model on 99% of the data, the following factors were found to affect children enrollments the most:</p><p><strong>Top 20 factors giving children an advantage:</strong></p><ul><li>Age (by far the highest impact)</li><li>Living in district <strong>Surab </strong>or<strong> Kasur</strong></li><li>Being a boy</li><li>Living in district <strong>Kharan, Nagar, Okara, Malakand, Rondu </strong>or <strong>Nowshero Feroze</strong></li><li>Living in <strong>Azad Jammu and Kashmir</strong> or <strong>Gilgit Baltistan</strong></li><li>Living in district <strong>Jacobabad, Panjgur </strong>or<strong> Hunza</strong></li><li>Having an electricity connection</li><li>Living in district <strong>Gupis Yasin</strong> or <strong>Rawalpindi</strong></li><li>Living in <strong>Punjab</strong></li><li>Living in district <strong>Chaghi</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qmvQLV9f8djiEMFQBeQTMg.png" /></figure><p><strong>Top 20 factors giving children a disadvantage:</strong></p><ul><li>Living in district <strong>Zhob, Dukki, Loralai</strong></li><li>Living in <strong>Balochistan</strong></li><li>Being a girl</li><li>Living in district <strong>Tangir</strong></li><li>Living in <strong>FATA</strong></li><li>Father’s education data not filled in the survey form (can’t be assumed as uneducated according to ASER)</li><li>Living in district <strong>Jhang, Matiari, Diamer, Awaran, Bannu, North Waziristan, Sukkur, Rajanpur, Nasirabad, Jafarabad, Sargodha </strong>or<strong> Bolan</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*laPnBzNB3UsjmaJpeOUF5w.png" /></figure><h3>Part 2: What is it about the households and parents that’s more likely to keep children in schools</h3><blockquote>Disclaimer: This data has to be taken with a pinch of salt because it has been stripped of the location context.</blockquote><p>After training a statistical model on 99% of the data, the following factors affected children being in and out of school the most:</p><p><strong>Top 10 factors having a positive affect:</strong></p><ul><li>Age (has the highest affect by far)</li><li>Being a Boy</li><li>Having a Pucca (permanent) house</li><li>Having a father who has attended school</li><li>Having higher number of total members in the house</li><li>Having an electricity connection</li><li>Having a self-owned house</li><li>Having a mother who has passed 10 grades</li><li>Having a father who has graduated</li><li>Having a father who has passed 10 grades</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*vQnEkN4Wd0ai8_INDFKe_g.png" /></figure><p><strong>Top 10 factors having a negative affect:</strong></p><ul><li>Having a family that’s a recipient of PSPA social assistance</li><li>Having a higher number of males in the house</li><li>Being a girl</li><li>Having a kutcha (temporary) house</li><li>Having a family that’s a recipient of ehsaas social assistance</li><li>Mother’s education data not filled in the survey form</li><li>Having a solar panel available</li><li>Father’s education data not filled in the survey form</li><li>Having a father who has studied till grade 5</li><li>Having a motorcycle at home</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*L1g4p2xsX0tTpajlARowww.png" /></figure><h3><strong>Part 3: Age vs Enrollments</strong></h3><p>Zooming in on the Age data shows that parents generally pick the <strong>5</strong> Year mark to get children enrolled in schools. Very less parents put their children in school at ages <strong>3 and 4.</strong></p><p>It’s either that, or the general state of education in the country is on the decline from the last 2 years. I’m not an educationist, and would love some input on this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*la1iC0BhLuQ2FObwkmfdrg.png" /></figure><h3><strong>Part 4: How Parents’ years of education affect the child’s enrollment chances</strong></h3><p>The <strong>Mother’s</strong> number of years of education seems to play a very important role in the enrollment percentages of children. Children whose mothers have less than 3 years of education tend to have a significantly lesser chance of getting enrolled.</p><p>The <strong>6</strong> <strong>year</strong> mark for mother’s years of education and <strong>7 year </strong>mark for the father’s education looks like a boundary that influences children’s enrollment percentages.</p><blockquote>There’s some unexplainable data for parents’ years of education is exactly 4 years</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8583UYN41KijexEr0UDdVw.png" /></figure><p>So this answers our question above about affect of mother’s education.</p><h3>Extra: What the respondents say about “out of school” children</h3><p><strong>Non Enrollment</strong></p><p>According to <strong>40,662 </strong>recorded responses, here are the main reasons why children haven’t enrolled in any school segregated by Provinces. I noticed that ~40% non-enrollment in Punjab due to “<strong>Law and Order</strong>” looks counter-intuitive</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yG-BqmxvN9UDWE2sOl2Gvg.png" /></figure><p><strong>Drop Out</strong></p><p><strong>9,771 </strong>responses felt that these are the main reasons for children dropping out</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jTz50u6ZAieQ3LAQYjOaQA.png" /></figure><h3>Conclusion</h3><p>The data validates most of our hunches about the main factors. It seems to agree with Napoleon’s saying as well.</p><h3>Want to deep dive yourself?</h3><p>The code for this analysis can be found in this github <a href="https://github.com/ehmadzubair/aser-2019-survey-data-analysis">repo</a>. I’ve also answered some other questions that I had about the data in the Jupyter Notebook.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c225c87720b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Backstory of Mojolo.pk]]></title>
            <link>https://ehmadzubair.medium.com/the-backstory-of-mojolo-pk-78ed28bd1d73?source=rss-529500bbdb43------2</link>
            <guid isPermaLink="false">https://medium.com/p/78ed28bd1d73</guid>
            <category><![CDATA[journey]]></category>
            <category><![CDATA[lean-startup]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[hustle]]></category>
            <category><![CDATA[product]]></category>
            <dc:creator><![CDATA[Ehmad Zubair]]></dc:creator>
            <pubDate>Fri, 07 Jun 2019 20:28:33 GMT</pubDate>
            <atom:updated>2019-06-07T20:28:33.601Z</atom:updated>
            <content:encoded><![CDATA[<p>I have always been an idea person. Beautiful, stupid, amazing, deep or out right bizarre, I’m open to hearing them and discussing them with people any hour of the day.</p><p>In early 2014, i was almost done with my final year project, 4 months ahead of the deadline. With the time I had at hand, I started working on this idea I called Kapray. I had very limited coding skill, but was very comfortable with Photoshop (thanks to a lot of freelancing). 6 hours into the project, I had 3–4 screens which would easily communicate the idea. This is what I came up with:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*9PVh4ODTfU0qv8unoq1Z6Q.jpeg" /></figure><p>I got super excited, called <a href="https://www.linkedin.com/in/sarosh-khatana-225b1074/">Sarosh</a> up, told him about the idea and sent him the screenshots. We went on about the idea for a couple of hours over the phone and fell in love with it instantly. We promised to work on it right away but didn’t for the next year and a half.</p><p>How and when we got to make this App will be covered in my next post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78ed28bd1d73" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>