<?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 Helen L on Medium]]></title>
        <description><![CDATA[Stories by Helen L on Medium]]></description>
        <link>https://medium.com/@helenl21?source=rss-d4690fb4f105------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1CGOLMO-pFydJEAyCVL6jw.jpeg</url>
            <title>Stories by Helen L on Medium</title>
            <link>https://medium.com/@helenl21?source=rss-d4690fb4f105------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 23:05:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@helenl21/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[Comparison of Cities in Los Angeles County COVID Cases]]></title>
            <link>https://helenl21.medium.com/comparison-of-cities-in-los-angeles-county-covid-cases-db48885137ed?source=rss-d4690fb4f105------2</link>
            <guid isPermaLink="false">https://medium.com/p/db48885137ed</guid>
            <category><![CDATA[dashboard]]></category>
            <category><![CDATA[content-based-filtering]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[los-angeles]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Helen L]]></dc:creator>
            <pubDate>Thu, 21 Jan 2021 04:18:20 GMT</pubDate>
            <atom:updated>2021-01-21T04:21:52.495Z</atom:updated>
            <content:encoded><![CDATA[<h3>Comparison of COVID Cases in Different Cities in Los Angeles County</h3><p>Los Angeles is currently the nation’s largest coronavirus hot spot. It has just hit 1 million cases. I saw LA county’s aggregated data but I was curious about city level data since I grew up in LA, such as does La Puente (majority Latino city) have higher or lower COVID cases than cities with the same demographics?</p><h4>Data Collection</h4><p>In order to answer this question, I had to collect two types of data:</p><ol><li>LA COVID cases by city and date: <a href="http://publichealth.lacounty.gov/media/coronavirus/locations.htm">LA county public health websit</a>e — Oct 1st, 2020-Jan 13th, 2021</li><li>Demographics by city: <a href="https://data.census.gov/cedsci/table?q=la%20puente&amp;tid=ACSDP5Y2019.DP05&amp;tp=true&amp;hidePreview=true">US Census Data</a> — 2019</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*EEixU4mRWpqlJBZCaKx52w.png" /></figure><p><em>Pic Source: </em><a href="http://publichealth.lacounty.gov/media/coronavirus/locations.htm"><em>http://publichealth.lacounty.gov/media/coronavirus/locations.htm</em></a></p><p><strong>Data Collection Challenges</strong></p><ul><li><strong>Challenge 1</strong>: LA county public health website only provides snapshot of daily cases. I would have to scrape the site every day to get cases by date.</li><li><strong>Solution: </strong>Scrape historical pages via <a href="https://web.archive.org/web/20200101000000*/http://publichealth.lacounty.gov/media/coronavirus/locations.htm">Wayback Machine</a>.</li><li><strong>Challenge 2</strong>: US Census Data API was not working despite following this <a href="https://www.census.gov/content/dam/Census/data/developers/acs/acs-data-variables-guide.pdf">guide</a> from US Census</li><li><strong>Solution: </strong>Manually copying and pasting tables for every city via US Census <a href="https://data.census.gov/cedsci/table?q=la%20puente&amp;tid=ACSDP5Y2019.DP05&amp;tp=true&amp;hidePreview=true">table builder</a>. To narrow down scope, I only focused on 85 cities which did not include incorporated cities (ex. Unincorporated — Hacienda Height) or Los Angeles communities (ex. Los Angeles — Hollywood). I also descoped the project to only collecting race, gender, age, total population, and housing units.</li></ul><h4>Data Modeling</h4><p>The only modeling that was performed was figuring out cities with similar demographics. I turned to content-based filtering method commonly used for a recommender system and used cosine similarity to score the city. I started with 93 features from the US Census but narrowed the list down to 14 through removing features with low values, high correlations with other features, or low explained variance ratio via Principal Component Analysis.</p><p>As mentioned before, the 14 features focused on race percentage, gender, age percentage, total population, and housing unit. For example, here is a subset of La Puente’s demographic features and the three similar cities:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*zHeCNtGykFip45wSyMokwQ.png" /></figure><ol><li>Baldwin Park (Similarity Score: 0.91)</li><li>Commerce (Similarity Score: 0.84)</li><li>Covina (Similarity Score: 0.84)</li></ol><h4>Output — Tableau Public Dashboard</h4><p>The city similarity and COVID data became my data source for the public Tableau dashboard. I kept it simple and limited the metrics to only case rate (number of cases per 100K population since each city has different population sizes) and death rate. I also created a filter for start date that will change the graph and the growth rate below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*QzeDVwv3oBqsPv1iYq7YDA.png" /></figure><p>Covina is doing better that La Puente but Commerce is doing worse. All four of these cities have similar demographics but does not explain why Covina had less cases than La Puente. There are probably few features that were not included in our similarity score that would better explain the difference, ie. job industries, percentage of nursing homes, etc. What we do know, demographics, age, gender, and housing units were not enough to describe the difference. If you want to look to explore the data yourself, check out the link: <a href="https://public.tableau.com/profile/helenl#!/vizhome/CitiesinLACountyCOVID-19ComparisonDashboard/LACountyCityCOVIDComparison">https://public.tableau.com/profile/helenl#!/vizhome/CitiesinLACountyCOVID-19ComparisonDashboard/LACountyCityCOVIDComparison</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db48885137ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creeping on my baby cousin’s Twitch stream — Analytics Project]]></title>
            <link>https://helenl21.medium.com/creeping-on-my-baby-cousins-twitch-stream-analytics-project-a5b7b43a7248?source=rss-d4690fb4f105------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5b7b43a7248</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[clustering]]></category>
            <category><![CDATA[twitch]]></category>
            <category><![CDATA[analytics]]></category>
            <dc:creator><![CDATA[Helen L]]></dc:creator>
            <pubDate>Tue, 05 Jan 2021 05:49:19 GMT</pubDate>
            <atom:updated>2021-01-05T05:49:19.006Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creeping on my baby cousin’s Twitch stream — Analytics Project</h3><p>Alright, I am not really creeping because he is fully aware that I am creating an analytics project based off his stream. Some background, Twitch is a live streaming platform for gamers where the broadcaster can interact with fans as they play. Around Christmas, I learned that my baby cousin, Michael, decided to stream on Twitch consistently and became an affiliate broadcaster. My first question was “Oh, what is your <a href="https://www.twitch.tv/apnoopuas">twitch name </a>so I can follow you.” My second question was “What kind of people watch/follow you?” As hinted by the title, I decided to create a project to answer my second question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*QCUC0i6Ypp5ezYfr46f4DQ.gif" /></figure><h3>Data Collection</h3><p>Accessing Twitch API was fairly simple because the API is well documented here: <a href="https://dev.twitch.tv/docs/api/">https://dev.twitch.tv/docs/api/</a>. I learned that I cannot get any data on his subscribers without his credentials but I can get his followers’ basic data. He offered his credentials but his followers’ data is more than enough.</p><h4>First Steps to Twitch API</h4><ol><li>Create a Twitch account</li></ol><p>2. Register your application here: <a href="https://dev.twitch.tv/console">https://dev.twitch.tv/console</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*waSbXLsmAG-PCZIZ8p-74g.png" /></figure><p>3. Save Client ID and Client Secret as environment variables. <a href="https://www.youtube.com/watch?v=IolxqkL7cD8">Youtube how-to video</a> and <a href="https://www.youtube.com/watch?v=hKPOrW_CbAA">additional step for Jupyter Notebook</a></p><p>4. Grab your access token and construct the headers</p><pre>import requests<br>import os</pre><pre>client_id = os.environ.get(&#39;TWITCH_CLIENT_ID&#39;)<br>client_secret = os.environ.get(&#39;TWITCH_CLIENT_SECRET&#39;)</pre><pre>#get access token<br>access_url = &#39;<a href="https://id.twitch.tv/oauth2/token?client_id={0}&amp;client_secret={1}&amp;redirect_uri=http://localhost&amp;grant_type=client_credentials&#39;.format(client_id,">https://id.twitch.tv/oauth2/token?client_id={0}&amp;client_secret={1}&amp;redirect_uri=http://localhost&amp;grant_type=client_credentials&#39;.format(client_id,</a> client_secret)<br>response = requests.post(access_url)<br>access_token = response.json()[&#39;access_token&#39;]<br>token_type = response.json()[&#39;token_type&#39;]<br>access_token = &#39;Bearer &#39;+access_token<br>headers = {&#39;Client-ID&#39;: client_id, &#39;Authorization&#39;: access_token}<br>print(response) #looking for a 200 response</pre><p>5. Make the request. Ex. User info</p><pre>#grab user id and info for broadcaster<br>user = &#39;apnoopuas&#39;<br>user_url = &#39;<a href="https://api.twitch.tv/helix/users?login={}&#39;.format(user)">https://api.twitch.tv/helix/users?login={}&#39;.format(user)</a><br>user_response = requests.get(user_url, headers = headers)<br>data = user_response.json()[&#39;data&#39;]<br>user_dim = pd.DataFrame(data)  <br>print(user_dim)</pre><p>I collected basic data of his followers, other users his followers follow, and all the users he followed. Some challenges I faced:</p><ul><li>Calls return only 100 max rows at a time so I had to go through paginations</li><li>Some users don’t allow requests like ‘Riot Games’.</li><li>I did not want to make a table for each of his followers so I zipped and appended the list of his follower’s follows and followed date.</li><li>I limited calls on his follower’s followers because some followers had over 1k followers and I figured over 200 was enough to make a point.</li></ul><h3>Data Exploration</h3><p><strong>How many followers does he have? Did he gain his followers over a long period of time?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*U_skx93hn00soJnwd9O7VQ.png" /></figure><ul><li>As of 12/29/2020, he has 326 followers and most of his followers were recent, 4 months or less.</li></ul><p><strong>What percentage of his followers does he follow back?</strong></p><ul><li>He follows 20% of his followers which is 65 users. In total, he follows 114 users.</li></ul><p><strong>Are his followers streamers too?</strong></p><ul><li>I defined streamers as either an <a href="https://help.twitch.tv/s/article/joining-the-affiliate-program?language=en_US">affiliate broadcaster</a> or a <a href="https://help.twitch.tv/s/article/partner-program-overview?language=en_US">partner broadcaster</a>. Affiliate and partner broadcaster monetize their streams. There are 63 affiliate broadcasters and 2 partners which is around 20% of his followers.</li></ul><p><strong>How popular are his followers that stream?</strong></p><ul><li>I initially defined popular as having more view counts than Michael and he currently has around 4K view counts. 32% of broadcasters are considered popular.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*V0lJIS91r47FLRiDZ9DZiQ.png" /></figure><ul><li>This is not a great popularity metric because some streamers could have been streaming for a while thus accumulated view counts but can have low view count per stream. Twitch API only provides a snapshot of view counts but not rates. I used new followers in the last 30 days to obtain a rate metric. I picked the last 30 days because affiliate streamers need at least 7 unique broadcast days in the last 30 days. The newly defined popularity metric is last 30 days new followers and view counts. Michael will still be the benchmark with 4K view counts and 22 new followers in the last 30 days. With this new combination metric, only 15 followers (24%) are considered popular.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*lzCqAlrvYECoFz_u8TZg9Q.png" /></figure><p>Note: I removed a follower with extremely high view counts that skewed the graph.</p><p><strong>How long have his followers been on Twitch?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*I1BTHTbfaYXFQx7ETJYF1Q.png" /></figure><ul><li>Twitch started in 2011 and became the most popular e-sports streaming service since 2013. Almost half of Michael’s followers created their Twitch account less than 2 years ago which is recent compared to Twitch’s overall history.</li></ul><p><strong>Do his followers follow the same people?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*Xg6SAiGGDLsDIs2Ygr16Gg.png" /></figure><ul><li>Most of the common follows are Twitch’s biggest streamers as mentioned in this article: <a href="https://www.theloadout.com/streamers/biggest-streamers">https://www.theloadout.com/streamers/biggest-streamers</a>. The only unique non-partner streamer is saucerina who is Michael’s first follower and a suggested streamer on his Twitch page.</li></ul><h3>Classification Modeling</h3><p>After data exploration, I got a good idea of what features I can use to classify his followers. Here are the features I landed on:</p><ul><li><strong>follower_broadcaster_type</strong>: labeled partner as 2, affiliate as 1, and rest as 0</li><li><strong>view_count</strong>: number of view counts on the user profile</li><li><strong>description</strong>: labeled if profile has a description then 1 and otherwise 0</li><li><strong>target_followed_days</strong>: number of days since user started following Michael</li><li><strong>twitch_age_days</strong>: number of days since user created a Twitch account</li><li><strong>follow_other_cnt</strong>: number of follows</li><li><strong>other_follow_cnt</strong>: number of followers following the user</li><li><strong>Popular_class</strong>: labeled popular as 3, high followers or high view count as 2, non popular streamers as 1, and remaining 0</li><li><strong>other_follow_cnt_30_days</strong>: number of followers following the user in the past 30 days</li></ul><p>I wanted to see if there are any features that were redundant so according to the correlation heatmap, I dropped follower_broadcaster_type and other follow count 30 days because of the high correlation with Popular Class and other follow count. I then scaled the continuous data since large view counts will skew the classification model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*qVWCabs3HXzFTn42CZZ3mg.png" /></figure><p><strong>Modeling</strong></p><p>Using k-means clustering from sklearn, I experimented with different clusters. I landed on 6 clusters that best described his followers. I wanted to understand how k-means clustered by features so I created a relative importance table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*cTiY2rdMtg3oURAqVfVk7g.png" /></figure><p>The relative importance tables allowed me to loosely classify the following:</p><ul><li>Cluster 0: New non-streamers (Count: 184)</li><li>Cluster 1: Old non-streamers (Count: 84)</li><li>Cluster 2: Stagnant streamers (Count: 42)</li><li>Cluster 3: Popular and old streamers (Count: 1)</li><li>Cluster 4: Old loyal followers (Count: 2)</li><li>Cluster 5: Popular and new streamers (Count: 13)</li></ul><p><strong>Conclusion:</strong> Most of Michael’s followers are new non-streamers. Cluster 0 may have a high risk of churning since they are new to Twitch. Hopefully a large portion of Cluster 0 transitions to Cluster 1. Ideally, if Cluster 3 and 5 increase then Michael’s Twitch career would be promising since there could be higher visibility.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5b7b43a7248" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>