<?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 Nazira Shaikh on Medium]]></title>
        <description><![CDATA[Stories by Nazira Shaikh on Medium]]></description>
        <link>https://medium.com/@nazira73?source=rss-1836c3d4e1e2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QtsAp76CL_MbrZoJLXDKbQ.jpeg</url>
            <title>Stories by Nazira Shaikh on Medium</title>
            <link>https://medium.com/@nazira73?source=rss-1836c3d4e1e2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 06:42:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nazira73/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[Building a Scalable YouTube ETL Pipeline with AWS and Python]]></title>
            <link>https://medium.com/@nazira73/building-a-scalable-youtube-etl-pipeline-with-aws-and-python-105adb6109a5?source=rss-1836c3d4e1e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/105adb6109a5</guid>
            <dc:creator><![CDATA[Nazira Shaikh]]></dc:creator>
            <pubDate>Sun, 09 Mar 2025 21:19:52 GMT</pubDate>
            <atom:updated>2025-03-10T06:11:54.797Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><p>In today’s data-driven landscape, extracting insights from YouTube data can provide valuable analytics for content creators, marketers, and researchers. To automate and streamline this process, I built a YouTube ETL (Extract, Transform, Load) pipeline that fetches video metadata and comments, processes it, and stores it efficiently for analysis. This project is fully open-source and available on my <a href="https://github.com/Nazira73/youtube-etl-pipeline">GitHub repository</a>.</p><p><strong>Tech Stack</strong></p><p>The pipeline leverages:</p><ul><li><strong>Python</strong> for scripting and data processing</li><li><strong>YouTube API v3 (via RapidAPI)</strong> for data extraction</li><li><strong>AWS Lambda</strong> for serverless execution</li><li><strong>Amazon S3</strong> for data storage</li><li><strong>AWS Glue</strong> for data cataloging</li><li><strong>Amazon Athena</strong> for querying stored data</li></ul><p><strong>Architecture Overview</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ul0OLfY_v2vTciq7bSEFMQ.png" /></figure><p>The ETL pipeline follows a serverless approach, ensuring scalability and cost-efficiency:</p><p><strong>Data Extraction</strong></p><ul><li>The pipeline uses RapidAPI’s YouTube API to fetch video details and comments from specified channels.</li><li>API responses are parsed and converted into structured JSON format.</li><li>API rate limits are handled by batching requests and caching responses.</li></ul><p><strong>AWS Lambda for Automation</strong></p><ul><li>AWS Lambda functions trigger periodically to fetch new data.</li><li>The extracted data is temporarily stored in Amazon S3.</li></ul><p><strong>Data Transformation</strong></p><ul><li>Once stored in S3, the raw JSON data undergoes transformations.</li><li>Data is cleaned, deduplicated, and formatted for analytics (e.g., converting timestamps, normalizing text fields).</li></ul><p><strong>Data Storage &amp; Querying</strong></p><ul><li>AWS Glue crawlers create a metadata catalog for efficient querying.</li><li>Amazon Athena enables SQL-like queries on the stored data without needing a dedicated database.</li></ul><p><strong>Automation &amp; Deployment</strong></p><ul><li>AWS EventBridge schedules Lambda invocations to keep the pipeline running at predefined intervals.</li></ul><p><strong>Challenges &amp; Solutions</strong></p><p>One major challenge was RapidAPI’s limitation on request quotas, which changed from <strong>500 requests/day</strong> to <strong>200 requests/month</strong>. To mitigate this:</p><ul><li>Optimized API calls by fetching only necessary fields.</li><li>Implemented a <strong>caching mechanism</strong> to store frequently accessed data.</li><li>Scheduled incremental updates rather than full data re-fetching.</li></ul><p><strong>Results &amp; Future Enhancements</strong></p><p>This pipeline successfully automates YouTube data collection and allows efficient analysis using AWS cloud services. Future improvements include:</p><ul><li><strong>Integrating AWS Step Functions</strong> for better orchestration.</li><li><strong>Storing processed data in Amazon Redshift</strong> for advanced analytics.</li><li><strong>Developing a visualization dashboard</strong> using Amazon QuickSight or Streamlit.</li></ul><p><strong>Conclusion</strong></p><p>This project demonstrates the power of serverless architecture in building scalable ETL pipelines. By leveraging AWS Lambda, S3, Glue, and Athena, the pipeline ensures efficient data extraction, transformation, and analysis. Check out the full implementation on <a href="https://github.com/Nazira73/youtube-etl-pipeline">GitHub</a> and feel free to contribute!</p><p><em>Got suggestions or ideas? Drop a comment or submit a pull request on GitHub!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=105adb6109a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple Linear Regression: Kaggle House Prices Prediction]]></title>
            <link>https://medium.com/@nazira73/simple-linear-regression-kaggle-house-prices-prediction-76a0350f212d?source=rss-1836c3d4e1e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/76a0350f212d</guid>
            <category><![CDATA[predictive-analytics]]></category>
            <category><![CDATA[predictive-modelling]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[linear-regression]]></category>
            <dc:creator><![CDATA[Nazira Shaikh]]></dc:creator>
            <pubDate>Fri, 15 Mar 2019 17:14:02 GMT</pubDate>
            <atom:updated>2019-03-15T18:15:15.807Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*O0rdwWLe7wjTM9-nlW2Xxg.jpeg" /><figcaption>Image source: activerain.com</figcaption></figure><h3><strong>Introduction</strong></h3><p>If you are interested in building predictive models but confused from where to start, then this article will help you build a <strong><em>Simple Linear Regression model</em></strong> in <strong><em>Python</em></strong>. I have used here the House prices competition dataset available at Kaggle. If you are new in the field of data science like me then Kaggle is a good place to start. Here you can :</p><ul><li>Build predictive models</li><li>Compete with other participant’s</li><li>Learn new insights on various kinds of data.</li></ul><p>The flow for building any predictive model (not only linear regression), let me repeat “<em>any predictive model</em>” will be same. It can be divided into 2 steps:</p><ol><li>Exploratory Data analysis (EDA)</li><li>Model Building</li></ol><p><strong><em>Exploratory Data Analysis:</em></strong><em> </em>Before Building a model we should make sure that the data on which we are about to build the model has all numeric columns, also we should get insights on what is the nature of each feature (i.e column), and many more stuffs (<em>it’s a continuous learning process</em>).</p><p>If this does not make sense to you now then don’t worry, understand that every column of the data should be numeric (also known as data cleaning).</p><p><strong><em>Model Building:</em></strong> Once the data is clean we can build model on the data, this model can be:</p><ul><li>Binary class Classification model (when the target is binary, i.e having only two classes)</li><li>Multi-class Classification model (when the target has multiple classes)</li><li>Regression model (when the target is continuous numeric variable)</li></ul><p><em>In our case we are said to predict the “</em><strong><em>Sale price”</em></strong><em> of the house, so we will be building a Regression model.</em></p><h3><strong>Reading the Data</strong>:</h3><p>We are provided with two data sets in csv format, one for training the model <em>“train.csv”</em> and the second for validating the model <em>“test.csv”</em></p><pre><em># Importing the essential modules/packages</em><br><br><strong>import</strong> <strong>numpy</strong> <strong>as</strong> <strong>np</strong><br><strong>import</strong> <strong>pandas</strong> <strong>as</strong> <strong>pd</strong></pre><pre>hp_train = pd.read_csv(&quot;House_prices_train.csv&quot;)<br>hp_test = pd.read_csv(&quot;House_prices_test.csv&quot;)</pre><pre><em># Sneakpeak of train data</em> <br>print(&quot;Shape of training data: &quot;,hp_train.shape) <br>hp_train.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MOHpPzyRAEJYutnczpY9RQ.png" /></figure><pre><em># Sneakpeak of test data</em> <br>print(&quot;Shape of test data: &quot;,hp_test.shape) <br>hp_test.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K_2LrLqncHHZKrhdhT07nQ.png" /></figure><p>Observe that test data has one less column as compared to train data, this is our target column to be predicted.</p><p>Lets quickly identify which column is missing in the test data</p><pre>hp_train.columns.difference(hp_test.columns)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*AWgM4LSgKLT1Ov2y7yXdiw.png" /></figure><h3>Data Cleaning:</h3><p>Lets combine the train and test data before cleaning, while doing this…</p><ol><li>Insert a new column named ‘data’. So that post data-cleaning we can again separate them exactly in the way it was given.</li><li>Insert a Target column to the test dataframe and fill it with NaN’s, this ensures that both the data sets have similar and equal number of columns</li></ol><pre># Combining train and test data</pre><pre>hp_train[&quot;data&quot;] = &#39;train&#39;<br>hp_test[&#39;data&#39;] = &#39;test&#39;<br>hp_test[&#39;SalePrice&#39;] = np.nan<br>hp_test = hp_test[hp_train.columns]<br>hp = pd.concat([hp_train,hp_test],axis = 0)<br>print(&quot;Shape of combined Data: &quot;,hp.shape)<br>hp.tail()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lxJHqBahoillRfIbUWGMAA.png" /></figure><p>Here we go. We have combined the data sets, but is the data clean???</p><pre>cat_cols = hp.select_dtypes([&#39;object&#39;]).columns</pre><pre>list(zip(hp[cat_cols].columns,hp[cat_cols].dtypes,hp[cat_cols].nunique()))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*5DVBj4m8p2OL8pkvLOLwJQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*ejvCEO0tIHUkRxgM2hrsvw.png" /></figure><p>There are too many non-numerical columns (categorical columns), we can create dummies for each categorical columns using ‘<em>pandas.get_dummies’ </em>function. Before this also check whether they do have any missing values</p><pre># Lets check the missing value percentage for categorical column<br>(hp[cat_cols].isnull().sum())*100/hp.shape[0]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/281/1*2GBV0yNBTQMdxaNjllXKmw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*YuAJ8k2dbYI1m44gP0poqQ.png" /></figure><p>Here I have imputed all the missing value in the categorical column with its mode and at some places created new category as ‘unknown’ depending on the details given in the data description on each column. For the detailed code <a href="https://github.com/Nazira73/Kaggle_Housing_Price/blob/master/Kaggle_Housing_Price.ipynb/#161b">click here</a>. Similarly I have imputed all the missing values in the numeric column with its mean.</p><p>Still the categorical columns are non numerical, but with no missing values :) So lets convert all of the categorical cols to numerical (also known as dummy) using ‘<em>pandas.get_dummies’</em> function and removing the original categorical column</p><pre><em># Creating Dummies</em><br>dummy_matrix = pd.get_dummies(hp[cat_cols[:-1]])</pre><pre># Removing original categorical cols<br>hp.drop(cat_cols[:-1],axis = 1,inplace = True)<br>hp.shape</pre><pre>print(&quot;Shape of dummy matrix: &quot;,dummy_matrix.shape)<br>dummy_matrix.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j4CFyMmHLjNqS83gNdES0g.png" /></figure><p>Lets concat this dummy matrix to our data.</p><pre># Concatenating dummies with data<br>hp = pd.concat([hp,dummy_matrix],axis = 1)<br>del dummy_matrix<br>hp.shape</pre><pre>cat_cols = hp.select_dtypes([&#39;object&#39;]).columns<br>list(zip(hp[cat_cols].columns,hp[cat_cols].dtypes,hp[cat_cols].nunique()))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*aFPxShuIKALPDp4e9MwXvg.png" /></figure><p>Voila! No more categorical columns left, except ‘data’ which we are going to drop soon.</p><p>Let’s split our clean train and test data</p><pre>hp_train = hp[hp[&quot;data&quot;]==&#39;train&#39;]<br>hp_test = hp[hp[&quot;data&quot;]==&#39;test&#39;]<br>del hp_train[&#39;data&#39;]<br>hp_test.drop([&#39;data&#39;,&#39;SalePrice&#39;],axis = 1,inplace = True)<br>hp_train.shape,hp_test.shape</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*gMsZLlr6E2xiXBeagN1AFg.png" /></figure><h3>Model Building:</h3><p>The test column does not contain the target variable. So if we start building the model on the entire training data then how would we make out that how far are we from the actual values. Hence to observe the tentative performance lets first work over training data,by splitting them into two parts. I am using an 80%–20% split. You can go with 90%-10% or 70%-30%</p><pre>from sklearn.cross_validation import  train_test_split<br>hp_train_train,hp_train_test = train_test_split(hp_train,test_size = 0.2,random_state = 2)</pre><p>Now separating the predictors variables (independent variables) and the response variable(target variable)</p><pre># Separating the predictors and response</pre><pre>x_train = hp_train_train.drop(&quot;SalePrice&quot;,axis = 1)<br>y_train = hp_train_train[&#39;SalePrice&#39;]</pre><p>Time to fit the model, we are building the most basic model (i.e linear regression model) which is available in ‘<em>sklearn.linear_model’ </em>package.</p><pre>from sklearn.linear_model import LinearRegression<br>lm = LinearRegression()<br>lm.fit(x_train,y_train)</pre><p>That’s it !!! Done with model building, but what does this model tells us</p><pre>lm.intercept_</pre><pre>list(zip(hp.columns,lm.coef_))</pre><p>This will give us huge list and shows the dependencies of target on each predicted variables. We have built the model on 80% data, now let us predict the target for the rest on 20% data</p><pre>x_test = hp_train_test.drop(&quot;SalePrice&quot;,axis = 1)<br>y_test = hp_train_test[&#39;SalePrice&#39;]</pre><pre>p_test = lm.predict(x_test)</pre><p>p_test holds the predicted value.</p><h3>Tentative Performance Measure:</h3><pre>from sklearn.metrics import mean_absolute_error,r2_score</pre><pre>print(&quot;Linear_regression_mean_absolute_error:&quot;,mean_absolute_error(<br>y_test,p_test))</pre><pre>residual = p_test - y_test<br>rmse = np.sqrt(np.dot(residual,residual)/len(p_test))<br>print(&quot;Root_mean_square_error : &quot;,rmse)</pre><pre>r_square = r2_score(y_test,p_test)<br>print(&quot;R-Square of the model : &quot;,r_square)</pre><pre>Output:</pre><pre>mean_absolute_error:  19251.392477943875 <br>Root_mean_square_error :  37607.52732126701 <br>R-Square of the model :  0.786428655695136</pre><p>We now have a rough idea on how our model is behaving, an <strong>R-square</strong> of <strong>0.7846</strong> says that the available predictor variables explains 78.4% behavior of the target. Now we can build the model on entire training data and predict for test data</p><pre># Now let us build the model on entire training data<br>x_train = hp_train.drop(&quot;SalePrice&quot;,axis = 1)<br>y_train = hp_train[&quot;SalePrice&quot;]<br>lm.fit(x_train,y_train)</pre><pre>p_test = lm.predict(hp_test)<br>p_test = pd.DataFrame(p_test)</pre><pre>p_test.to_csv(&quot;Simple_Linear_regression.csv&quot;,index= False)</pre><p>This gave me a score of <strong>0.2009</strong> with a rank of <strong>3389</strong> on the kaggle leaderboard.</p><p>In my next article we will be discussing on improving this model further. This improvement helped me to take my rank from <strong>3389</strong> to <strong>1299</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76a0350f212d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>