<?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 Athul Anish on Medium]]></title>
        <description><![CDATA[Stories by Athul Anish on Medium]]></description>
        <link>https://medium.com/@athulanish?source=rss-a3b62ec099d4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FKwqrTR7U7bNc8qaAGKKMA.jpeg</url>
            <title>Stories by Athul Anish on Medium</title>
            <link>https://medium.com/@athulanish?source=rss-a3b62ec099d4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 10:45:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@athulanish/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[The 10 DAX Functions Every Analyst Should Master]]></title>
            <link>https://athulanish.medium.com/the-10-dax-functions-every-analyst-should-master-1b4c4d312cc0?source=rss-a3b62ec099d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b4c4d312cc0</guid>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[microsoft]]></category>
            <dc:creator><![CDATA[Athul Anish]]></dc:creator>
            <pubDate>Thu, 20 Nov 2025 11:55:53 GMT</pubDate>
            <atom:updated>2025-11-20T11:55:53.629Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7xUfFWDmBc0hCxLaFeFGzg.png" /></figure><p>DAX can feel overwhelming at first, but the truth is that most of the work you’ll ever do in Power BI comes down to a small set of essential formulas . Learn these well and everything else becomes easier, faster, and far less confusing.</p><p>In this guide, I break down the ten DAX functions you ll use near in real projects explained in plain English, with small examples you can remember . No jargon, no excess theory, just the hard nosed knowledge you need to build better dashboards and understand what s really happening behind the scenes.</p><h3>1. SUM</h3><p><strong>What it does:</strong><br> Adds up all values in a column.</p><pre>Total Sales = SUM(Sales[SalesAmount])</pre><p><strong>Think of it as:</strong><br> “Give me the total of this numeric column.”</p><h3>2. COUNTROWS</h3><p><strong>What it does:</strong><br> Counts how many rows are in a table (or filtered table).</p><pre>Number of Orders = COUNTROWS(Sales)</pre><p><strong>Think of it as:</strong><br> “How many rows/records do we have here?”</p><h3>3. CALCULATE</h3><p><strong>What it does:</strong><br> Changes the filter context and then evaluates an expression. This is the core DAX function.</p><pre>Sales Last Year UK =<br>CALCULATE(<br>    SUM(Sales[SalesAmount]),<br>    Sales[Year] = 2024,<br>    Sales[Country] = &quot;UK&quot;<br>)</pre><p><strong>Think of it as:</strong><br> “Do this calculation, but only for these conditions.”</p><h3>4. FILTER</h3><p><strong>What it does:</strong><br> Returns a table with only the rows that match a condition. Often used inside CALCULATE.</p><pre>High Value Orders =<br>CALCULATE(<br>    COUNTROWS(Sales),<br>    FILTER(Sales, Sales[SalesAmount] &gt; 1000)<br>)</pre><p><strong>Think of it as:</strong><br> “Give me only the rows where this is true.”</p><h3>5. SUMX</h3><p><strong>What it does:</strong><br> Loops over a table, calculates something row by row, then adds it up.</p><pre>Total Line Amount =<br>SUMX(<br>    Sales,<br>    Sales[Quantity] * Sales[UnitPrice]<br>)</pre><p><strong>Think of it as:</strong><br> “For each row, calculate this expression, then sum all results.”</p><p><strong>Use it when:</strong><br> You can’t simply sum a single column.</p><h3>6. DIVIDE</h3><p><strong>What it does:</strong><br> Safely divides one number by another, avoiding divide-by-zero errors.</p><pre>Avg Sales per Order =<br>DIVIDE(<br>    SUM(Sales[SalesAmount]),<br>    COUNTROWS(Sales)<br></pre><p><strong>Think of it as:</strong><br> “Do a division, but don’t break when the denominator is zero.”</p><h3>7. IF</h3><p><strong>What it does:</strong><br> Basic “if this, then that, otherwise something else” logic.</p><pre>Order Size Category =<br>IF(<br>    Sales[SalesAmount] &gt; 1000,<br>    &quot;High&quot;,<br>    &quot;Normal&quot;<br>)</pre><p><strong>Think of it as:</strong><br> “Check a condition and return one label or another.”</p><h3>8. SWITCH</h3><p><strong>What it does:</strong><br> Cleaner alternative to multiple nested IF statements.</p><pre>Performance Rating =<br>SWITCH(<br>    TRUE(),<br>    [Sales vs Target] &gt;= 1.2, &quot;Excellent&quot;,<br>    [Sales vs Target] &gt;= 1.0, &quot;On Target&quot;,<br>    [Sales vs Target] &gt;= 0.8, &quot;Below Target&quot;,<br>    &quot;Poor&quot;<br>)</pre><p><strong>Think of it as:</strong><br> “Match a value or range to the right label using multiple rules.”</p><h3>9. RELATED</h3><p><strong>What it does:</strong><br> Pulls a value from a related table.</p><pre>Order Country =<br>RELATED(Customer[Country])</pre><p><strong>Think of it as:</strong><br> “Look up the matching value from the related table.”</p><p><strong>Use it when:</strong><br> You’re in row context (like calculated columns) and need fields from another table.</p><h3>10. ALL</h3><p><strong>What it does:</strong><br> Removes filters from a column or table — essential for percentages and “over total” metrics.</p><pre>Sales % of Total =<br>DIVIDE(<br>    SUM(Sales[SalesAmount]),<br>    CALCULATE(<br>        SUM(Sales[SalesAmount]),<br>        ALL(Sales)<br>    )<br>)</pre><p><strong>Think of it as:</strong><br> “Ignore current filters so I can compare against the overall total.</p><p>Once you get comfortable with these ten core functions, everything else in Power BI becomes easier to read, easier to troubleshoot, and much faster to build. These formulas show up in almost every real-world report, whether you re calculating totals, comparing performance, building KPIs, or creating cleaner logic for your dashboards. Master them, and you ll have a solid foundation for tackling more advanced DAX with confidence. Keep experimenting, keep breaking things, and keep learning because the more you play with DAX, the more powerful your insights become.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b4c4d312cc0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Science vs. Crypto Volatility: A Price Analysis Project]]></title>
            <link>https://medium.com/swlh/data-science-vs-crypto-volatility-a-price-analysis-project-f4941a3e5734?source=rss-a3b62ec099d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4941a3e5734</guid>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[investment]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Athul Anish]]></dc:creator>
            <pubDate>Thu, 08 May 2025 09:34:02 GMT</pubDate>
            <atom:updated>2025-05-08T09:34:02.727Z</atom:updated>
            <content:encoded><![CDATA[<p>Remember when cryptocurrency seemed to come out of nowhere? It’s definitely made its mark on how we think about money and investing. The price of these digital coins can really jump around — we’ve seen stories of people becoming millionaires overnight and others facing big losses. You’ve probably heard of the major players like Bitcoin, Doge, and Ethereum — they’re the big talk of the town. But there are tons of other, smaller cryptocurrencies too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bsTabI1apD07ibIY" /><figcaption>Photo by <a href="https://unsplash.com/@kanchanara?utm_source=medium&amp;utm_medium=referral">Kanchanara</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>So, what’s the story behind all this price movement? Let’s dive in and see how crypto prices have evolved over the years.</p><pre>### Install the necessary libraries<br><br>import pandas as pd          #### For data manipulation<br>import numpy as np           #### For mathematical problems <br>import matplotlib.pyplot as plt #### For visualisations <br>import warnings               #### To remove warnings that may pop up<br>warnings.filterwarnings(&#39;ignore&#39;)<br><br>import plotly.io as pio   #### For visualisations and to render in the notebook<br>pio.renderers.default = &#39;notebook&#39;</pre><pre>data = pd.read_csv(&quot;//aueafiler1.auea.internal/Staff Private$/athul.anish/Downloads/bitcoin.csv&quot;) #### read data<br>data</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*eKE_Wo3poRiXFe_NSKan1g.png" /><figcaption>Table showing all the Crypto coin and their respective parameters</figcaption></figure><pre>data.isnull().sum() ###display number of missing values per column</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*gmxPgagbqp4U0N7BKkHrBg.png" /><figcaption>List showing number of missing values per instance</figcaption></figure><pre>data[&#39;Date&#39;] = pd.to_datetime(data[&#39;Date&#39;], format = &quot;%d/%m/%Y&quot; ) ### change to the right data format <br><br>data = data.sort_values(by = &quot;Date&quot;) ### sorting by date<br><br>data.reset_index(inplace = True, drop = True) ### give the dataset a cleaner look<br><br>### visualisation to see performance of all coins<br><br>plt.figure(figsize = (16,8))<br><br>plt.subplot(3,1,1)<br>plt.plot(data[&#39;Date&#39;], data[&#39;Open&#39;],color = &#39;orange&#39;, alpha = 1)<br>plt.title(&#39;Open vs Time&#39;)<br>plt.xlabel(&#39;Date&#39;)<br>plt.ylabel(&#39;Open&#39;)<br><br>plt.subplot(3,1,2)<br>plt.plot(data[&#39;Date&#39;], data[&#39;Close&#39;],color = &#39;gold&#39;, alpha = 1)<br>plt.title(&#39;Close vs Time&#39;)<br>plt.xlabel(&#39;Date&#39;)<br>plt.ylabel(&#39;Close&#39;)<br><br><br><br>plt.subplot(3,1,3)<br>plt.plot(data[&#39;Date&#39;], data[&#39;High&#39;],color = &#39;cyan&#39;, alpha = 1)<br>plt.title(&#39;High vs Time&#39;)<br>plt.xlabel(&#39;High&#39;)<br>plt.ylabel(&#39;Open&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*anIlSeCq669hNLiADgeZXA.png" /><figcaption>Time series representaion of parameters vs time</figcaption></figure><pre>#Lets also look at the change in volume over time<br>plt.figure(figsize = (14,6))<br><br>plt.plot(data[&#39;Date&#39;], data[&#39;Volume&#39;], linestyle = &#39;solid&#39;)<br><br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jg0UxVTQ_eny5sg_iIeZgA.png" /><figcaption>Graph showing rise in volume over the years</figcaption></figure><pre>#Lets find the daily, weekly and monthly change in price<br><br>data[&#39;Daily Change %&#39;] = data[&#39;Close&#39;].pct_change()*100 ### for daily change<br><br>data[&#39;Weekly Change %&#39;] = data[&#39;Close&#39;].pct_change(periods = 7)*100 ### for weekly change<br><br>data[&#39;Monthly Change %&#39;] = data[&#39;Close&#39;].pct_change(periods = 30)*100 ### for monthly change<br><br>data = data.dropna() # to remove any empty columns<br><br>data</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IyD6xmSMsNB9CuS4D6pO3A.png" /></figure><pre>### Now lets plot the changes and see how that looks<br>plt.figure(figsize = (16,8))<br><br>### Daily change<br>plt.subplot(3, 1, 1)<br>plt.plot(data[&#39;Date&#39;], data[&#39;Daily Change %&#39;], color=&#39;blue&#39;, alpha=0.6)<br>plt.title(&#39;Daily price change rate&#39;)<br>plt.xlabel(&#39;Date&#39;)<br>plt.ylabel(&#39;% Change&#39;)<br><br>### Weekly change<br>plt.subplot(3, 1, 2)<br>plt.plot(data[&#39;Date&#39;], data[&#39;Weekly Change %&#39;], color=&#39;orange&#39;, alpha=0.6)<br>plt.title(&#39;Weekly price change rate&#39;)<br>plt.xlabel(&#39;Date&#39;)<br>plt.ylabel(&#39;% Change&#39;)<br><br>### Monthly change<br>plt.subplot(3, 1, 3)<br>plt.plot(data[&#39;Date&#39;], data[&#39;Monthly Change %&#39;], color=&#39;green&#39;, alpha=0.6)<br>plt.title(&#39;Monthly price change rate&#39;)<br>plt.xlabel(&#39;Date&#39;)<br>plt.ylabel(&#39;% Change&#39;)<br><br>plt.tight_layout() ### displays results more cleaner<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OR7qOx78AF10fuippG-xyw.png" /><figcaption>Time series representaion of price change over fixed terms</figcaption></figure><pre>## I am curios mainly to learn about the performance of the main coin over <br>## the last couple years so I am filtering out just bitcoin and doing analysis<br>## to understand the story better<br><br>df = pd.DataFrame(data) <br>df = df[df[&#39;Name&#39;] == &#39;Bitcoin&#39;]<br>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GTuV2Tef4Nj142yHFujPSw.png" /></figure><pre># Visualisations<br>plt.figure(figsize = (16,8))<br><br>plt.plot(df[&#39;Date&#39;],df[&#39;Volume&#39;],color = &#39;r&#39;,alpha= 0.6)<br>plt.title(&#39;Performance of Bitcoin Over Time&#39;)<br>plt.xlabel(&#39;Date&#39;)<br>plt.ylabel(&#39;Time&#39;)<br><br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z3qCGFEEVLCKmpuMZV6TLA.png" /><figcaption>Graph showing the growth of Bitcoin over time</figcaption></figure><h4>Volatility</h4><pre>#daily, weekly, monthly changes<br><br>df[&#39;Daily Change %&#39;] = df[&#39;Close&#39;].pct_change()*100<br>df[&#39;Weekly Change %&#39;] = df[&#39;Close&#39;].pct_change(periods = 7)*100<br>df[&#39;Monthly Change %&#39;] = df[&#39;Close&#39;].pct_change(periods = 30)*100<br><br>df = df.dropna()<br><br>### lets plot the changes individually to study<br><br>plt.figure(figsize = (16,8))<br><br>plt.subplot(3,1,1)<br>plt.plot(df[&#39;Date&#39;],df[&#39;Daily Change %&#39;], color = &#39;b&#39;, alpha = 0.6)<br>plt.title(&#39;Daily Rate of Change&#39;)<br>plt.xlabel(&#39;Date&#39;)<br>plt.ylabel(&#39;Daily&#39;)<br><br>plt.subplot(3,1,2)<br>plt.plot(df[&#39;Date&#39;],df[&#39;Weekly Change %&#39;], color = &#39;m&#39;, alpha = 0.6)<br>plt.title(&#39;Weekly Rate of Change&#39;)<br>plt.xlabel(&#39;Date&#39;)<br>plt.ylabel(&#39;Week&#39;)<br><br>plt.subplot(3,1,3)<br>plt.plot(df[&#39;Date&#39;],df[&#39;Monthly Change %&#39;], color = &#39;c&#39;, alpha = 0.6)<br>plt.title(&#39;Monthly Rate of Change&#39;)<br>plt.xlabel(&#39;Date&#39;)<br>plt.ylabel(&#39;Month&#39;)<br><br>plt.tight_layout()<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E9eqIqiNQ1VDTwYflQcC1g.png" /><figcaption>Rate of price change over time</figcaption></figure><pre>daily_returns = df[&#39;Close&#39;].pct_change().dropna()<br>daily_returns<br><br>volatility = daily_returns.std() ### Calculating standard deviation helps us understand how much the stock price fluctuates.</pre><h4>Risk Assessment For Planned Investment</h4><pre>confidence_level = 0.05 ### calculate 5th percentile (95% confidence level) of daily returns to understand max loss on a bad day<br>VaR = daily_returns.quantile(confidence_level)<br><br>risk_metrics = pd.DataFrame([{&#39;Volatility&#39;: volatility, &#39;Value At Risk (VaR)&#39;: VaR}])<br>print(risk_metrics)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*oyWx0NDEgc70DBEVGOtVpA.png" /><figcaption>Risk Assessment Results</figcaption></figure><p>Looking at the result above, we can assume that Bitcoin has a fuluctuation of 4.24 percent (which is really high) and at a 95 % confidence level, the daily loss for Bitcoin is 6.13 which basically means out of 100 cases, 95 are not expeceted to have losses exceeding 6.13 percent however the remaning 5 percent might have heavy losses.</p><h4>Moving Average</h4><p>So far, we have done some exploratory analysis, understood the data, and done some minor engineering to ensure a clean database structure.</p><p>Looking at the visualisations above, I can see an overall general upward trend, but what I can also see is the aggressiveness of fluctuations of bitcoin prices.</p><p>To understand the flow a bit better, I am going to take the mean of price over a set number of days and then plot those means so that we can get a smoother graph and hence a clearer picture.</p><pre>###calculating moving averages<br>df[&#39;Bitcoin_5D_MA&#39;] = df[&#39;Close&#39;].rolling(window = 5).mean()<br>df[&#39;Bitcoin_10D_MA&#39;] = df[&#39;Close&#39;].rolling(window = 10).mean()<br>df[&#39;Bitcoin_20D_MA&#39;] = df[&#39;Close&#39;].rolling(window = 20).mean()<br>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GNnOJZgpONRMhQuD54-nag.png" /><figcaption>Table showing 5,10,20 Day moving averages</figcaption></figure><pre>### Visualisations<br>import plotly.graph_objects as go<br><br>fig = go.Figure() ### plotting the graph<br><br>fig.add_trace(go.Scatter(x = df[&#39;Date&#39;],<br>                         y = df[&#39;Close&#39;],<br>                         mode = &#39;lines&#39;,<br>                         name = &#39;Daily Change&#39;)) ### adding the points<br><br>fig.add_trace(go.Scatter(x = df[&#39;Date&#39;],<br>                         y = df[&#39;Bitcoin_5D_MA&#39;],<br>                         mode = &#39;lines&#39;,<br>                         name = &#39;5 Day Moving Average&#39;)) ### adding the points<br><br>fig.add_trace(go.Scatter(x = df[&#39;Date&#39;],<br>                         y = df[&#39;Bitcoin_10D_MA&#39;],<br>                         mode = &#39;lines&#39;,<br>                         name = &#39;10 Day Moving Average&#39;)) ### adding the points<br><br>fig.add_trace(go.Scatter(x = df[&#39;Date&#39;],<br>                         y = df[&#39;Bitcoin_20D_MA&#39;],<br>                         mode = &#39;lines&#39;,<br>                         name = &#39;20 Day Moving Average&#39;)) ### adding the points<br>fig.update_layout( <br>    title = &#39;Bitcoin Moving Averages&#39;,<br>    xaxis_title = &#39;Date&#39;,<br>    yaxis_title =&#39;Price&#39;,<br>    legend = dict(title = &#39;Legend&#39;)) ### design<br><br>fig.show(renderer = &#39;browser&#39;) ###  Using browser here to open the graph in the default browser as it&#39;s not showing up on my notebook</pre><p>The moving averages across all groups show a similar trend, which is upward with a sharp spike in the year 2021</p><h4>Correlation</h4><p>Let&#39;s have a look at the relationship between bitcoin volume and market cap</p><pre>plt.figure(figsize = (16,8))<br><br>plt.scatter(df[&#39;Marketcap&#39;], df[&#39;Volume&#39;], alpha = 0.6, color = &#39;b&#39;)<br>plt.title(&#39;Correlation: Bitcoin Volume vs Marketcap&#39;)<br>plt.xlabel(&#39;Market Capitalisation&#39;)<br>plt.ylabel(&#39;Volume&#39;)<br>plt.grid(True)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhYNTljlMPFVtWJs8gGXIQ.png" /><figcaption>Volume vs Marketcap</figcaption></figure><pre>corr = df[&#39;Close&#39;].corr(df[&#39;Volume&#39;])<br>print (f&quot;correlation volume vs marketcap:{corr:.2f}&quot;)<br><br>corr = df[&#39;Marketcap&#39;].corr(df[&#39;Volume&#39;])<br>print (f&quot;correlation volume vs marketcap:{corr:.2f}&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*BeQ3L9uelDBctBES1b9DAA.png" /></figure><pre>plt.figure(figsize = (16,8))<br><br>plt.scatter(df[&#39;Close&#39;], df[&#39;Volume&#39;], alpha = 0.6, color = &#39;r&#39;)<br>plt.title(&#39;Correlation: Bitcoin Volume vs Closing Price&#39;)<br>plt.xlabel(&#39;Closing Price&#39;)<br>plt.ylabel(&#39;Volume&#39;)<br>plt.grid(True)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VRSJqckduiVILfiFoXrXEQ.png" /><figcaption>Bitcoin volume vs Closing Price</figcaption></figure><h4>Relative Strength Index</h4><p>Now let&#39;s have a look at how Bitcoin prices are changing.</p><p>A high RSI value means time to sell, and a low RSI value means time to buy</p><pre>#### Lets create a function to calculate rsi value<br>def calculate_rsi(prices, window = 14):<br>    delta = prices.diff()<br>    gain = (delta.where(delta&gt; 0,0))<br>    loss = (delta.where(delta&lt; 0,0))<br>    rs = gain/loss<br>    rsi = 100 - (100/(1+rs))<br>    return rsi<br><br>### rsi for bitcoin<br>df[&#39;Bitcoin rsi&#39;] = calculate_rsi(df[&#39;Daily Change %&#39;])<br><br>fig = go.Figure()<br><br>fig.add_trace(go.Scatter(x = df[&#39;Date&#39;],<br>                         y = df[&#39;Close&#39;],<br>                         mode = &#39;lines&#39;,<br>                         name = &#39;RSI&#39;))<br><br>fig.add_trace(go.Scatter(x = df[&#39;Date&#39;],<br>                         y = [70] * len(df[&#39;Date&#39;]),<br>                         mode = &#39;lines&#39;,<br>                         line = dict(color = &#39;red&#39;, dash = &#39;dash&#39;),<br>                         name = &#39;Overbrought (&gt;70)&#39;))<br><br>fig.add_trace(go.Scatter(x = df[&#39;Date&#39;],<br>                         y = [30] * len(df[&#39;Date&#39;]),<br>                         mode = &#39;lines&#39;,<br>                         line = dict(color = &#39;green&#39;, dash = &#39;dash&#39;),<br>                         name = &#39;Oversold (&lt;30)&#39;))<br><br>fig.show(renderer = &#39;browser&#39;)</pre><h4>Sharpe Ratio</h4><p>This statistical ratio tells us if we are getting a good return for the amount of risk we are taking.</p><p>The ratio is calculated by dividing excess returns by risk.</p><p>A higher number means the investment gives us more returns for the amount of risk</p><pre>mean_returns = daily_returns.mean()<br>volatility = daily_returns.std()<br><br>risk_free_rate = 0.04/252 #### assumption<br><br>sharpe_ratio = (mean_returns - risk_free_rate)/volatility<br>sharpe_ratio</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/1*1hn3lw1U3hyQl3rrwPCwAw.png" /><figcaption>Sharpe Ratio</figcaption></figure><h4>Monte Carlo Simulation</h4><p>This simulation helps us understand how the coin performs under various scenarios.</p><pre>#### setting sim parameters<br><br>num_simulations = 1000<br>num_days = 1000<br>last_price = df[&#39;Close&#39;].iloc[-1]<br>sim_prices = np.zeros((num_simulations, num_days))<br>volatility = df[&#39;Close&#39;].pct_change().std()<br><br>for i in range (num_simulations):<br>    sim_prices[i,0] = last_price<br>    for j in range (1, num_days):<br>        sim_prices[i,j] = sim_prices[i,j - 1] * np.exp(<br>            np.random.normal(0,volatility))<br><br>### visualisations<br><br>fig = go.Figure() #### generate graph<br><br>for i in range(num_simulations):<br>    fig.add_trace(go.Scatter(<br>        x = list(range(num_days)),<br>        y = sim_prices[i],<br>        mode = &#39;lines&#39;,<br>        line = dict(width = 0.6),<br>        opacity = 0.1,<br>        showlegend = False))<br><br>fig.update_layout(<br>    title = &#39;Monte Carlo Simulation For Bitcoin&#39;,<br>    xaxis_title = &#39;Days&#39;,<br>    yaxis_title = &#39;Simulated Prices&#39;,<br>    template = &#39;plotly_dark&#39;)<br><br>fig.show(renderer = &#39;browser&#39;)</pre><h3>Model Building For Prediction</h3><h4>Random Forest Classifier</h4><pre>from sklearn.model_selection import train_test_split<br><br>X = df[[&#39;Open&#39;, &#39;Close&#39;, &#39;High&#39;, &#39;Low&#39;, &#39;Volume&#39;, &#39;Marketcap&#39;]].values  # Using multiple features<br>y = ((df[&#39;Close&#39;].shift(-1) &gt; df[&#39;Close&#39;]).astype(int)).values  # Binary target variable: 1 if price increases, 0 otherwise<br><br>X = X[:-1]<br>y = y[:-1]<br><br>X_train,X_test,y_train,y_test = train_test_split(X,y, test_size = 0.2, random_state = 42) #### splitting the data set into training and testing data by 80-20 split<br><br>from sklearn.preprocessing import StandardScaler<br><br>scaler = StandardScaler()<br>X_train_scaled = scaler.fit_transform(X_train)<br>X_test_scaled = scaler.fit_transform(X_test)<br><br>#### define the model <br>from sklearn.ensemble import RandomForestClassifier<br>model = RandomForestClassifier(n_estimators = 100, min_samples_split = 250, random_state = 1)<br><br>model.fit(X_train_scaled, y_train) #### intitialize and train the model<br><br>predictions = model.predict(X_test_scaled) #### generate predictions<br><br>from sklearn.metrics import mean_squared_error<br>mse = mean_squared_error(y_test, predictions)<br>print(&quot;Mean Squared Error:&quot;,mse)<br><br>#### lets calculate the root mean squared error<br><br>rmse = np.sqrt(mse)<br>print(&quot;Root Mean Squared Error:&quot;,rmse)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*jDDLnRK-_ZVrVHgh9-AnnA.png" /></figure><h4>Linear Regression</h4><pre>from sklearn.linear_model import LinearRegression<br><br>lr_model = LinearRegression()<br>lr_model.fit(X_train,y_train)<br><br>lr_confidence = lr_model.score(X_test,y_test) <br>print(&quot;Linear Regression Confidence Level For Bitcoin:&quot;,lr_confidence)<br>print(lr_confidence*100, &#39;%&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*nBT4PYeEJ1JyFetKxSrrbA.png" /></figure><pre>projections = 5 #### setting for 5 days<br>projections =np.array(df[[&#39;Close&#39;]])[-projections:]<br>print(projections)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/192/1*curtf0-tzEJMklhJ1vs7aQ.png" /><figcaption>Linear Regression prediction for next 5 days</figcaption></figure><h3>Conclusion</h3><p>1. Crypto is one of the most sought-after, highly volatile areas of investment, experiencing significant and aggressive fluctuations over time. Investing must be done with the utmost care and calculation, taking into account the sudden changes in prices.</p><p>2. Bitcoin and Ethereum are the strongest coins, with moving averages showing us explosive growth from 2020.</p><p>3. Looking at the time series, we see a seasonality, and also we understand that this type of investment is best for the long term due to the aggressive fluctuations.</p><p>4. The Sharpe ratio, which compares risk and return, tells us that investment in Bitcoin has better risk-adjusted returns.</p><p>5. There are several ways to make the above analysis cleaner and more insightful, but for understanding and learning, this would be great resource.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4941a3e5734" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/data-science-vs-crypto-volatility-a-price-analysis-project-f4941a3e5734">Data Science vs. Crypto Volatility: A Price Analysis Project</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step By Step Guide To Exchange Rate Analysis Using Python]]></title>
            <link>https://athulanish.medium.com/step-by-step-guide-to-exchange-rate-analysis-using-python-edce1f41254a?source=rss-a3b62ec099d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/edce1f41254a</guid>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[data-analytics]]></category>
            <dc:creator><![CDATA[Athul Anish]]></dc:creator>
            <pubDate>Wed, 19 Mar 2025 10:53:04 GMT</pubDate>
            <atom:updated>2025-03-19T10:55:35.575Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3HOWIdwzQnqOzmCs" /><figcaption>Photo by <a href="https://unsplash.com/@margabagus?utm_source=medium&amp;utm_medium=referral">Marga Santoso</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><pre>### Import the necessary libraries <br>import pandas as pd<br>import numpy as np<br>import seaborn as sns<br>import plotly.express as px<br>import matplotlib.pyplot as plt<br><br>import warnings<br>warnings.filterwarnings(&#39;ignore&#39;)</pre><pre>### This will make sure the graphs display in line without any issues<br>import plotly.offline as pyo<br>pyo.init_notebook_mode(connected=True)</pre><pre>### Read dataset<br>data = pd.read_csv(&quot;INR-USD.csv&quot;)<br><br>print(data.head()) ### print headings</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*o_OAWVwKmLjxE4QCKVzzcg.png" /></figure><h4>EDA (<a href="https://medium.com/@athulanish/exploratory-data-analysis-57ee7571232b">Exploratory Data Analysis</a>)</h4><pre>print(data.isnull().sum()) ###Checking for missing values </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*GehBhHdYb_IGOkzIi03ogw.png" /></figure><pre>data = data.dropna() ### Remove missing values <br>print(data.describe()) ### Quick look at the data </pre><pre>## USD - INR Conversion Analysis<br><br>fig = px.line(data, x = &quot;Date&quot;,<br>              y = &quot;Close&quot;, title = &#39;Conversion Analysis Over The Years&#39;) ### we are specifying the type of graph, and x and y axises<br><br>fig.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cfUE2jC31PVld5m8EVGTvQ.png" /></figure><pre>## Adding year and month columns for better and deeper understanding <br><br>data[&quot;Date&quot;] = pd.to_datetime(data[&quot;Date&quot;], format = &#39;%Y-%m-%d&#39;)<br>data[&#39;Year&#39;] = data[&#39;Date&#39;].dt.year<br>data[&#39;Month&#39;] = data[&quot;Date&quot;].dt.month<br>print(data.head())<br><br>## Average yearly growth<br><br>import plotly.graph_objs as go<br>import plotly.io as pio <br><br>growth = data.groupby(&#39;Year&#39;).agg({&#39;Close&#39;: lambda x: (x.iloc[-1] - x.iloc[0])/x.iloc[0]*100}) # grouping by year, we are taking the aggregate of Close column<br>                                                                                               # Subtracting the last and first value of Close column and multipyling by 100 to get percentage<br><br>fig= go.Figure()<br>fig.add_trace(go.Bar(x = growth.index,<br>                     y = growth[&#39;Close&#39;],<br>                     name = &#39;Yearly Growth&#39;))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_EiQU8XmowXxWgrSLzwHQw.png" /></figure><h4>Time Series Analysis</h4><p>Time series analysis is carried out to understand if there is any trend or seasonality present hidden in our data.</p><pre># Time Series Analysis <br># This method is often used to understand trend/seasnality in our data<br><br>from statsmodels.tsa.seasonal import seasonal_decompose<br>result = seasonal_decompose(data[&#39;Close&#39;], model = &#39;multiplicative&#39;, period = 24)<br>fig = plt.figure()<br>fig = result.plot()<br>fig.set_size_inches(8,6)<br>fig.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*B7o5wpAMvKyQiB-3pjdwxQ.png" /></figure><p>The above graph clearly shows seasonality with our data hence <em>SARIMA </em>would be the most suitable for this analysis.</p><p>We now need to find the <strong>p</strong>,<strong>d </strong>and <strong>q </strong>values.</p><pre>### To find P<br>pd.plotting.autocorrelation_plot(data[&#39;Close&#39;])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*MpgU5QL9JxK_Vt14x2BQyQ.png" /></figure><pre>### To find q, plot partial autocorrelation <br>from statsmodels.graphics.tsaplots import plot_pacf<br>plot_pacf(data[&#39;Close&#39;], lags = 100)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*71oIYpF-KUGuA8Qek-L9ZA.png" /></figure><pre>### Since its stationary data, d is 1 and hence <br><br>p,d,q = 2,1,0</pre><h4>SARIMA</h4><pre>from statsmodels.tsa.statespace.sarimax import SARIMAX<br>model = SARIMAX(data[&quot;Close&quot;], order=(p, d, q), <br>                seasonal_order=(p, d, q, 52))  <br>fitted = model.fit() <br>print(fitted.summary())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*PPi88BVQtjIGFC1BYTprTA.png" /></figure><p>It’s crucial to learn how to interpret the above table because that allows us to understand our data and its characteristics much deeper.</p><h4><em>Interpretations</em>:</h4><p>1. The first part shows us that we have chosen <strong><em>CLOSE </em></strong>as our dependent variable (Dep. Variable) and we are running the SARIMAX model, the model was trained on 1013 data points (No. Obs).<br>2. <strong><em>Log/AIC/BIC/HQIC</em></strong> represents how good of a fit the model is compared to others (models created), except log, all others, the lower the value the better.<br>3. The second part shows the various <strong><em>coefficients </em></strong>and their analysis. In this case, that means we are looking at data points from one week ago (<strong><em>ar.L1</em></strong>), two weeks ago (<strong><em>ar.L2</em></strong>), 1 year ago (<strong><em>S.L52</em></strong>) and roughly 2 years ago (<strong><em>S.L104</em></strong>) to understand the impact it has on the data we see now.<br>4. <strong>P&gt;|z|</strong> shows the P value (observed value) in relation to the z value (0.05). If the <em>P value is greater than 0.05</em>, the more significant the P value, the less influence it has on our data and the closer it is to the z value, the more significant.</p><p>In our case, we can explain that the observations a week ago (<strong><em>0.233&gt;0.05</em></strong>) are too big and have a very small, almost negligible impact on our data while those from a year and two (0.00) have a very strong and reliable impact. In data science language, we would say <em>observation 1 is not statistically significant to our dataset, while values from a year and two are statistically significant towards the outputs</em> we see today.</p><p><strong><em>sigma2</em></strong> value tells us how much the values tend to randomly fluctuate and the value shows the variance is statistically significant.</p><h4>Summary</h4><p>The model is saying that exchange rates from one and two years ago are a very good predictor of today’s rate, while exchange rates from two days ago might help a bit and the rate from yesterday does not help at all. The model also tells us that there is a certain amount of random variation that the model accounts for. The model has found strong seasonal patterns and a weaker short-term pattern with some level of noise.</p><h4>Predictions</h4><pre>predictions = fitted.predict(len(data), len(data)+60)<br><br>print(predictions)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*XqIY6cg-TXZdAeeKJ3Voqg.png" /></figure><pre>## Visualisation<br><br>fig = go.Figure()<br><br>fig.add_trace(go.Scatter(x = data.index,<br>                         y = data[&quot;Close&quot;],<br>                         mode = &#39;lines&#39;,<br>                         name = &#39;Training Data&#39;,<br>                         line = dict(color = &#39;magenta&#39;)<br>                        ))<br><br>## Adding predictions to the graph<br><br>fig.add_trace(go.Scatter(x = predictions.index,<br>                         y = predictions, <br>                         mode = &#39;lines&#39;,<br>                         name = &#39;predictions&#39;,<br>                         line = dict(color=&#39;green&#39;)<br>                        ))<br>fig.update_layout(<br>    title = &quot;Conversion Rate Predictions&quot;,<br>    xaxis_title = &quot;Date&quot;,<br>    yaxis_title = &quot;Close&quot;,<br>    legend_title = &quot;Data&quot;,<br>    width = 900,<br>    height = 700<br>)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5o82ux3FPSVc2ZtZx8ijWg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=edce1f41254a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Financial Data Analysis Using Python]]></title>
            <link>https://athulanish.medium.com/financial-data-analysis-using-python-bfdb8af50aeb?source=rss-a3b62ec099d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfdb8af50aeb</guid>
            <category><![CDATA[growth]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Athul Anish]]></dc:creator>
            <pubDate>Tue, 18 Mar 2025 10:37:27 GMT</pubDate>
            <atom:updated>2025-03-18T10:38:28.973Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S9XfCAY0SVMbUjgW" /><figcaption>Photo by <a href="https://unsplash.com/@austindistel?utm_source=medium&amp;utm_medium=referral">Austin Distel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><pre>import pandas as pd # Pandas for data manipulation<br><br>import plotly.io as pio<br>pio.renderers.default = &#39;notebook&#39; #to ensure Plotly graphs are properly visible</pre><p>Imagine trying to predict the future of a company, or even the entire market, just by staring at a mountain of numbers. That’s essentially what financial data analysts do but with the power of Python! We’re not just looking at cold, hard figures; we’re <strong><em>uncovering stories</em></strong> hidden within stock prices, market trends, and company reports.</p><p>Think of it like being a detective, but instead of solving a crime, you’re solving the mysteries of the financial world. We dig into metrics like volatility — how wildly a stock’s price swings, a bit like measuring the “heartbeat” of a company. We track returns, the profit or loss from an investment, essentially asking, “Was it worth it?”. And we use risk assessment methods, like trying to predict the weather before a big outdoor event, to understand the potential pitfalls and rewards.</p><p>So, let’s dive into the fascinating world of financial data analysis with Python. We’ll learn how to extract those hidden stories and turn raw numbers into actionable insights, empowering you to navigate the complexities of the financial market.</p><h4>EDA (<a href="https://athulanish.medium.com/exploratory-data-analysis-57ee7571232b">Exploratory Data Analysis</a>)</h4><pre>data = pd.read_csv(&quot;nifty50_closing_prices.csv&quot;) # Read data<br>print(data.head()) # quick look at the data</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*xrdkbsaTTD-27MsWs-A8vA.png" /></figure><pre>data.isnull().sum() #Lets check for missing values. </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*lBZxTc32SAql_W7tfdz3rg.png" /><figcaption>Missing values present in HDFC.NS</figcaption></figure><pre>data = data.drop(columns=[&#39;HDFC.NS&#39;]) # drop HDFC column is ats fully blank<br><br>#convert date column to correct format <br>data[&#39;Date&#39;] = pd.to_datetime(data[&#39;Date&#39;])<br><br>#sort date column to get the right time series order <br>data = data.sort_values(by=&#39;Date&#39;)<br><br>#reset index for a clean dataframe<br>data.reset_index(drop = True, inplace = True)<br><br># Transpose data for better readability<br>desc_data = data.describe().T <br><br># To find mean, std, min and max<br>desc_data = desc_data[[&#39;mean&#39;,&#39;std&#39;,&#39;min&#39;,&#39;max&#39;]]<br><br># Add these as new columns<br>desc_data.columns = [&#39;Mean&#39;,&#39;Std Dev&#39;,&#39;Min&#39;,&#39;Max&#39;]<br>print(desc_data)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*X4PDngrGsjGWl3c_fGH_cA.png" /></figure><h4>Portfolio Analysis</h4><p>Ideally, we would choose the stocks we have invested in, but in this case, I am choosing stocks I am interested in and assigning weights to each based on the investment percentage.</p><pre># To perform the sample analysis, I am choosing Britannia, SBILIFE and Nestle<br>weights = [0.4, 0.35,0.25]<br>portfolio = data[[&#39;BRITANNIA.NS&#39;,&#39;SBILIFE.NS&#39;, &#39;NESTLEIND.NS&#39;]]</pre><pre>#calculate daily returns<br>#portfolio = pd.Series(portfolio) # to convert portfolio from &#39;List&#39; type to a dataframe so that our pandas functions can work smoothly<br>daily_returns = portfolio.pct_change().dropna()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*w5c1Rs5mSqvjrON2gd3Omg.png" /></figure><pre># Portfolio returns<br>portfolio_returns = (daily_returns*weights).sum(axis=1)<br><br>portfolio_returns.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*MeRoh7jUrM9w6JX0dlBk9Q.png" /></figure><p>The output above represents the percentage change in the portfolio value for a day i.e. a return of 0.01607 indicates a <strong><em>1.6 %</em></strong> increase in value -0.0011 indicates a 0.11% decrease in value on the second day and so on.</p><h4>Risk Assessment For Planned Investment</h4><p>Risk assessment helps us understand the price volatility and potential losses to make informed decisions.</p><pre>#standard deviation<br>volatility = daily_returns.std() #calculate std to see how much stock price fluctuates<br><br>confidence_level = 0.05 # calculate 5th percentile (95% confidence level) of daily returns to understand max loss on a bad day<br>VaR = daily_returns.quantile(confidence_level)<br><br>risk_metrics = pd.DataFrame({&#39;Volatility(Std Dev)&#39;: volatility, &#39;Value at Risk (VaR)&#39;: VaR})<br>print(risk_metrics)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*ALz6xYqfLlKl7mGXNECjrA.png" /></figure><p>Higher volatility, higher fluctuations.</p><p>The above results tell us that Britannia has a volatility of <strong><em>0.93%</em></strong>, SBI Life has <strong><em>1.26%</em></strong> and Nestle has <strong><em>0.9%</em></strong>. This indicates that SBI life has <em>high</em> price fluctuation and Nestle is the <em>least </em>(slightly less than Britannia)</p><p>At a 95 per cent confidence level, almost all 3 have similar potential daily losses with Britannia at <strong><em>1.13</em></strong>, ABI at <strong><em>1.54 </em></strong>and Nestle at <strong><em>1.11</em></strong>.</p><h4>Correlation</h4><p>Correlation calculation is done to identify how one factor can be related to the other in terms of fluctuations. A positive correlation means both assets influence each other in the same direction and a negative correlation means they affect inversely to each other.</p><pre>#correlation matrix<br>corr_matrix = daily_returns.corr()<br><br>corr_matrix</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*dc0U-KQrzLJqqir1LMQACw.png" /></figure><p>The above matrix tells us that <em>BRITANNIA </em>and <em>NESTLE </em>have a moderate correlation of <strong><em>0.43 </em></strong>indicating they often affect each other in the same direction but not perfectly</p><p>SBI has a really small correlation with <em>BRITANNIA </em>and <em>NESTLE </em>(<strong><em>0.22 </em></strong>and <strong><em>0.28</em></strong>, respectively) which indicates that SBI price fluctuation does not make much of a change to the other two.</p><h4>Moving Average</h4><p>Imagine you’re watching a stock’s price, and it’s jumping up and down a lot. It’s hard to see the overall direction. Moving Averages are like a way to smooth out those jumps and get a clearer picture.</p><p>Basically, we take the average price over a set number of days (or weeks, etc.) and plot that average. This creates a line that’s less bumpy than the actual price. It helps us see if the stock is generally going up, down, or sideways, without being distracted by all the little daily changes.</p><pre>import plotly.graph_objects as go<br><br>#calculating moving average for Britannia<br>data[&#39;Britannia_5D_MA&#39;] = data[&#39;BRITANNIA.NS&#39;].rolling(window=5).mean()<br>data[&#39;Britannia_10D_MA&#39;] = data[&#39;BRITANNIA.NS&#39;].rolling(window=10).mean()<br>data[&#39;Britannia_20D_MA&#39;] = data[&#39;BRITANNIA.NS&#39;].rolling(window=20).mean()<br><br>#create graph<br>fig = go.Figure() <br><br>fig.add_trace(go.Scatter(x = data[&#39;Date&#39;],<br>                         y = data[&#39;BRITANNIA.NS&#39;],<br>                         mode = &#39;lines&#39;,<br>                         name = &#39;Britannia&#39;)) #adding necessary plot points<br><br>fig.add_trace(go.Scatter(x = data[&#39;Date&#39;],<br>                         y = data[&#39;Britannia_5D_MA&#39;],<br>                         mode = &#39;lines&#39;,<br>                         name = &#39;5-Day MA&#39;)) #adding necessary plot points<br><br>fig.add_trace(go.Scatter(x = data[&#39;Date&#39;],<br>                         y = data[&#39;Britannia_10D_MA&#39;],<br>                         mode = &#39;lines&#39;,<br>                         name = &#39;10-Day MA&#39;)) #adding necessary plot points<br>fig.add_trace(go.Scatter(x = data[&#39;Date&#39;],<br>                         y = data[&#39;Britannia_20D_MA&#39;],<br>                         mode = &#39;lines&#39;,<br>                         name = &#39;20-Day MA&#39;)) #adding necessary plot points<br>fig.update_layout(<br>    title = &quot;Britannia Moving Averages&quot;,<br>    xaxis_title = &quot;Date&quot;,<br>    yaxis_title = &quot;Price&quot;,<br>    template = &quot;plotly_white&quot;,<br>    legend = dict(title = &quot;Legend&quot;)) #adding necessary plot points<br><br>fig.show() #display plot</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BzhwkHLKYhdw5AXN7n7dZw.png" /></figure><p>All 3 lines of moving averages show a general upward trend with 5 day (short term) following closely with the original while 20-day moving average provides a smoother trend.</p><p>When the price crosses above or below these moving averages, it may indicate a potential buy/sell.</p><h4>Relative Strength Index</h4><p>The relative strength index is a factor that tells us how fast the stock price is changing.</p><p>It generally gives a number between 1 to 100 where, if the RSI is over <strong><em>70</em></strong>, it means the price has gone up too fast (could slow down or drop). People call this “<em>overbought</em>”</p><p>If the RSI is below <strong><em>30</em></strong>, it means the stock price is dropping fast or is slowing down too much. It means the price is about to go back up. This is called “<em>oversold</em>”</p><p>High RSI = time to sell<br>Low RSI = time to buy</p><pre>#Lets create a function to calculate RSI<br>def calculate_rsi(prices,window=14): # where prices is the price data and window is number or periods to use for calculating RSI, 14 is default value<br>    delta = prices.diff() # create a pandas series by calculating the difference between consecutive prices<br>    gain = (delta.where(delta &gt; 0,0)).rolling(window=window).mean() # This replaces any negative price with 0 keeping only positive values<br>    loss = (-delta.where(delta &lt; 0,0)).rolling(window=window).mean() # This does the opposite of previous step<br>    rs = gain/loss<br>    rsi = 100 - (100/(1+rs))<br>    return rsi</pre><pre># Calculate RSI for Britannia<br>data[&#39;BRITANNIA_RSI&#39;] = calculate_rsi(data[&#39;BRITANNIA.NS&#39;])</pre><pre>#visualise <br><br>fig = go.Figure()<br><br>fig.add_trace(go.Scatter(x = data[&#39;Date&#39;],<br>                         y = data[&#39;BRITANNIA.NS&#39;],<br>                         mode = &#39;lines&#39;,<br>                         name = &#39;RSI&#39;))<br><br>fig.add_trace(go.Scatter(x = data[&#39;Date&#39;],<br>                         y = [70] * len(data[&#39;Date&#39;]),<br>                         mode = &#39;lines&#39;,<br>                         line = dict(color = &#39;red&#39;, dash = &#39;dash&#39;),<br>                         name = &#39;Overbrought (&gt;70)&#39;))<br><br>fig.add_trace(go.Scatter(x = data[&#39;Date&#39;],<br>                         y = [30] * len(data[&#39;Date&#39;]),<br>                         mode = &#39;lines&#39;,<br>                         line = dict(color = &#39;green&#39;, dash = &#39;dash&#39;),<br>                         name = &#39;Oversold (&lt;30)&#39;))<br><br>fig.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w9jPXmD_82wFcMh_qfvEvQ.png" /></figure><p>What we can observe from the above output is that in the observed 14-day period, SBI Life has been trading at high numbers close to 6000 and touched the overbought condition since the beginning of September. From mid-September, we can see an upward trend indicating it&#39;s the right time to sell.</p><h4>Sharpe Ratio</h4><p>Sharp ratio tells us if we are getting a good deal for the amount of risk we are taking with an investment. For Eg, consider <strong><em>Stock A </em></strong>which gives high returns but is very unpredictable and <strong><em>Stock B</em></strong> which makes decent money and is pretty stable. The Sharpe ratio will tell us which stock is actually better considering the risk. Simple!</p><p>The ratio is calculated by dividing excess returns with risk. A higher number means the investment gives us more returns for the amount of risk.</p><pre># calculate average returns and volatility <br>mean_returns = daily_returns.mean()<br>volatility = daily_returns.std()<br><br>risk_free_rate = 0.04/252 # assumption</pre><pre>#sharpe ratio<br><br>sharpe_ratios = (mean_returns - risk_free_rate)/volatility #formula for ratio<br><br>table_data = pd.DataFrame({<br>    &#39;Stock&#39;: sharpe_ratios.index,<br>    &#39;Sharpe Ratio&#39;: sharpe_ratios.values.round(2)}) #display result in the form of a neat table<br><br>fig = go.Figure(data = [go.Table(<br>    header = dict(values=[&#39;Stock&#39;,&#39;Sharpe Ratio&#39;],<br>                  fill_color = &#39;blanchedalmond&#39;,<br>                  align = &#39;left&#39;),<br>    cells = dict(values=[table_data[&#39;Stock&#39;], table_data[&#39;Sharpe Ratio&#39;]],<br>                 fill_color = &#39;lavender&#39;,<br>                 align = &#39;left&#39;))]) #inputting data into the created table<br><br>fig.update_layout(<br>    title = &#39;Sharpe Ratios&#39;,<br>    template = &#39;plotly_white&#39;)<br><br>fig.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m-DRi84sqvm-TAyLQw7oBQ.png" /></figure><p>Both Britannia and Nestle seem to moderate risk and return while SBI has slightly less returns for the risk taken but there are no negatives which means all 3 are safe investments considering the risk.</p><h4>Monte Carlo Simulation</h4><p>We all know that the stock market is unpredictable and there can be several different factors that can affect stock markets. A Monte Carlo simulation is like running a ‘What-If’ scenario thousands of times to see all the different ways a stock price could move. It helps is understand the chances of different things happening and its impact on stock prices and how much risk we are taking.</p><p>The simulation gives us a range of potential outcomes and how likely each outcome is thereby helping us understand the potential risks and rewards of the investment.</p><pre>import numpy as np #for mathematical calculations<br><br>num_simulations = 1000 <br>num_days = 252<br>last_price = data[&#39;BRITANNIA.NS&#39;].iloc[-1]<br>simulated_prices = np.zeros((num_simulations, num_days))<br>volatility = data[&#39;BRITANNIA.NS&#39;].pct_change().std()<br><br>for i in range(num_simulations):<br>    simulated_prices[i, 0] = last_price<br>    for j in range(1, num_days):<br>        simulated_prices[i, j] = simulated_prices[i, j - 1] * np.exp(<br>            np.random.normal(0, volatility)<br>        )<br>fig = go.Figure()<br><br>for i in range(num_simulations):<br>    fig.add_trace(go.Scatter(<br>        x=list(range(num_days)),<br>        y=simulated_prices[i],<br>        mode=&#39;lines&#39;,<br>        line=dict(width=0.5),<br>        opacity=0.1,<br>        showlegend=False<br>    ))<br><br>fig.update_layout(<br>    title=&quot;Monte Carlo Simulation for RELIANCE.NS Prices&quot;,<br>    xaxis_title=&quot;Days&quot;,<br>    yaxis_title=&quot;Simulated Price&quot;,<br>    template=&quot;plotly_white&quot;<br>)<br><br>fig.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f2MsUyNcqTEg1aPXM6zDbQ.png" /></figure><p>Each line in the picture is like a possible guess, showing how the price could move in the future. We start those guesses from the stock’s current price.</p><p>Notice how the lines spread out more and more as we look further into the future? That’s because it gets harder to predict things the longer you try to look ahead. It’s like trying to guess the weather a month from now versus tomorrow — you’ll be much less certain about the month-long forecast.</p><p>This picture helps us see all the different possible paths the stock price might take. It’s like having a range of possibilities, from ‘things could go really well’ to ‘things could go really badly’. By seeing this range, we can get a better idea of the risks involved. We can also see how likely it is that the stock price might make a really big jump up or down. It’s basically a way to get a feel for how much uncertainty we’re dealing with.</p><p><strong>Conclusion</strong></p><p>It&#39;s not always possible to learn on the job and it&#39;s not easy to understand and follow along with thousands of materials and content that one can find online.</p><blockquote>Its not about how to produce data and visualisations but about knowing how to read them!</blockquote><p>My aim is to research, analyse and create content from all around the web to learn and also to produce materials that even people from totally unrelated fields can read and understand.</p><p>The above is a typical example of how data analysis is carried out on a financial dataset. I hope to work on more financial datasets down the lane to understand the same even better.</p><p>Many thanks to all the wonderful content creators and data analysts for sharing their valuable knowledge and experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfdb8af50aeb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Generative AI Revolution in Data Science: A New Era Of Discovery]]></title>
            <link>https://medium.com/swlh/generative-ai-revolution-in-data-science-a-new-era-of-discovery-db76c0a806ee?source=rss-a3b62ec099d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/db76c0a806ee</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Athul Anish]]></dc:creator>
            <pubDate>Fri, 24 Jan 2025 14:28:36 GMT</pubDate>
            <atom:updated>2025-01-24T14:28:36.051Z</atom:updated>
            <content:encoded><![CDATA[<p>Remember those days when data scientists spent hours wrangling messy data, debugging code, and feeling lost in a sea of numbers? Well, those days might be numbered.</p><p>With the introduction of Generative AI into the world of Data Science, things are taking a turn for the better!</p><h3>So what is generative AI and why is it making waves?</h3><p>Imagine you have a magical box filled with all the books, movies, and music ever created. Generative AI is like a super-intelligent artist who can peek inside that box, learn from all the amazing things it contains, and then create something entirely new and original.</p><blockquote><em>“Generative AI has the potential to unlock human creativity in ways we never imagined before.” — </em><strong><em>Geoffrey Hinton</em></strong><em> (</em><strong>Godfather of AI</strong><em>)</em></blockquote><p>It can write stories, compose music, paint pictures, and even invent new medicines! It’s like having a creative partner who can brainstorm ideas, explore possibilities, and help you unlock your imagination.</p><p>Generative AI is no longer a futuristic fantasy; it’s here and shaking things up in the world of data science. Imagine an AI assistant that can:</p><ul><li>Tidy up your data like a pro: With a few clicks, you can clean messy data, find missing pieces, and even create new data features.</li><li>Write your code for you: Stuck on a coding problem? Your AI assistant can suggest code snippets, debug your work, and even write entire functions for you.</li><li>Become your AI data whisperer: Help you choose the best models for your project, tune them for peak performance, and even explain their decisions in a way that makes sense to everyone.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5Ba6dGhSUYyL44i1" /></figure><h3>But that’s just the beginning.</h3><p>Generative AI is unlocking a whole new world of possibilities:</p><ul><li><strong>Predicting the future (with a little help from AI)</strong>: Create synthetic data to explore different scenarios and see what might happen. Imagine a financial institution using AI to generate synthetic market data to test different investment strategies and assess potential risks.</li><li><strong>Building super-smart models</strong>: Design and build groundbreaking AI models with the help of AI itself. Researchers are using generative AI to explore novel neural network architectures, pushing the boundaries of what’s possible in areas like image recognition and natural language processing.</li><li><strong>Turning data into art</strong>: Generate music, write stories, and create stunning visuals all based on the patterns and insights hidden within your data.</li><li><strong>Improved Data Exploration and Visualization</strong>: Generative AI can help data scientists explore vast datasets more effectively. It can suggest insightful visualizations, identify hidden patterns, and even generate interactive dashboards that tell compelling stories from the data.</li><li><strong>Enhanced Anomaly Detection</strong>: By learning from historical data, generative AI models can identify unusual patterns and anomalies that might signal potential problems, such as fraud, equipment failure, or security breaches. This can be invaluable for businesses across various sectors.</li><li><strong>Personalized Experiences</strong>: Generative AI can be used to create highly personalized experiences for customers. For example, in e-commerce, AI can generate personalized product recommendations, tailor marketing campaigns, and even design unique customer experiences.</li><li><strong>Accelerating Scientific Research</strong>: Beyond drug discovery, generative AI can accelerate scientific research in various fields. It can be used to: Design new materials with improved properties. Predict the outcomes of complex experiments. Analyze scientific literature and identify new research directions.</li></ul><p>With the flexibility, scalability, and versatility, Generative AI is a true boon to the rapidly growing modern world. Let’s look at some possible real-world scenarios where this can be used/ is already being put to use.</p><p>One exciting application of generative AI in data science is in drug discovery. Pharmaceutical companies are using AI to generate novel molecular structures with the potential to treat diseases. These AI models can analyze vast amounts of existing drug data and generate new molecules with desired properties, such as high potency and low toxicity. This accelerates the drug discovery process, potentially leading to faster and more effective treatments for various diseases.</p><ul><li><strong>Google</strong>: Its search engine utilizes generative AI to understand complex queries, provide more comprehensive and insightful answers, and generate more relevant search results. Google’s AI chatbot, Bard, leverages generative AI to engage in human-like conversations, answer questions in an informative way, and generate different kinds of creative content.</li><li><strong>Amazon</strong>: Amazon’s recommendation engine leverages generative AI to analyze customer purchase history, browsing behavior, and product reviews to provide highly personalized product suggestions. Alexa, Amazon’s voice assistant, utilizes generative AI to understand and respond to user requests, control smart home devices, and provide information and entertainment.</li><li><strong>Pfizer</strong>: Companies like Pfizer and Merck are using generative AI to accelerate drug invention by Generating novel molecular structures. AI models can design new molecules with desired properties, such as high potency and low toxicity. AI can analyze vast amounts of biological data to identify promising targets for new drugs.</li><li><strong>Tesla (Autopilot and Self-Driving Technology)</strong>: Tesla utilizes generative AI to train its self-driving cars, enabling them to recognize and respond to complex driving scenarios with increasing accuracy and safety. Generative AI also assists in the design and optimization of vehicle components, leading to more efficient and innovative vehicle architectures.</li></ul><p>These are just a few examples of how leading companies are leveraging generative AI in their data science workflows. As the technology continues to evolve, we can expect to see even more innovative and impactful applications across various industries.</p><h3>What are the limitations of GENERATIVE AI?</h3><p>As we now understand the basis of generative AI and its working, the crucial point to keep in mind is that the generative AI models are trained on massive existing datasets. This means any anomalies, outliers, or biases hiding within this dataset are also taken into consideration while being trained for further use. The AI is likely to reflect and in some cases amplify those biases in its output. This could potentially lead to unfair or discriminatory outcomes.</p><p>From a wider perspective, while generative AI can create impressive and stunning content, it often relies on patterns and information from existing data. This means, that true originality and genuine creativity, which often involve breaking free from established norms and exploring novel concepts, remain challenging for current AI models. This often leads to Gen AI models producing outputs that are factually incorrect or nonsensical. These “hallucinations” occur when models attempt to generate content beyond the scope of their capabilities.</p><p>Ethical concerns are one of the crucial problems currently in the whole AI industry. AI being used to create and spread false news is creeping into our world with little to no regulations around it. This includes the creation of deepfakes, the spread of misinformation, and the potential for AI-generated content to be used for malicious purposes.</p><p>Last but not least, overreliance and dependence can stifle human creativity and critical thinking leading to brain fog and fatigue. Often, users take the AI’s output as absolute truth without critical evaluation. This can lead to errors in decision-making, especially in critical areas like healthcare or finance where there is little to no margin of error. When we rely heavily on AI to think for us, we may gradually lose our ability to think critically, analyze information, and solve problems independently. It’s crucial to use these tools as aids and not as replacements for human ingenuity.</p><h3>The Future: Models, Limitations and Scope</h3><h4>At the end of the day, Generative AI is here to stay!</h4><p>We have seen the working and the possibilities humans can achieve with such a powerful tool at hand. This means that there is going to be more attention towards structurally developing the concept with tighter regulations and more efficient approaches. Potentially, Generative AI models might get more sophisticated with enhanced capabilities such as the ability to understand and generate content in multiple formats simultaneously, better explain reasoning and decision-making processes, and increase transparency all without the need for frequent training.</p><p>Generative AI will likely become increasingly integrated into various aspects of our lives, from education and healthcare to entertainment and business. We can expect to see the emergence of novel applications of generative AI, such as personalized education, AI-powered drug discovery, and the creation of entirely new forms of art and entertainment. The development of responsible and beneficial generative AI will require collaboration between researchers, policymakers, ethicists, and the public.</p><p>The future of generative AI presents both exciting opportunities and significant challenges. By addressing the limitations and ethical considerations, we can harness the power of this transformative technology to create a future where AI benefits humanity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db76c0a806ee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/generative-ai-revolution-in-data-science-a-new-era-of-discovery-db76c0a806ee">Generative AI Revolution in Data Science: A New Era Of Discovery</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Industries That Make The Most Use Of Data Analytics]]></title>
            <link>https://athulanish.medium.com/industries-that-make-the-most-use-of-data-analytics-d9e5278c7b45?source=rss-a3b62ec099d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9e5278c7b45</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[covid19]]></category>
            <dc:creator><![CDATA[Athul Anish]]></dc:creator>
            <pubDate>Mon, 30 Nov 2020 03:50:18 GMT</pubDate>
            <atom:updated>2020-11-30T03:50:18.380Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>Data Analytics has been highly effective in tackling most of the real-world scenarios like enhancing customer experience, cost-reduction, targeted marketing, and it also helps in creating content strategies and developing products based on customer/client feedbacks.</p><p><strong>“Data</strong> is a precious thing and will last longer than the systems themselves.” — Tim Berners-Lee, inventor of the World Wide Web.</p><p>Data is at present considered to be the catalyst for any organization’s growth. As a result, more and more companies are leaning towards data science for their own growth and development. There are many studies that state that DATA ANALYTICS is the fastest-growing job of the current generation.</p><p>Let’s quickly look at some of the most common industries that are highly influenced by Data Analytics.</p><ol><li><strong>Retail</strong></li></ol><p>This goes without saying that retail industries are indebted to data analytics to know about the customers likes, dislikes and other interests. A simple poll can result in the collection of a huge bundle of data which are analyzed to know what changes/developments the company needs to bring about, in order to increase the sales and thereby the profit margin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FS0JdkakxRQm1ZByOuxYjw.jpeg" /><figcaption>Photo by Andrea Piacquadio</figcaption></figure><blockquote>“The world is now awash in data and we can see consumers in a lot clearer ways.” Max Levchin, PayPal co-founder.</blockquote><p>When you use various online shopping sites, you might have noticed how products similar to the previously purchased/searched are displayed across your homepage.. This is Data Analytics.</p><p>2. <strong>Healthcare</strong></p><p>Data Analytics is by far the most beneficial yet underused and underutilized resource when it comes to the healthcare sector. As we all know, hospitals are technically a data hub. We have data collected from hundreds of patients every single day yet proper efficient use of data for helping patients haven’t started yet. This is mainly due to many difficulties such as not being able to update patient’s details in real-time, network issues due to heavy traffic, not being able to include reports from patients effectively, etc.</p><p>“It is a capital mistake to theorize before one has data.” — Sherlock Holmes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r8XvS5rbnNkFN7tpPGGsVg.jpeg" /><figcaption>Photo by Artem Podrez</figcaption></figure><p>All said and done, it doesn’t mean healthcare hasn’t touched data analytics at all. Many initiatives are being carried out by several doctors and hospitals to include and update everyday patient data in real-time with the help of new technologies like smartwatches, health trackers various mobile apps. The use of technologies such as health trackers has proven to be a great aid in early diagnosis and a faster approach to treatment.</p><p>3. <strong>Media and Entertainment</strong></p><p>YouTube, Spotify, Wynk, and any other social media you can think of uses data analytics to enhance customer user experience. The data collected is analyzed to provide customers with recommendations as per individual preferences. Digital media marketing is one of the hottest careers right now!</p><p>“Data is what you need to do analytics and information is what you need to do business” — John Owen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QnNkSxpu6BpAdOSkl5SatA.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/@karolina-grabowska?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Karolina Grabowska</a></figcaption></figure><p>What data analytics does here is, it efficiently collects real-time data based on usage by customers. This data is then used to produce the individual recommendation which is highly satisfying for the user.</p><p>4. <strong>Banking and Finance</strong></p><blockquote>“Everything is going to be connected to cloud and data… All of this will be mediated by software” — Sathya Nadella, Microsoft CEO.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xHm2oWdno-qvBb-s" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The banking and finance sector is the latest to join the data analytics club. The majority of the banks and exchanges have started using data analytics to help them forecast the condition of the financial market. These days, various parts of data analytics such as <em>natural language processors </em>are used in banks to reduce the number of fraudulent transactions.</p><p>Stock traders use predictive analytics to forecast and learn how a stock would behave in the coming times. Big traders use data analytics in high precision trading, sentimental analysis, pre-trade decision-support analytics, etc.</p><p>5. <strong>Education</strong></p><p>Education is another such sector where there is HUGE scope for data analytics and that ocean is yet to be completely explored. There are cases where several schools are attempting to improve the education system by gathering data from each student.</p><p>These days the majority of the education is done online, which means great insights such as course progress, and subject-wise performance can be figured out with the help of analytics.</p><h3>Conclusion</h3><p>Apart from the above-mentioned sectors, the majority of other sectors such as sports, energy, manufacturing, and even the government have started relying on data analytics. Many studies state that data analytics is the hottest and the most preferred job of the 21st century. According to a study by the U.S Bureau of Labor, there will be an estimated 11.5 million jobs available for data scientists by 2026.</p><p>One can never exactly predict how data science is going to grow and shape in the coming years. With the growth of technology happening every single day, It’s going to be very interesting to see how it’s all going to unfold.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9e5278c7b45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time Series Analysis]]></title>
            <link>https://medium.com/swlh/time-series-analysis-7006ea1c3326?source=rss-a3b62ec099d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/7006ea1c3326</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Athul Anish]]></dc:creator>
            <pubDate>Tue, 24 Nov 2020 06:02:23 GMT</pubDate>
            <atom:updated>2020-11-25T22:13:44.187Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction to Time Series</h3><p>A time series is a sequence or series of numerical data points fixed at certain chronological time order. In most cases, a time series is a sequence taken at fixed interval points in time. This allows us to accurately predict or forecast the necessities.</p><p>Time series uses line charts to show us seasonal patterns, trends, and relation to external factors. It uses time series values for forecasting and this is called extrapolation.</p><p>Time series are used in most of the real-life cases such as weather reports, earthquake prediction, astronomy, mathematical finance, and largely in any field of applied science and engineering. It gives us deeper insights into our field of work and forecasting helps an individual in increasing efficiency of output.</p><h3>Time Series Forecasting</h3><p><em>Time series forecasting</em> is a method of using a model to predict future values based on previously observed time series values.</p><p>Time series is an important part of machine learning. It figures out a seasonal pattern or trend in the observed time-series data and uses it for future predictions or forecasting. Forecasting involves taking models rich in historical data and using them to predict future observations.</p><p>One of the most distinctive features of forecasting is that it does not exactly predict the future, it just gives us a calculated estimation of what has already happened to give us an idea of what could happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*kptV21R6IRbNoabMkX-57A.png" /><figcaption>Image Courtesy: www.wfmanagement.blogspot.com</figcaption></figure><p>Now let’s look at the general forecasting methods used in day to day problems,</p><p><em>Qualitative forecasting</em> is generally used when historical data is unavailable and is considered to be highly objective and judgmental.</p><p><em>Quantitative forecasting </em>is when we have large amounts of data from the past and is considered to be highly efficient as long as there is no strong external factors in play.</p><p>The skill of a time series forecasting model is determined by its efficiency at predicting the future. This is often at the cost of being able to explain why a specific prediction was made, confidence intervals, and even better, understanding the underlying factors behind the problem.</p><p>Some general examples of forecasting are:</p><ol><li>Governments forecast unemployment rates, interest rates, and expected revenues from income taxes for policy purposes.</li><li>Day to day weather prediction.</li><li>College administrators forecast enrollments to plan for facilities and faculty recruitment.</li><li>Industries forecast demand to control inventory levels, hire employees, and provide training.</li></ol><h3>Application of Time Series Forecasting</h3><p>The usage of time series models is twofold:</p><ul><li>Obtain an understanding of the underlying forces and structure that produced the data</li><li>Fit a model and proceed to forecast.</li></ul><p>There is almost an endless application of time series forecasting problems.</p><p>Below are a few of the examples from a range of industries to make the notions of time series analysis and forecasting more strong.</p><ul><li>Forecasting the rice yield in tons by the state each year.</li><li>Forecasting whether an EEG trace in seconds indicates a patient is having a heart attack or not.</li><li>Forecasting the closing price of stock each day.</li><li>Forecasting the birth or death rate at all hospitals in a city each year.</li><li>Forecasting product sales in units sold each day.</li><li>Forecasting the number of passengers booking flight tickets each day.</li><li>Forecasting unemployment for a state each quarter</li><li>Forecasting the size of the tiger population in a state each breeding season.</li></ul><p>Now let’s look at an example,</p><p>We are going to use the google new year resolution dataset,</p><p><strong>Step 1</strong>: Import Libraries</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*rn8mifVsEORA-LMiYaS_kg.jpeg" /><figcaption>Picture 1</figcaption></figure><p><strong>Step 2</strong>: Load Dataset</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*qdLDo7qpFYUzpyfMvSkBuQ.jpeg" /><figcaption>Picture 2</figcaption></figure><p><strong>Step 3</strong>: Change month column into the DateTime data type</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*Tr5kJLx944uZfzw5qDfBFQ.jpeg" /><figcaption>Picture 3</figcaption></figure><p><strong>Step 4</strong>: Plot and visualize</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*SMRp0LH8iiUqG45LmFD4RQ.jpeg" /><figcaption>Picture 4.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*v9yc20Pqus7lRYlEvsAxyQ.jpeg" /><figcaption>Picture 4.2</figcaption></figure><p><strong>Step 5</strong>: Check for trend</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*d0NpwJSPf_sufCvwRntoZw.jpeg" /><figcaption>Picture 5.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*XPXZnPuNaZTn88fgMOdk_A.jpeg" /><figcaption>Picture 5.2</figcaption></figure><p><strong>Step 6</strong>: Check for seasonality</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*S22yB8LBHkrI2FKgQAeyNA.jpeg" /><figcaption>Picture 6.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*QUoCXGgaml836orFoeIPeA.jpeg" /><figcaption>Picture 6.2</figcaption></figure><p>We can see that there is roughly a 20% spike each year, this is seasonality.</p><h3>Components of Time Series</h3><p>Time series analysis provides a ton of techniques to better understand a dataset.</p><p>Perhaps the most useful of these is the splitting of time series into 4 parts:</p><ol><li><strong><em>Level</em></strong>: The base value for the series if it were a straight line.</li><li><strong><em>Trend</em></strong>: The linear increasing or decreasing behavior of the series over time.</li><li><strong><em>Seasonality</em></strong>: The repeating patterns or cycles of behavior over time.</li><li><strong><em>Noise</em></strong>: The variability in the observations that cannot be explained by the model.</li></ol><p>All-time series generally have a level, noise, while trend and seasonality are optional.</p><p>The main features of many time series are trends and seasonal variation. Another feature of most time series is that observations close together in time tend to be correlated</p><p>These components combine in some way to provide the observed time series. For example, they may be added together to form a model such as:</p><p><em>Y =levels + trends + seasonality + noise</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*eT_u8KERJVTc-SXq_nL3Hw.png" /><figcaption>Image Courtesy: Machine Learning Mastery</figcaption></figure><p>These components are the most effective way to make predictions about future values, but may not always work. That depends on the amount of data we have about the past.</p><h3>Analyzing Trend</h3><p>Checking out data for repeated behavior in its graphical representation is known as a Trend analysis. As long as the trend is continuously increasing or decreasing that part of data analysis is generally not very difficult. If the time series data contains some kind of considerable error, then the first step in the process of trend identification is smoothing.</p><p><strong><em>Smoothing</em></strong>. Smoothing always involves some form of local averaging of data such that the components of individual observations cancel each other out. The most widely used technique is moving average smoothing which replaces each element of the series with a simple or weighted average of surrounding elements. Medians are mostly used instead of means. The main advantage of median as compared to moving average smoothing is that its results are less biased by outliers within the smoothing window. The main disadvantage of median smoothing is that in the absence of clear outliers it may produce more disturbed curves than moving average.</p><p>In the other less common cases, when the measurement error is quiet large, the distance weighted least squares smoothing or negative exponentially weighted smoothing techniques might be used. These methods generally tend to ignore outliers and give a smooth fitting curve.</p><p><strong><em>Fitting a function</em></strong>. If there is a clear monotonous nonlinear component, the data first need to be transformed to remove the nonlinearity. Usually, log, exponential, or polynomial function is used to achieve this.</p><p>Now let’s take an example to understand this more clearly,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*n4JGp81Mcah5ZjC5-4H_nw.jpeg" /><figcaption>Picture 7.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*HFoIJWKjzu6O7XF1h0cFbg.jpeg" /><figcaption>Picture 7.2</figcaption></figure><p>From the above diagram, we can easily interpret that there is an <em>upward </em>trend for ‘Gym’ every year!</p><h3>Analyzing Seasonality</h3><p>Seasonality is the repetition of data at a certain period of time interval. For example, every year we notice that people tend to go on vacation during the December — January time, this is seasonality. It is one other most important characteristics of time series analysis. It is generally measured by autocorrelation after subtracting the trend from the data.</p><p>Lets look at another example from our dataset,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*2IQDm1KSQ7CSJxRoTg6psw.jpeg" /><figcaption>Picture 8.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*Bw84qKtIEB-2X0rrUdDm2A.jpeg" /><figcaption>Picture 8.2</figcaption></figure><p>From the above graph, it is clear that there is a spike at the starting of every year. Which means every year January people tend to take ‘Diet’ as their resolution rather than any other month. This is a perfect example of seasonality.</p><h3>AR, MA, and ARIMA</h3><h3>Autoregression Model (AR)</h3><p>AR is a time series model that uses observations from previous time steps as input to a regression equation to predict the value at the next time step. A regression model like linear regression takes the form of:</p><p><em>yhat = b0 + (b1 * X1)</em></p><p>This technique can be used on time series where input variables are taken as observations at previous time steps, called lag variables. This would look like:</p><p><em>Xt+1 = b0 + (b1 * Xt) + (b2 * Xt-1)</em></p><p>Since the regression model uses data from the same input variable at previous time steps, it is referred to as autoregression.</p><h3>Moving Average Model (MA)</h3><p>The residual errors from forecasts in a time series provide another source of information that can be modeled. The Residual errors form a time series. An autoregression model of this structure can be used to foresee the forecast error, which in turn can be used to correct forecasts.</p><p>Structure in the residual error may consist of trend, bias &amp; seasonality which can be modeled directly. One can create a model of the residual error time series and predict the expected error of the model. The predicted error can then be subtracted from the model prediction &amp; in turn provide an additional lift in performance.</p><p>An autoregression of the residual error is the Moving Average Model.</p><h3>Autoregressive Integrated Moving Average (ARIMA)</h3><ul><li>Autoregressive integrated moving average or ARIMA is a very important part of statistics, econometrics, and in particular time series analysis.</li><li>ARIMA is a forecasting technique that gives us future values entirely based on its inertia.</li><li>Autoregressive Integrated Moving Average (ARIMA) models include a clear cut statistical model for the asymmetrical component of a time series that allows for non-zero autocorrelations in the irregular component</li><li>ARIMA models are defined for stationary time series. Therefore, if you start with a non-stationary time series, you will first need to ‘difference’ the time series until you attain stationary time series.</li></ul><p>An ARIMA model can be created using the statsmodels library as follows:</p><ol><li>Define the model by using <strong>ARIMA()</strong> and passing in the p, d, and q parameters.</li><li>The model is prepared on the training data by calling the <strong>fit()</strong> function.</li><li>Predictions can be made by using the <strong>predict()</strong> function and specifying the index of the time or times to be predicted.</li></ol><p>Now let’s look at an example,</p><p>We are going to use a dataset called ‘Shampoo sales’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*_aO9qT4ba-DoULv3TTiGAw.jpeg" /><figcaption>Picture 9.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*5gnH1FzifOmV7ALXKdok_g.jpeg" /><figcaption>Picture 9.2</figcaption></figure><h3>ACF and PACF</h3><p>We can calculate the correlation for time-series observations with observations from previous time steps, called <em>lags</em>. Since the correlation of the time series observations is calculated with values of the same series at previous times, this is called a serial correlation, or an autocorrelation.</p><p>A plot of the autocorrelation of a dataset of a time series by lag is called the <strong>A</strong>uto<strong>C</strong>orrelation <strong>F</strong>unction, or the acronym<strong> ACF</strong>. This plot is sometimes called a <em>correlogram</em> or an <em>autocorrelation plot.</em></p><p>For example,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*072TV36KQtyTDwOKIHCrTA.jpeg" /><figcaption>Picture 10</figcaption></figure><p>A partial autocorrelation or <strong><em>PACF</em></strong> is a summary of the relationship between an observation in a time series with observations at prior time steps with the relationships of in between observations removed.</p><p>For example,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*zoL3DJEH9C2-NEPt01snsQ.jpeg" /><figcaption>Picture 11</figcaption></figure><h3>Conclusion</h3><p>Time series analysis is one of the most important aspect of data analytics for any large organization as it helps in understanding seasonality, trends, cyclicality and randomness in the sales and distribution and other attributes. These factors help companies in making a well informed decision which is highly crucial for business.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7006ea1c3326" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/time-series-analysis-7006ea1c3326">Time Series Analysis</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Edge Analytics… Is it the NEXT BIG THING?]]></title>
            <link>https://medium.com/plus-marketing/edge-analytics-is-it-the-next-big-thing-5aac0ba6cf81?source=rss-a3b62ec099d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5aac0ba6cf81</guid>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[facts]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Athul Anish]]></dc:creator>
            <pubDate>Thu, 19 Nov 2020 05:27:54 GMT</pubDate>
            <atom:updated>2020-11-20T13:25:24.922Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Yellow background with a bulb hanging on the right side. “Next Big Thing” is typed in bold alongside the bulb." src="https://cdn-images-1.medium.com/max/1024/1*zs4kUp8JhEejU0uGhp-6Aw.jpeg" /><figcaption>Image Courtesy: www.actian.com</figcaption></figure><p>As we all know, data analytics is the process of collecting, engineering, analyzing of data&#39;s from an organization to gain insightful information which can help in the growth and development of the organization. Since the introduction of <a href="https://athulanish.medium.com/what-do-you-need-to-become-a-data-analyst-in-2020-174f29ba71e0">Data Analytics</a>, various new terms and trends were introduced to us such as machine learning, artificial intelligence, Iot etc. which works hand in hand with data science and this field is flourishing more greater than before. These days, more and more companies depend on the ever growing mountains of data and hence we now have Edge Analytics to help companies in solving their problems much more faster and efficiently.</p><blockquote><strong>So What IS Edge Analytics?</strong></blockquote><p>The typical definition of Edge Analytics states that</p><p>“ Edge analytics is an approach to data collection and analysis in which an automated analytical computation is performed on data at a sensor, network switch or other device instead of waiting for the data to be sent back to a centralized data store.”</p><p>A simpler way of understanding this is, In any manufacturing type of industry, there will be a huge production line fitted with various devices and sensors to come together to complete the whole process. Normally what would happen is, The data&#39;s produced by each of the sensors or switches are collected at a central data storage and it is then worked upon by the analysts. But when it comes to large industries where LARGE AMOUNTS of data&#39;s produced each hour, the typical way of analysis proves to be tedious.</p><p>In Edge Analytics, the analytical computation is done then and there at the position of the sensor rather than sending the data to the central location to be worked on later. This is a BIG BOON for majority of the cooperation&#39;s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sOOdwM13CQHJbuuC6QhBgA.jpeg" /><figcaption>Image Courtesy: www.innovationatwork.ieee.org</figcaption></figure><p>With the advancement in technologies such as IoT, a large number of sensors and actuators come into play and these devices large amounts of data every hour. Managing ALL the data&#39;s produced by these devices is almost impossible in fact, in such cases, majority of the data&#39;s go untouched or unused.</p><p>But when it comes to EDGE ANALYTICS, every data is processed, managed and analyzed right at the spot or in other words, the data&#39;s are managed in real time which is definitely a HUGE BREAKTHROUGH!</p><blockquote><strong><em>Advantages of Edge Analytics</em></strong></blockquote><ol><li><strong><em>Better Security</em></strong>: Since the data collection and analysis is done on site by an automatic computer program and does not involve the transfer of data from one point to another, we can expect our data to be more safe and better protected.</li><li><strong><em>Improved Scalability</em></strong>: Since the data management is executed on point rather than accumulating it at the central data storage, the workload is easily distributed and hence highly scalable.</li><li><strong><em>Real time data processing: </em></strong>As discussed earlier, Since all the work is done on site, on the board itself, The data is received, worked on, and analyzed at almost real time. The problem of latency is nearly eliminated.</li><li><strong><em>Cost effective: </em></strong>Since most of the data works are carried on spot, the cost of cloud management, storing and all other back end works can be cut down or eliminated. Even the maintenance expenses of edge devices are way less compared to<a href="https://athulanish.medium.com/influence-of-cloud-on-analytics-12dd4d85eefc"> cloud</a>.</li><li><strong><em>Predict Failures: </em></strong>The computational power of edge analytics is in such a way that, each device or sensor is handled by an edge device and hence it is possible to accurately predict failures or issues in advance.</li></ol><h3>Conclusion</h3><p>There is A LOT more to discuss about edge analytics here but taking everything into consideration so far, this is one tech that&#39;s going to find its place in many industries such as automation, healthcare, IOT, Security Solutions and what not. There are a lot of things that still needs to be worked on, For example, the fact that this whole concept is still developing means many of the devices wont be compatible with this process and developers might need to develop their own algorithms based on their requirements. The advantages outweigh the disadvantages and hence i guess its safe to say that <em>Edge Analytics </em>is here to stay!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5aac0ba6cf81" width="1" height="1" alt=""><hr><p><a href="https://medium.com/plus-marketing/edge-analytics-is-it-the-next-big-thing-5aac0ba6cf81">Edge Analytics… Is it the NEXT BIG THING?</a> was originally published in <a href="https://medium.com/plus-marketing">Plus Marketing</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Principal Component Analysis]]></title>
            <link>https://medium.com/swlh/principal-component-analysis-3b746802766?source=rss-a3b62ec099d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b746802766</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[business]]></category>
            <dc:creator><![CDATA[Athul Anish]]></dc:creator>
            <pubDate>Mon, 16 Nov 2020 05:28:03 GMT</pubDate>
            <atom:updated>2020-11-19T10:16:52.940Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction to PCA</h3><p>When we work on a huge dataset, we usually see a large number of variables scattered with huge amounts of variances among them which makes it difficult to work with and in turn reduces the efficiency of our model. When working with such kind of large datasets, it’s nearly impossible and exhausting to individually engineer every variable. That’s when principal component analysis comes into play.<br>Multivariate analysis often starts with a huge number of correlated variables. The principal component analysis is a dimension-reduction tool that can be used to reduce the overall size or dimension of the variable set while still managing to keep the most important information within the main set.</p><figure><img alt="A prism showing the splitting of light beam into rainbow colours." src="https://cdn-images-1.medium.com/max/407/0*geW7OoeyPovsa8Gt" /><figcaption>Picture 1</figcaption></figure><p>The principal component analysis follows a set of statistical mathematical procedures to transform a set of correlated variables into a set of unrelated variables called <em>principal components.</em></p><p>Traditionally principal component analysis is done on a symmetric square matrix and is often confused with a similar multivariate analysis procedure called <em>Factor Analysis.</em></p><p>It can be a pure sum of squares and cross-product or<em> SSCP matrix, </em>scaled sum of squares and cross product <em>Covariance matrix, the </em>sum of squares and cross products from standardized data i.e. <em>Correlation matrix</em></p><h3>Assumptions</h3><ul><li><strong>Sample size</strong>: Ideally, there should be at least 150 cases and there should be a ratio of a minimum five cases for each variable</li><li><strong>Correlations: </strong>Some kind of correlation must exist between the variables or factors to be considered for PCA</li><li><strong>Linearity: </strong>A linear relationship must exist between the variables</li><li><strong>Outliers: </strong>There should be no outliers present in the data as it causes disturbance during PCA</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/0*JQmnUETkSOweMxVT" /><figcaption>Picture 2</figcaption></figure><h3>Objectives of PCA</h3><ol><li>PCA reduces attribute or characteristic space from a larger set of variables into a smaller set of factors and does not depend on the dependent variable to be specified, or in other words, <strong>PCA is a ‘non-dependent’ type of procedure</strong>.</li><li><strong>PCA is a data compression or dimensionality reduction technique</strong>. The goal of PCA is to reduce the space between the variables and there is no guarantee that the dimensions are interpretable</li><li>PCA basically <strong>creates a subset of variables from the main set </strong>based on which all variables from the main set have the highest correlation with the prime components</li></ol><h3>Eigenvalues &amp; Eigenvectors</h3><p><em>Eigenvectors</em> also known as principal components reflect both the unique and common variances of the variables and is generally considered to be a variance focused approach to reproduce both the total variable variance with all components and to reproduce the correlation.</p><p>The principal components are linear combinations of the original variables weighted by their contribution to defining the variance in a particular orthogonal dimension.</p><p><em>Eigenvalues</em> are also known as <em>characteristic roots. </em>The general aim of an eigenvalue is to measure the variance for a given factor in all the variables accounted for by that factor.</p><p>If the eigenvalue of a certain factor is low, the that means the contribution of that factor in explaining the variances in the variables is low and such values might be ignored.</p><p>A factor’s eigenvalue is the sum of its squared factor loadings for all the variables.</p><h3>Implementation of PCA in R</h3><p>We are going to work with the most widely used ‘Iris’ dataset. In R there are basically two methods to perform PCA:</p><ul><li>First is <em>spectral decomposition</em> which examines covariances or correlation between variables.</li><li>Second is<em> singular value decomposition</em> which examines covariances or correlation between individuals.</li></ul><p>For the spectral decomposition method we use the <strong>princomp() </strong>function and for <em>singular value decomposition, </em>we use <strong>prcomp()</strong> function.</p><p>Below is the sample simplified code for these two functions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*5Krw9O5zzh0Neo6YhKPuqw.jpeg" /><figcaption>Picture 3</figcaption></figure><p>Where <strong>x</strong> = <em>numeric matrix</em> or <em>data frame</em>,</p><p><strong><em>Scale</em></strong> = whether the variables should be scaled,</p><p><strong><em>Cor</em></strong> = If TRUE, the data will be scaled and centered before analysis,</p><p><strong><em>Score</em></strong> = if TRUE, the coordinates on each principal components are calculated</p><p><strong><em>Now let’s look at an example</em></strong>,</p><p>Step 1: Load the dataset</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*9LdYZ9TzwY69cq4r1uNTVg.jpeg" /><figcaption>Picture 4</figcaption></figure><p>Step 2: Check the covariance of the data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*U0veTiw7SRS9KxDcl34jwA.jpeg" /><figcaption>Picture 5</figcaption></figure><p>Step 3: Calculate eigenvalues and vectors</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*8gGr3vuIOrkR6DQdNDyPkg.jpeg" /><figcaption>Picture 6</figcaption></figure><p>Step 4: PCA</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*xer147hD9k2rBuXLFCVJYw.jpeg" /><figcaption>Picture 6</figcaption></figure><p>Step 5: Compare the output variances</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*YGjwQGNnrfClh857YGiq7g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*By6xoQP7tR95kZyfCODZxA.jpeg" /><figcaption>Picture 7</figcaption></figure><p>Step 6: Compare the eigenvectors</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*zgDAjU-W3KXsZIuL4VN-qQ.jpeg" /><figcaption>Picture 8</figcaption></figure><p>Step 7: Check the summary</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*w9ujKXZ6_PpPiZ9_1Oqxag.jpeg" /><figcaption>Picture 9</figcaption></figure><p>Step 8: Visualization</p><p>The most important part of doing PCA in R is visualization. It gives the user a more in-depth idea about the variables</p><p>There are various visualization techniques. What we are going to use is <em>biplot</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*LBu2cQuWSS6AXZQy4w7ePw.jpeg" /><figcaption>Picture 10</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/0*Zxd9IOQtqbl2DcwQ" /><figcaption>Picture 11</figcaption></figure><p>The x-axis represents the first principal component and the y-axis represents the second. From the graph, we can understand that petal length and petal width are parallel to the x-axis and hence they are completely combined and transformed.</p><h3>Conclusion</h3><p>Adaptation of PCA has been used in many cases such as binary data, ordinal data, compositional data, and even in cases such as time series or datasets with common covariance matrices<br>PCA has also played an important role in other statistical methods such as linear regression or simultaneous clustering of both individuals and variables.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b746802766" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/principal-component-analysis-3b746802766">Principal Component Analysis</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Influence of CLOUD on ANALYTICS]]></title>
            <link>https://athulanish.medium.com/influence-of-cloud-on-analytics-12dd4d85eefc?source=rss-a3b62ec099d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/12dd4d85eefc</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Athul Anish]]></dc:creator>
            <pubDate>Thu, 12 Nov 2020 03:28:38 GMT</pubDate>
            <atom:updated>2020-11-12T03:28:38.128Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Drawing of a laptop on a green background with arrows pointing upwards to the clouds. https://tdwi.org/articles/2018/12/14/a" src="https://cdn-images-1.medium.com/max/976/1*ilu3hqzuV7kpniLP5N7hPQ.jpeg" /><figcaption>Image Courtesy: www.tdwi.org</figcaption></figure><p>With the advancement of technology, companies have been able to produce and analyze more and more data every day. Large amounts of data are spewed out every second. Data analysis has spread into so many different fields and so the world has been introduced to many advanced concepts like machine learning and artificial intelligence.</p><p>In order to build a brilliant ML or AI model, we need clean data, and we need tons of it. The more the data, the better the output, and the more cleaner the data, better the efficiency of our model. The larger the size of the data, the more difficult is its storage and management and that’s where CLOUD comes in. Before we dwell on the influence of cloud on analytics, we must understand what a cloud is!</p><h3>What exactly is the CLOUD?</h3><p>A Cloud is basically a collection of servers that are used to store and retrieve data with the help of the internet. It helps users access files/data from any point using any device. You probably use the cloud almost every other day. With the present generation smartphone, we have the option to store files and information on the cloud rather than on the device. This helps us to access these files by logging into the cloud with the help of the internet on any device.</p><p>The servers are connected to the internet and are hosted by what is called data centers. (Those cool rooms with black boxes and blinking lights that you might have seen in many Hollywood movies.)d blinking lights that you might have seen in many Hollywood movies.)</p><figure><img alt="A dim room with server boxes. (https://www.streamdatacenters.com/the-top-4-advantages-of-a-private-data-center/)" src="https://cdn-images-1.medium.com/max/1024/1*wGYpGVdRHHtztu3MpDzfHg.jpeg" /><figcaption>Image Courtesy: www.streamdatacenters.com</figcaption></figure><p>There are basically four types of cloud computing models:</p><ol><li><strong><em>Software as a Service (Saas)</em></strong>: Software as a service is when the application is hosted onto the servers and the clients access them using the internet rather than downloading it to their device. <em>Eg: AWS, Slack, Google Apps, Dropbox, Gmail, etc.</em></li><li><strong><em>Platform as a Service (Paas)</em></strong>: Instead of buying a whole car, you buy the different parts and tools required to build your own. This is what is meant by <em>PaaS. </em>Here the <em>paas</em> vendors provide the clients with all the necessary tools and requirements needed to build your own application. <em>Eg: Microsoft Azure, Google App Engine, Apache Stratos, etc.</em></li><li><strong><em>Infrastructure as a Service (IaaS)</em></strong>: When the clients rent out the servers from data centers to build their own application, it’s called <em>IaaS. Eg: Amazon Web Service (AWS), Microsoft Azure, Cisco Metacloud, etc.</em></li><li><strong><em>Function as a Service (FaaS)</em></strong>: Iaas is also known as <em>serverless computing, </em>is when the whole process of development in the cloud is broken down into smaller parts and the portions in development are run only when needed. <em>Eg: AWS Lambda, Microsoft Azure, OpenFaas, etc.</em></li></ol><h3><strong>Influence of Cloud on Data Analytics</strong></h3><ol><li><strong>Storage and Safety</strong>. Ease of storage of data is one of the biggest plus points of cloud based analytics. Storing large amounts of confidential company data on a hard disc or personal device makes it vulnerable to accidental deletion or even exploitation of confidentiality by anyone at any time. Storing data&#39;s into the cloud with the help of internet make it easier to access the information from any point and also keeps them safer (from power cuts or system failure etc.)</li><li><strong><em>Ease of access to data</em></strong>. Cloud makes it easier for analysts to access data specially when working from a remote location. Imagine storing large amounts of data on your personal hard drive or buying a hard disc just to store all these data&#39;s. It makes the process more tedious and also vulnerable. When the data is stored in the cloud, any employee can access the data when needed with the help of internet.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*dRLcoYJzD2D1EWHGsaAGqw.png" /><figcaption>Image Courtesy: www.triconinfotech.com</figcaption></figure><ol><li><strong><em>Cost Flexibility</em></strong>. Storing, managing and maintenance of data by any organization is always a fund draining idea. Moving one’s data into the cloud reduces the cost data handling to a major degree. You don&#39;t need to purchase the equipment&#39;s, pay for the upgrades or hire an expert. Cloud computing provides various cost categories depending on the resources you need and the resources you use.</li><li><strong><em>Machine learning, artificial intelligence, Internet of Things</em></strong>. More complex processes like MI and AI requires high level of data in order for us to get a model of maximum efficiency. The demands raised by such complex procedures makes it apt for the cloud. We can expect much more faster data management and output generation with the help of cloud.</li></ol><p>There are TONS of advantages of using cloud for your data management. For any number of cases like machine learning or artificial intelligence or predictive modelling, Cloud might be one of the best resource that can be used for the maximum gain of any organization.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12dd4d85eefc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>