<?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 Thummar Ankit on Medium]]></title>
        <description><![CDATA[Stories by Thummar Ankit on Medium]]></description>
        <link>https://medium.com/@mathrunner7?source=rss-e7226cbb9ae1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*cAjFHhmP3NzPVVXi.</url>
            <title>Stories by Thummar Ankit on Medium</title>
            <link>https://medium.com/@mathrunner7?source=rss-e7226cbb9ae1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 15:35:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mathrunner7/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[Election Result Web Scraping in Python]]></title>
            <link>https://mathrunner7.medium.com/election-result-web-scraping-in-python-2a37e3e80038?source=rss-e7226cbb9ae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a37e3e80038</guid>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[elections]]></category>
            <category><![CDATA[requests-library]]></category>
            <category><![CDATA[beautifulsoup]]></category>
            <category><![CDATA[web-scraping-tools]]></category>
            <dc:creator><![CDATA[Thummar Ankit]]></dc:creator>
            <pubDate>Mon, 10 Feb 2025 14:45:39 GMT</pubDate>
            <atom:updated>2025-02-10T14:52:56.256Z</atom:updated>
            <content:encoded><![CDATA[<p>Understanding election results and political trends is essential for gauging the direction of a region or country. Analyzing these results provides insights into potential policy shifts, the broader political landscape, and public sentiment toward the government. With the power of data, we can move beyond assumptions and make informed assessments of political dynamics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*ICVT5xeleO0IOQ7UNplOjQ.png" /></figure><p>First step in web-scraping is to understand html structure of web page.<br>Delhi 2025 assembly election results can be found <a href="https://results.eci.gov.in/ResultAcGenFeb2025/index.htm">here</a>. We need to select constituency to get detailed result for respective seat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m8gm0GaBueVyrCgfG0t53A.png" /></figure><p>After selecting constituency, by clicking on table button gives us detailed result in tabular form for that particular constituency. If somehow we can get this table in python pandas DataFrame for each constituency, we will have entire election result in single table. This webpage can be accessed at <a href="https://results.eci.gov.in/ResultAcGenFeb2025/ConstituencywiseU054.htm">https://results.eci.gov.in/ResultAcGenFeb2025/ConstituencywiseU054.htm</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xcW2YWyuyjJLR6iywef4sQ.png" /></figure><p>With the help of developer tools we can analyze webpage structure.<br>Follow these steps</p><ol><li><strong>Enable Developer Tools</strong>: Press <strong>Ctrl+Shift+I</strong> (or right-click on the page and select <strong>Inspect</strong>) to open the Developer Tools. This tool allows you to inspect the underlying HTML structure of the webpage.</li><li><strong>Locate the Data Table</strong>: In the Developer Tools panel, navigate through the HTML elements to find the section containing your data.<br>- Start by looking at the &lt;body&gt; tag, which contains all the visible content on the page.<br>- Within &lt;body&gt;, find the &lt;main&gt; container that holds the core content of the page.<br>- Inside &lt;main&gt;, look for a series of &lt;div&gt; tags. One of these &lt;div&gt; elements has the class name <strong>custom-table</strong>, which holds the table.</li><li><strong>Find the Table Section</strong>: Under the &lt;div&gt; with the class <strong>custom-table</strong>, you&#39;ll find a &lt;table&gt; element. This &lt;table&gt; is styled with the following class names <strong>table, table-striped</strong> and <strong>table-bordered<br></strong>These class names make it easier to identify the table in the code.</li><li><strong>Path to the Table</strong>: The full HTML path to the table is<br><em>body &gt; main &gt; div &gt; div.custom-table &gt; div &gt; table<br></em>This path provides a clear hierarchy of where the table is located within the page structure.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QQwuwQ1HzhD53TlcvEXHuw.png" /></figure><p>Finally the web page for different seat is in form of https://results.eci.gov.in/ResultAcGenFeb2025/ConstituencywiseU05&lt;constituency_number&gt;.htm where &lt;constituency_number&gt; is in range from 1 to 70, we need to get data table from 70 different pages and merge them.</p><p>To fetch data from webpage we are going to use two packages <strong>BeautifulSoup</strong> and <strong>requests</strong></p><h3>Verify existence of webpage</h3><p>This function first fetches data from given <strong>url</strong> using headers like <strong>User-Agent</strong> which mimic real browser in helping to avoid being blocked and <strong>Referer </strong>to validate the request. Once data is fetched, this function will read response code.<br>1xx : Informational<br>2xx : Success<br>3xx : Redirection<br>4xx : Client Error<br>5xx : Server Error</p><p>If webpage we are trying to read exists it will return response code 200 means OK and function will return True otherwise it return False as output.</p><pre>def check_valid(seat_code):<br>  url = &#39;https://results.eci.gov.in/ResultAcGenFeb2025/ConstituencywiseU05&#39;+str(seat_code)+&#39;.htm&#39;<br>  headers = {<br>    &quot;User-Agent&quot;: &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64)&quot;,<br>    &quot;Referer&quot;: &quot;https://results.eci.gov.in&quot;<br>    }<br>  # Step 1: Fetch the webpage content<br>  response = requests.get(url, headers=headers)<br>  if response.status_code == 200:<br>    return True<br>  else:<br>    return False</pre><h3>Fetch Data</h3><p>Next step after validating web page is to fetch data. This function performs following steps one by one</p><ol><li>First using request.get() method it fetches webpage content for given constituency code.</li><li>Then parses webpage content as html script using BeautifulSoup which returns bs4.BeautifulSoup instance in variable soup</li><li>Using soup.find() method it extracts&lt;table&gt; tag in the webpage and return as bs4.element.Tag instance</li><li>From table variable it again extracts all the rows having &lt;tr&gt; tag</li><li>In every iteration it converts each row in to list of values by splitting cells (&lt;td&gt; tag) and append it to list of rows.</li><li>Then convert the final 2D list in to pandas DataFrame and return.</li></ol><p>This way we get data for given constituency code in standard DataFrame instance.</p><pre>qdef get_table(seat_code):<br>  url = &#39;https://results.eci.gov.in/ResultAcGenFeb2025/ConstituencywiseU05&#39;+str(seat_code)+&#39;.htm&#39;<br>  headers = {<br>    &quot;User-Agent&quot;: &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64)&quot;,<br>    &quot;Referer&quot;: &quot;https://results.eci.gov.in&quot;<br>    }<br>  # Step 1: Fetch the webpage content<br>  response = requests.get(url, headers=headers)<br>  webpage = response.content<br>  # Step 2: Parse the HTML<br>  soup = BeautifulSoup(webpage, &#39;html.parser&#39;)<br>  # Step 3: Find the specific table (adjust the class name or other attributes as necessary)<br>  table = soup.find(&#39;table&#39;, {&#39;class&#39;: &#39;table table-striped table-bordered&#39;})<br>  # Step 4: Define the headers<br>  headers = [&#39;S.N.&#39;, &#39;Candidate&#39;, &#39;Party&#39;, &#39;EVM Votes&#39;, &#39;Postal Votes&#39;, &#39;Total Votes&#39;, &#39;% of Votes&#39;]<br>  # Step 5: Extract the rows<br>  rows = []<br>  for tr in table.find_all(&#39;tr&#39;)[1:-1]:  # Skip the header row and last total row<br>      cells = tr.find_all(&#39;td&#39;)<br>      row = [cell.get_text().strip() for cell in cells]<br>      rows.append(row)<br>  # Step 6: Create a DataFrame and return it<br>  data = pd.DataFrame(rows, columns=headers)<br>  data[&#39;Constituency&#39;] = seat_code<br>  return data</pre><h3>Get data for all constituencies</h3><p>Now create an empty table first and then iterate the loop for each constituency and keep merging it to main table.<br>Save the data into .csv file for further usage.</p><pre>last_constuitency = 70<br>table = pd.DataFrame(columns=[&#39;S.N.&#39;, &#39;Candidate&#39;, &#39;Party&#39;, &#39;EVM Votes&#39;, &#39;Postal Votes&#39;, &#39;Total Votes&#39;, &#39;% of Votes&#39;, &#39;Constituency&#39;])<br>for constituency in range(1,last_constuitency+1):<br>  if check_valid(constituency):<br>      table = pd.concat([table, get_table(constituency)], ignore_index=True)<br><br>#Save table as CSV file for further use<br>table.to_csv(&#39;files/delhi_2025_raw_data.csv&#39;, index=False)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yA6xibEAmNahf9ZbB7tYyQ.png" /></figure><h3>Feature Engineering</h3><p>Finally we can develop new features from received data like constituency wise rank of candidates, total voters, winning margin, vote share of each candidate etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S5ctrNZpccUqzjFr32BSDA.png" /></figure><h3>Exploratory Data Analysis</h3><p>Using prepared data we can perform EDA and statistical analysis.<br>Below are few examples of analysis.</p><h4>Party wise vote share and seat share</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XIN25OJjX9xkvw6mq2fV5Q.png" /></figure><h4>All constituency at a glance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qr7CEzsSjJhWnu29IUOSpA.png" /></figure><h4>Winning margin for each constituency</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-LBPy9gtbfJ1RWfDrj_pyA.png" /></figure><h4>Categorical variable dependency test</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ihEBYqkLY_ntsJZtrsQu6A.png" /></figure><h4>Impact of second runner up on winner</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZVUX8iafxrzXMfIkPDcDtw.png" /></figure><p>You can find same in Delhi_AC_2025.ipynb file at <a href="https://github.com/MathRunner7/Indian_Election_Result">Indian Election Result</a> GitHub repository. Feel free to fork the repository and perform your won experiments on the data.</p><p>Give your comment about this article and opinion about further EDA ideas.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a37e3e80038" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Product Sales Forecasting with Machine Learning]]></title>
            <link>https://mathrunner7.medium.com/product-sales-forecasting-with-machine-learning-91406ce2f98f?source=rss-e7226cbb9ae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/91406ce2f98f</guid>
            <category><![CDATA[sklearn]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[sarimax]]></category>
            <category><![CDATA[forecasting]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Thummar Ankit]]></dc:creator>
            <pubDate>Mon, 03 Feb 2025 19:41:59 GMT</pubDate>
            <atom:updated>2025-02-03T19:51:57.384Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*4NdqTeQx1Q59OA9ZSiPLZw.png" /></figure><h3><strong>Introduction:</strong></h3><p>Effective sales forecasting is fundamental for multiple aspects of retail management and operation, including <em>Inventory Management,</em> <em>Financial Planning</em>, <em>Marketing and Promotions</em>, <em>Supply Chain Optimization and</em> <em>Strategic Decision Making</em></p><p>In this blog, first we will perform EDA to understand the data and later we will explore how to build, optimize, and evaluate machine learning models to forecast sales amount and order volume.</p><h3><strong>Problem Statement:</strong></h3><p>In the competitive retail industry, the ability to predict future sales accurately is crucial for operational and strategic planning. Product sales forecasting aims to estimate the number of products a store will sell in the future, based on various influencing factors such as store type, location, regional characteristics, promotional activities, and temporal variations (such as holidays and seasons). This project focuses on developing a predictive model that uses historical sales data from different stores to forecast sales for upcoming periods.</p><h4><strong>Dataset Description:</strong></h4><p>Dataset contains 188340 unique transactions with 10 columns<br>1. ID: Unique identifier for each record in the dataset.<br>2. Store_id : Unique identifier for each store.<br>3. Store_Type : Categorization of the store based on its type.<br>4. Location_Type : Classification of the store’s location (e.g., urban, suburban).<br>5. Region_Code : Code representing the geographical region where the store is located.<br>6. Date : The specific date on which the data was recorded.<br>7. Holiday : Indicator of whether the date was a holiday (1: Yes, 0: No).<br>8. Discount : Indicates whether a discount was offered on the given date (Yes/No).<br>9. #Order : The number of orders received by the store on the specified day.<br>10. Sales : Total sales amount for the store on the given day.</p><h3><strong>Preprocessing:</strong></h3><p>When we read data as pandas DataFrame, it is good practice to convert column’s datatype such a way that data size can be optimal. Here, we have converted Store ID as <em>unsigned-integer-16, </em>Store Type, Location Type and Region Type as <em>categorical, </em>and Holiday and Discount as <em>boolean </em>to optimize the size of DataFrame and also make operations faster later on.</p><pre># Combine both the dataset into single dataframe<br>data = pd.concat([train, test])<br>data.reset_index(drop=True, inplace=True)<br><br># Change Datatypes to optimize sizes<br># Store_id as unsigned integer 16 (Range is 1 to 371)<br>data.Store_id = data.Store_id.astype(&#39;uint16&#39;)<br><br># Store_Type, Location_Type, Region_Code as categorical<br>data.Store_Type = data.Store_Type.astype(&#39;category&#39;)<br>data.Location_Type = data.Location_Type.astype(&#39;category&#39;)<br>data.Region_Code = data.Region_Code.astype(&#39;category&#39;)<br><br># Holiday and Discount as Boolean<br>data.Holiday = data.Holiday.astype(&#39;bool&#39;)<br>data.replace({&#39;Discount&#39;:{&#39;Yes&#39;:True, &#39;No&#39;:False}}, inplace=True)<br><br># Drop unnecessary column Transaction ID<br>data.pop(&#39;ID&#39;)<br><br># Set Date column as primary index<br>data.set_index(&#39;Date&#39;, inplace=True)</pre><p>With this much datatype conversion size of data is reduced from 17.88 MB to 6.43 MB which is 64.04% reduction.</p><h3><strong>Feature Engineering:</strong></h3><p>Developing correct features helps us to understand data better and train more accurately. Features like Year, QUarter, Month, MonthName, Week, Day, DayNamenetc are developed from date column.</p><pre>data[&#39;Year&#39;] = data.index.year<br>data[&#39;Quarter&#39;] = data.index.quarter<br>data[&#39;Month&#39;] = data.index.month<br>data[&#39;MonthName&#39;] = data.index.month_name()<br>data[&#39;Day&#39;] = data.index.day<br>data[&#39;Week&#39;] = data.index.isocalendar().week<br>data[&#39;Weekday&#39;] = data.index.weekday<br>data[&#39;DayName&#39;] = data.index.day_name()<br>data[&#39;Weekend&#39;] = data.Weekday.apply(lambda x: &#39;Weekend&#39; if x in [&#39;Saturday&#39;,&#39;Sunday&#39;] else &#39;Weekday&#39;)</pre><h3>EDA:</h3><p>Visualization dashboard is developed using tableau can be found here <a href="https://public.tableau.com/app/profile/mathrunner7/viz/ProductSalesForecasting_17346981632090/TimeseriesDashboard">https://public.tableau.com/app/profile/mathrunner7/viz/ProductSalesForecasting_17346981632090/TimeseriesDashboard</a></p><p>Here, we will focus more in visualization using python and plotly package.</p><h4>Univariate Analysis:</h4><p>Histogram plots are great to observe distribution of data visually. From the plot below we can conclude that data is almost normally distributed with outliers present.</p><pre>fig = make_subplots(rows=1, cols=3,<br>                    subplot_titles=(&#39;Order&#39;,&#39;Sales&#39;,&#39;Sales per Order&#39;))<br>fig.add_trace(go.Histogram(x=train.Order), row=1, col=1)<br>fig.add_trace(go.Histogram(x=train.Sales), row=1, col=2)<br>fig.add_trace(go.Histogram(x=train[&#39;S/O&#39;]), row=1, col=3)<br>fig.update_layout(title=&#39;Distribution of target parameters&#39;,<br>                  showlegend=False, title_x=0.5, title_y=0.1)<br>fig.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ETaf0rGE7yYtlseqG_fWQ.png" /></figure><h4>Top &amp; Bottom Store IDs:</h4><p>Aggregating data by Store IDs and visualizing it gives us best and worst performing stores. Despite Order volume and Sales amount are having high positive correlation, some stores are not in top/bottom 10 of sales and order both together.</p><pre>fig = make_subplots(rows=2, cols=1, subplot_titles=(&#39;Top/Bottom 10 Store IDs&#39;, &#39;&#39;))<br>top_order = train.groupby(&#39;Store_id&#39;).agg({&#39;Order&#39;:&#39;sum&#39;}).sort_values(&#39;Order&#39;, ascending=False).head(10)<br>top_sales = train.groupby(&#39;Store_id&#39;).agg({&#39;Sales&#39;:&#39;sum&#39;}).sort_values(&#39;Sales&#39;, ascending=False).head(10)<br>bottom_order = train.groupby(&#39;Store_id&#39;).agg({&#39;Order&#39;:&#39;sum&#39;}).sort_values(&#39;Order&#39;, ascending=False).tail(10)<br>bottom_sales = train.groupby(&#39;Store_id&#39;).agg({&#39;Sales&#39;:&#39;sum&#39;}).sort_values(&#39;Sales&#39;, ascending=False).tail(10)<br>tb_order = pd.concat([top_order, bottom_order])<br>tb_sales = pd.concat([top_sales, bottom_sales])<br>fig.add_trace(go.Bar(x=tb_order.index, y=tb_order.Order, name=&#39;Order&#39;, marker=dict(color=order_color)), row=1, col=1)<br>fig.add_trace(go.Bar(x=tb_sales.index, y=tb_sales.Sales, name=&#39;Sales&#39;, marker=dict(color=sales_color)), row=2, col=1)<br>fig.update_layout(xaxis=dict(type=&#39;category&#39;),<br>                  xaxis2=dict(type=&#39;category&#39;),<br>                  yaxis=dict(title=&#39;Order Volume&#39;),<br>                  yaxis2=dict(title=&#39;Sales Amount&#39;),<br>                  showlegend=False)<br>fig.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*MLAZUUjT7rpMZYFUKK8F6w.png" /></figure><h4>Bivariate Analysis:</h4><p>Bar charts in grid is one of the simplest and easiest way to visualize and compare categorical distributions. From bar charts we can identify Store Type S1 &amp; S4 are having higher sells compared to S2 &amp; S3. Location L4 &amp; L5 are having negligible amount of sales. And in region majority of business is coming from R1 followed by R2m R3 &amp; R4. Weekends have slight higher sales compared to weekdays.</p><pre>order_color = &#39;red&#39;<br>sales_color = &#39;blue&#39;<br>fig = make_subplots(rows=2, cols=4)<br>grouped = train.groupby(&#39;Store_Type&#39;).agg({&#39;Order&#39;:&#39;sum&#39;,&#39;Sales&#39;:&#39;sum&#39;})<br>fig.add_trace(go.Bar(x=grouped.index, y=grouped.Order, marker=dict(color=order_color)), row=1, col=1)<br>fig.add_trace(go.Bar(x=grouped.index, y=grouped.Sales, marker=dict(color=sales_color)), row=2, col=1)<br>grouped = train.groupby(&#39;Location_Type&#39;).agg({&#39;Order&#39;:&#39;sum&#39;,&#39;Sales&#39;:&#39;sum&#39;})<br>fig.add_trace(go.Bar(x=grouped.index, y=grouped.Order, marker=dict(color=order_color)), row=1, col=2)<br>fig.add_trace(go.Bar(x=grouped.index, y=grouped.Sales, marker=dict(color=sales_color)), row=2, col=2)<br>grouped = train.groupby(&#39;Region_Code&#39;).agg({&#39;Order&#39;:&#39;sum&#39;,&#39;Sales&#39;:&#39;sum&#39;})<br>fig.add_trace(go.Bar(x=grouped.index, y=grouped.Order, marker=dict(color=order_color)), row=1, col=3)<br>fig.add_trace(go.Bar(x=grouped.index, y=grouped.Sales, marker=dict(color=sales_color)), row=2, col=3)<br>grouped = train.groupby([&#39;Weekday&#39;,&#39;DayName&#39;]).agg({&#39;Order&#39;:&#39;sum&#39;,&#39;Sales&#39;:&#39;sum&#39;}).reset_index()<br>fig.add_trace(go.Bar(x=grouped.DayName, y=grouped.Order, marker=dict(color=order_color)), row=1, col=4)<br>fig.add_trace(go.Bar(x=grouped.DayName, y=grouped.Sales, marker=dict(color=sales_color)), row=2, col=4)<br>fig.update_layout(title=&#39;Order, Sales and Sales/Order distribution&#39;, showlegend=False, title_x=0.5, title_y=0.85)<br><br>fig.update_yaxes(title=&#39;Order Volume&#39;, row=1, col=1)<br>fig.update_yaxes(title=&#39;Sales Amount&#39;, row=2, col=1)<br><br>fig.update_xaxes(title=&#39;Store Type&#39;, row=2, col=1)<br>fig.update_xaxes(title=&#39;Location Type&#39;, row=2, col=2)<br>fig.update_xaxes(title=&#39;Region Code&#39;, row=2, col=3)<br><br>fig.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rbsfd78jfweLXRiRoif3Ig.png" /></figure><h4>Scatter Plots:</h4><p>Scatter plot gives us idea about how two variables are correlated to each other for a given category.</p><pre>def scatter_plots(df, column):<br>  categories = df[column].astype(&#39;category&#39;).unique().sort_values()<br>  fig = make_subplots(rows=1, cols=len(categories),<br>                      subplot_titles=[str(c) for c in categories])<br>  for i, category in enumerate(categories):<br>    fig.add_trace(go.Scatter(x=df[df[column] == category][&#39;Order&#39;],<br>                             y=df[df[column] == category][&#39;Sales&#39;],<br>                             mode=&#39;markers&#39;, marker=dict(size=2), name=category,),row=1, col=i+1)<br>    fig.update_xaxes(range = [0,300], row=1, col=i+1)<br>    fig.update_yaxes(range = [0,250000], row=1, col=i+1)<br>  fig.update_layout(title=f&#39;{column} wise Order v/s Sales Scatter Plot&#39;, height = 400, showlegend=False, title_x=0.5)<br>  fig.show()</pre><p>Here all the scatter plot indicates that Order volume and Sales amount have strong positive correlation. However if we compare scatter plots with bar charts above, it is evident that despite S1 and S3 store types have similar range of order volume and sales amount, S1 has higher cumulative sales which means number of transactions are high for S1 compared to S3. Same conclusion can be made for locations also, where L1 having highest cumulative sales doesn’t have high order count or sales amount , but has more number of transactions compared to L2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UJ3jyVcAhd66TZv2i105PA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B-AltOfr0Wpp631_6htA0g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RMAjt2eHF3hWZELB30OipA.png" /></figure><p>Holiday scatter plot tells us that when there is holiday transaction density is high but high sales value transactions can be found during working days.<br>Same goes for Discount, where discount days encourages people to spend more compared to regular transaction days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*v1J0QKH1GZAJ9QiPeh4PAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*R0bkIaPYduji2fhmaFSGAQ.png" /></figure><h3>Hypothesis Testing:</h3><p>Hypothesis testing gives us statistical proof with certain confidence about our assumption on the data.</p><h4><em>χ² </em>test:</h4><p>Following code performs <em>χ² </em>test for given category combinations and returns if the two categories are dependent on each other or not.</p><blockquote>Null Hypothesis H0 = Categories are independent of each other<br>Alternate Hypothesis H1 = Categories are dependent</blockquote><pre>from scipy.stats import chi2_contingency<br><br>def chi2test(data, category1, category2, alpha=0.05):<br>  data = data.groupby(by=[category1, category2]).agg({&#39;Order&#39;:&#39;sum&#39;, &#39;Sales&#39;:&#39;sum&#39;}).reset_index()<br>  test = chi2_contingency(data.pivot(index=category1,columns=category2,values=&#39;Order&#39;).fillna(0))<br>  order_dependency = test.pvalue &lt; alpha<br>  if order_dependency:<br>    print(f&#39;Reject the Null Hypothesis. For Order volume, {category1} and {category2} are dependent&#39;, end=&quot; | &quot;)<br>  else:<br>    print(f&#39;Fail to reject the Null Hypothesis. For Order volume, {category1} and {category2} are independent&#39;, end=&quot; | &quot;)<br>  print(f&#39;Test statistics:{test.statistic},\tp-value:{test.pvalue}&#39;)<br><br>  test = chi2_contingency(data.pivot(index=category1,columns=category2,values=&#39;Sales&#39;).fillna(0))<br>  sales_dependency = test.pvalue &lt; alpha<br>  if sales_dependency:<br>    print(f&#39;Reject the Null Hypothesis. For Sales amount, {category1} and {category2} are dependent&#39;, end=&quot; | &quot;)<br>  else:<br>    print(f&#39;Fail to reject the Null Hypothesis. For Sales amount, {category1} and {category2} are independent&#39;, end=&quot; | &quot;)<br>  print(f&#39;Test statistics:{test.statistic},\tp-value:{test.pvalue}&#39;)<br><br>  return {&#39;C1&#39;:category1, &#39;C2&#39;:category2,&#39;Order&#39;: order_dependency, &#39;Sales&#39;: sales_dependency}<br><br># Perform Chi-Squared test for category combinations<br>columns = [&#39;Store_Type&#39;, &#39;Location_Type&#39;, &#39;Region_Code&#39;, &#39;Holiday&#39;, &#39;Discount&#39;, &#39;MonthName&#39;, &#39;DayName&#39;]<br>dependancy_summary = pd.DataFrame([chi2test(train,c1,c2) for c1,c2 in list(permutations(columns,2))])</pre><p>Result of the <em>χ² </em>test is converted into dependency table where True means that category pair is dependent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BBjhTLMBW0hQ0IVGDYIcPQ.png" /></figure><h4>Mean Similarity Test:</h4><p>Following code performs mean similarity test. If performs ANOVA if data satisfy assumptions for it otherwise performs TukeyHSD to check is all categories have same mean or not. It also returns list of pairs having same mean and different mean.</p><blockquote>Null Hypothesis H0 = All categories have same mean<br>Alternate Hypothesis H1 = There is atleast once category having different mean</blockquote><pre>from scipy.stats import f_oneway, kruskal, anderson, levene<br>from statsmodels.stats.multicomp import pairwise_tukeyhsd<br>from itertools import combinations<br><br>def decorator(func):<br>  def wrapper(*args, **kwargs):<br>    print(&#39;~&#39;*100)<br>    print(&#39;~&#39;*100)<br>    result = func(*args, **kwargs)<br>    print(&#39;~&#39;*100)<br>    print(&#39;~&#39;*100)<br>    return result<br>  return wrapper<br><br>@decorator<br>def variance_test(data, category, target, alpha=0.05):<br>  d = data.groupby(by=category).agg(Mean=(target,&#39;mean&#39;), Count=(target, &#39;size&#39;)).reset_index()<br>  print(f&#39;Hypothesis test whether Mean {target} is same for all {category} or not.\n&#39;)<br>  print(d)<br>  print(&#39;=&#39;*53)<br>  cats = sorted(data[category].unique())<br>  groups = {}<br>  for cat in cats:<br>     groups[cat]=data[data[category] == cat][target]<br><br>  # Check for Normality test of all categories<br>  normality_test = True<br>  print(&#39;Criteria check for ANOVA&#39;)<br>  for cat,group in groups.items():<br>    if not anderson(group).fit_result.success:<br>      normality_test = False<br>      print(f&#39;\033[31m \u274C Group {cat} is not normally distributed.\033[0m&#39;)<br>      break<br>  if normality_test:<br>    print(&#39;\033[32m \u2705 All groups are normally distributed.\033[0m&#39;)<br>  # Check for levene test<br>  levene_test = True<br>  _, p_levene = levene(*groups.values())<br>  if p_levene &lt; alpha:<br>    levene_test = False<br>    print(f&#39;\033[31m \u274C Variance of all groups are not same.\033[0m&#39;)<br>  else:<br>    print(f&#39;\033[32m \u2705 Variance of all groups are same.\033[0m&#39;)<br><br>  # Perform One-way ANOVA if criteria meets otheriwse perform Kruskal<br>  if normality_test and levene_test:<br>    print(&#39;One-Way ANOVA will be performed.&#39;)<br>    _, p_value = f_oneway(*groups.values())<br>  else:<br>    print(&#39;All criterias not met for ANOVA. Kruskal test will be performed.&#39;)<br>    _, p_value = kruskal(*groups.values())<br><br>  # Proceed for ttest_ind if one group has different mean<br>  if p_value &gt; alpha:<br>    print(f&#39;p-Value is {p_value} &gt; {alpha} Significance level.\nWe dont have enough evidence to  reject the Null Hypothesis. All means are same.&#39;)<br>    print(&#39;=&#39;*53)<br>    return None<br>  else:<br>    print(f&#39;p-Value is {p_value} &lt; {alpha} Significance level.\nWe have enough evidence to reject the Null Hypothesis and at least one mean is different.&#39;)<br>    print(&#39;=&#39;*53)<br><br>  tukey = pairwise_tukeyhsd(endog=data[target], groups=data[category], alpha=0.05)<br>  print(tukey)<br>  # Extract group1 and group2 using the Tukey object attributes<br>  group1 = tukey.groupsunique[tukey._multicomp.pairindices[0]]<br>  group2 = tukey.groupsunique[tukey._multicomp.pairindices[1]]<br>  pair = [f&#39;{a}-{b}&#39; for a,b in list(zip(group1, group2))]<br>  reject = tukey.reject<br><br>  # Combine group1 and group2 into a DataFrame<br>  group_pairs = pd.DataFrame({&#39;pair&#39;: pair, &#39;reject&#39;: reject})<br>  same_mean_pairs = group_pairs[group_pairs[&#39;reject&#39;] == False][&#39;pair&#39;]<br>  different_mean_pairs = group_pairs[group_pairs[&#39;reject&#39;] == True][&#39;pair&#39;]<br>  print(f&#39;\033[34mPairs having different {target} mean are: {&quot;,&quot;.join(different_mean_pairs.values)}&#39;)<br>  print(f&#39;\033[35mPairs having same {target} mean are: {&quot;,&quot;.join(same_mean_pairs.values)}\033[0m&#39;)<br><br>  return None</pre><p>Two such examples are shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dse8-8fOdOQ_MS9QeaJIqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6JE0Ot89Ck8mta8YUPud3w.png" /></figure><h3>Data Preparation for Model Building:</h3><p>To prepare the data for model building we have considered aggregation and table transformation using pandas standard <em>pd.crosstab()</em> method and then join all the tables on date index to have one single table which can be used to train the models. We are going to use SARIMAX family of algorithms from statsmodels package to train our forecasting model.</p><pre># Data Preperation for modeling<br># Data for Sales forecastig model training<br>overall_sales = train.groupby(level=0).agg({&#39;Sales&#39;:&#39;sum&#39;})<br>id_wise_sales = pd.crosstab(index=train.index, columns=train.Store_id, values =train.Sales, aggfunc=&#39;sum&#39;)<br>store_type_wise_sales = pd.crosstab(index=train.index, columns=train.Store_Type, values =train.Sales, aggfunc=&#39;sum&#39;)<br>location_wise_sales = pd.crosstab(index=train.index, columns=train.Location_Type, values =train.Sales, aggfunc=&#39;sum&#39;)<br>region_wise_sales = pd.crosstab(index=train.index, columns=train.Region_Code, values =train.Sales, aggfunc=&#39;sum&#39;)<br><br># Data for Order forecastig model training<br>overall_order = train.groupby(level=0).agg({&#39;Order&#39;:&#39;sum&#39;})<br>id_wise_order = pd.crosstab(index=train.index, columns=train.Store_id, values =train.Order, aggfunc=&#39;sum&#39;)<br>store_type_wise_order = pd.crosstab(index=train.index, columns=train.Store_Type, values =train.Order, aggfunc=&#39;sum&#39;)<br>location_wise_order = pd.crosstab(index=train.index, columns=train.Location_Type, values =train.Order, aggfunc=&#39;sum&#39;)<br>region_wise_order = pd.crosstab(index=train.index, columns=train.Region_Code, values =train.Order, aggfunc=&#39;sum&#39;)<br><br># Create a Single DataFrame for Sales and Order<br>train_sales = pd.concat([overall_sales, id_wise_sales, store_type_wise_sales, location_wise_sales, region_wise_sales], axis=1)<br>train_order = pd.concat([overall_order, id_wise_order, store_type_wise_order, location_wise_order, region_wise_order], axis=1)<br><br>exog_train_holiday = train.groupby(train.index).mean(&#39;Holiday&#39;)[&#39;Holiday&#39;]<br>exog_test_holiday = test.groupby(test.index).mean(&#39;Holiday&#39;)[&#39;Holiday&#39;]</pre><p>Final table looks like this and here each column will be trained separately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1uAy5-sc2x5wKH5J3nVCbQ.png" /></figure><h3>Stationarity check and Correlation charts:</h3><p>Before proceeding to model building knowing about stationarity of the data and ACF/PACF chart can give us good idea about hyperparameter selection.</p><h4>Dickey-Fuller Test:</h4><p>Dickey-fuller test is statistical method to check whether data is stationary or not. Following code snippet performs augmented dickey-fuller test and prints if the timeseries is stationary or not.</p><pre>def adf_test(dataset):<br>  print(f&#39;Results of Dickey-Fuller Test:&#39;)<br>  for column in dataset.columns:<br>    pvalue = adfuller(dataset[column])[1]<br>    if pvalue &lt;= 0.05:<br>      print(f&#39;\033[32mTimeseries for &quot;{column}&quot; is stationary&#39;, end=&#39;.\t&#39;)<br>    else:<br>      print(f&#39;\033[31mTimeseries for &quot;{column}&quot; is not stationary&#39;, end=&#39;.&#39;)<br>    print(f&#39;\tp-value is {pvalue}\033[0m&#39;)</pre><h4>ACF/PACF Chart:</h4><p>We can find probable values of hyperparameter <em>“p”</em> and <em>“q”</em> from ACF and PACF charts. Cut-off point in PACF gives us basic idea about auto regression order p, whereas cut-off point in ACF gives idea about moving average order q. Looking from ACF/PACF charts for all proposed timeseries we can conclude that <strong><em>“p”</em></strong> is <strong><em>1</em></strong> and <strong><em>“q”</em></strong> can be either <strong>1 or 2</strong>.</p><pre>def acf_pacf_plot(series_sales:pd.Series,series_order:pd.Series)-&gt;None:<br>  fig, (ax1, ax2, ax3, ax4) = plt.subplots(1, 4, figsize=(14, 5))<br>  # Plot Sales ACF in first cell<br>  plot_acf(series_sales, ax=ax1)<br>  ax1.set_title(f&#39;ACF for {series_sales.name} Sales&#39;)<br>  # Plot Sales PACF in second cell<br>  plot_pacf(series_sales, ax=ax2)<br>  ax2.set_title(f&#39;PACF for {series_sales.name} Sales&#39;)<br><br>  # Plot Sales ACF in first cell<br>  plot_acf(series_order, ax=ax3)<br>  ax3.set_title(f&#39;ACF for {series_sales.name} Order&#39;)<br>  # Plot Sales PACF in second cell<br>  plot_pacf(series_order, ax=ax4)<br>  ax4.set_title(f&#39;PACF for {series_sales.name} Order&#39;)<br><br>  # Adjust layout<br>  plt.tight_layout()<br>  plt.show()<br><br>acf_pacf_plot(train_sales[&quot;R1&quot;], train_order[&quot;R1&quot;])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a2cnYGFbIHpglO0zAFoXhw.png" /></figure><h4>Seasonality:</h4><p>Seasonality chart can be generated using following code after decomposing the model. It gives us idea about seasonal parameter <em>“S” </em>in model training.</p><pre>from statsmodels.tsa.seasonal import seasonal_decompose<br><br>def seasonal_chart(series_sales, series_order):<br><br>  fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 5))<br>  # Plot Sales Seasonality in first cell<br>  result = seasonal_decompose(series_sales, model=&#39;additive&#39;, period=None)<br>  result.seasonal.plot(ax=ax1)<br>  ax1.set_title(f&#39;Seasonality for {series_sales.name} Sales&#39;)<br>  # Plot Order Seasonality in second cell<br>  result = seasonal_decompose(series_order, model=&#39;additive&#39;, period=None)<br>  result.seasonal.plot(ax=ax2)<br>  ax2.set_title(f&#39;Seasonality for {series_order.name} Order&#39;)<br><br>  # Adjust layout<br>  plt.tight_layout()<br>  plt.show()<br><br>seasonal_chart(train_sales[&quot;L3&quot;], train_order[&quot;L3&quot;])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dxObTEAc2efaSLCe8r1-GA.png" /></figure><h4>Train-test split:</h4><p>In timeseries we cannot split data randomly for train and test operations. Out of all date wise sorted rows we need to consider first 80% (or whatever proportion we decide) data as train and tailing 20% data as test. Instead of doing this activity manually everytime we can define a class which will perform splitting data into requored porportion with single line command.</p><pre>from sklearn.base import BaseEstimator, TransformerMixin<br><br>class TimeSeriesSplitter(BaseEstimator, TransformerMixin):<br>    def __init__(self, test_size=0.2):<br>        self.test_size = test_size<br>        self.train_data, self.test_data = None, None<br><br>    def fit(self, X, y=None):<br>        &quot;&quot;&quot;No fitting required; just for compatibility.&quot;&quot;&quot;<br>        return self<br><br>    def transform(self, X, y=None):<br>        &quot;&quot;&quot;Split the single-column time series into train and test sets.&quot;&quot;&quot;<br>        n_rows = len(X)<br>        split_index = int(n_rows * (1 - self.test_size))<br>        self.train_data = X.iloc[:split_index].asfreq(&#39;D&#39;)<br>        self.test_data = X.iloc[split_index:].asfreq(&#39;D&#39;)<br>        return self.train_data, self.test_data</pre><h4>Model Training:</h4><p>Model training is most crucial stage in time series forecasting. As SARIMAX is not standard scikit-learn algorithm family, we have developed child class which will perform operations like fit, predict and score.</p><pre>from statsmodels.tsa.statespace.sarimax import SARIMAX<br>from sklearn.base import BaseEstimator<br>from sklearn.metrics import (make_scorer, mean_squared_error as mse, mean_absolute_error as mae, mean_absolute_percentage_error as mape)<br><br>class SARIMAXEstimator(BaseEstimator):<br>    def __init__(self, order=(1,0,1), seasonal_order = (1,0,1,12)):<br>        self.order = order<br>        self.seasonal_order = seasonal_order<br>        self.model_ = None<br><br>    def fit(self, X, exog=None):<br>      self.exog_train=exog<br>      try:<br>        if isinstance(self.exog_train, pd.Series):<br>          self.model_ = SARIMAX(X, exog=self.exog_train, order=self.order, seasonal_order=self.seasonal_order).fit(disp=False)<br>        else:<br>          self.model_ = SARIMAX(X, order=self.order, seasonal_order=self.seasonal_order).fit(disp=False)<br>      except Exception as e:<br>        print(f&quot;Skipping: order={self.order}, seasonal_order={self.seasonal_order}. Error: {e}&quot;)<br>        self.model_ = None<br>      return self<br><br>    def predict(self, n_steps, exog=None):<br>      if self.model_ is None:<br>        return np.full(n_steps, 1E-10)<br>      try:<br>        if not isinstance(self.exog_train, pd.Series):<br>          return self.model_.forecast(steps=n_steps)<br>        elif isinstance(exog, pd.Series):<br>          return self.model_.forecast(steps=n_steps, exog=exog[:n_steps])<br>        else:<br>          raise ValueError(&#39;No exog data provided&#39;)<br>      except Exception as e:<br>        print(e)<br>      return None<br><br>    def score(self, X, exog=None):<br>        n_steps = len(X)<br>        predictions = self.predict(n_steps, exog)<br>        return mape(X, predictions)</pre><h4>Multiple train run with ML Flow and Model selection:</h4><p>With the help of MLFlow package we can do experiment tracking which helps use to save time and avoids repetition of same job.</p><pre>mlflow.set_experiment(&quot;Sore ID Sales Forecasting-1.1.0&quot;)<br>for column in train_sales.columns:<br>  splitter = TimeSeriesSplitter()<br>  X_train, X_test = splitter.fit_transform(train_sales[column])<br>  X_train_exog, X_test_exog = splitter.fit_transform(exog_train_holiday)<br>  for order, seasonal in param_grid:<br>    with mlflow.start_run():<br>      sarimax_estimator = SARIMAXEstimator(order=order, seasonal_order=seasonal)<br>      sarimax_estimator.fit(X=X_train, exog=X_train_exog)<br>      model_score = sarimax_estimator.score(X=X_test, exog=X_test_exog)<br>      mlflow.set_tag(&#39;data&#39;, column)<br>      mlflow.log_params({&#39;order&#39;:order, &#39;seasonal_order&#39;:seasonal})<br>      mlflow.log_metric(&#39;mape&#39;,model_score)<br>      mlflow.sklearn.log_model(sarimax_estimator.model_, &#39;model&#39;)</pre><p>This code trains model on given set of hyper parameters and save them on ML FLow UI server where we can see and compare multiple models at a glance for different combination of inputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bqqlrzB3KmlzNP9K_zS3sQ.png" /></figure><p>After training models on various combination of hyperparameter we came to conclusion that order(p,d,q) = (1,1,1) and seasonal_order(P,D,Q,S) = (1,0,1,7) gives optimal model with least complexity and best MAPE score (&lt;20%). Actual model supposed to be used are stored as pickle file in project folder and will be accessed by deployed app as and when required.</p><h3>Deployment:</h3><p>With the help of Flask framework for WebAPIs we can deploy out forecasting application on any cloud server. Code below is homepage configuration and renders html template whenever page is accessed by end user.</p><pre>from flask import Flask, request, jsonify, render_template<br>import plotly.graph_objs as go<br><br>app = Flask(__name__)<br><br># create end points<br># Welcome point<br>@app.route(&#39;/&#39;) # Homepage<br>def home():<br>    return render_template(&#39;home.html&#39;)<br><br>@app.route(&#39;/get_subcategories&#39;)<br>def sub_categories():<br>    &quot;&quot;&quot;Returns subcategories based on the selected main category.&quot;&quot;&quot;<br>    main_category = request.args.get(&quot;main_category&quot;)<br>    subcategories = SUB_CATEGORIES.get(main_category, [])<br>    return jsonify(subcategories)</pre><p>To get final prediction we need to send a POST request to Falsk app in desired format. Then it will perform some predefined tasks and return forecasted output as jsonified data which can be rendered on webpage to display in form of chart.</p><pre>@app.route(&#39;/submit&#39;, methods=[&#39;GET&#39;, &#39;POST&#39;])<br>def forecast():<br>    if request.method == &#39;POST&#39;:<br>        # Function to make Forecasting<br>        def forecasting(category:str, sub:str, typ:str, n:int):<br>            # Define model pickle file path and load the model<br>            pkl_file = &#39;models/&#39; + sub.lower() + &#39;_&#39; + typ.lower() + &quot;.pkl&quot;<br>            with open(pkl_file, &#39;rb&#39;) as file:<br>                model = pickle.load(file)<br><br>            # Define database pickle file path and load data<br>            split_at = 413<br>            df = pd.read_pickle(&#39;database/&#39;+typ.lower()+&#39;.pkl&#39;)[[sub]]<br>            test = df.iloc[split_at:n+split_at]<br>            exog = pd.read_pickle(&#39;database/X_test_exog.pkl&#39;)[:n]<br>            df = df.iloc[split_at-60:split_at]<br>            test[&#39;pred&#39;] = model.forecast(steps=n, exog=exog)<br>            fig = go.Figure()<br>            fig.add_trace(go.Scatter(x=df.index, y=df[sub], name=&#39;Train values&#39;))<br>            fig.add_trace(go.Scatter(x=test.index, y=test[sub], name=&#39;Test values&#39;))<br>            fig.add_trace(go.Scatter(x=test.index, y=test[&#39;pred&#39;], name=&#39;Forecasting&#39;))<br>            fig.update_layout(title_text=f&#39;Forecasting of {typ} for {sub}&#39;,<br>                              title_x=0.5,title_y=0.85, legend_x=0)<br>            return pio.to_json(fig)<br><br>        # Fetch Query point<br>        main_category = request.get_json()[&#39;MainCategory&#39;]<br>        sub_category = request.get_json()[&#39;SubCategory&#39;]<br>        n_steps = request.get_json()[&#39;n_steps&#39;]<br><br>        order_forecast = forecasting(main_category, sub_category, &#39;order&#39;, n_steps)<br>        sales_forecast = forecasting(main_category, sub_category, &#39;sales&#39;, n_steps)<br>        return jsonify({&#39;order&#39;:order_forecast, &#39;sales&#39;:sales_forecast})</pre><h4>Prediction Examples:</h4><p>Here are some example of forecasting done by an app deployed on AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aiZN0YYWjJ9uHk-srKs7Pg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u7SE55PVRysSrt_nLkKnTg.png" /></figure><h3>Links:</h3><p><a href="https://public.tableau.com/app/profile/mathrunner7/viz/ProductSalesForecasting_17346981632090/TimeseriesDashboard">Tableau Dashboard</a><br><a href="https://github.com/MathRunner7/Product_Sales_Forecasting">GitHub Repository</a><br><a href="http://www.linkedin.com/in/mathrunner7">LinkedIn Profile</a><br><a href="http://mathrunner7.github.io/">Portfolio Website</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91406ce2f98f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>