<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Saumitra Jagdale</title>
    <description>The latest articles on Forem by Saumitra Jagdale (@saumitrajagdale).</description>
    <link>https://forem.com/saumitrajagdale</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F492251%2F8a2fb447-0882-416e-964e-840b5fde91f2.jpeg</url>
      <title>Forem: Saumitra Jagdale</title>
      <link>https://forem.com/saumitrajagdale</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/saumitrajagdale"/>
    <language>en</language>
    <item>
      <title>Bipolar Sigmoid vs Tanh Activation Functions</title>
      <dc:creator>Saumitra Jagdale</dc:creator>
      <pubDate>Tue, 15 Dec 2020 14:56:11 +0000</pubDate>
      <link>https://forem.com/saumitrajagdale/bipolar-sigmoid-vs-tanh-activation-functions-d52</link>
      <guid>https://forem.com/saumitrajagdale/bipolar-sigmoid-vs-tanh-activation-functions-d52</guid>
      <description>&lt;p&gt;The activation functions play an important role in determining the output of the neural network. The aggregated value of the network is fed into the activation function to find the output value.&lt;/p&gt;

&lt;p&gt;Input ---&amp;gt; Neural Network (Computation and Aggregation) ---&amp;gt; Activation Function ---&amp;gt; Output&lt;/p&gt;

&lt;p&gt;Bipolar sigmoid and tanh (tan hyperbolic) are the continuous activation functions which give us a gradual output value in the range [-1, 1]. The shape of the both graphs look similar, but is not exactly similar. The slope of tanh graph is more steeper than the bipolar sigmoid.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import numpy as np 

#Bipolar Sigmoid
y1 = (np.exp(x)-1)/(np.exp(x)+1)

#Tanh
y2 = (np.exp(2x)-1)/(np.exp(2x)+1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hence, it could be observed that tanh has the factor of '2x' and bipolar sigmoid has the factor of 'x'. So after taking derivative of both functions the tanh has more value which explains its steeper slope than bipolar sigmoid.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>datascience</category>
      <category>deeplearning</category>
    </item>
    <item>
      <title>Google servers down!</title>
      <dc:creator>Saumitra Jagdale</dc:creator>
      <pubDate>Tue, 15 Dec 2020 05:04:40 +0000</pubDate>
      <link>https://forem.com/saumitrajagdale/google-servers-down-18p6</link>
      <guid>https://forem.com/saumitrajagdale/google-servers-down-18p6</guid>
      <description>&lt;p&gt;The most essential products and services of google were down on 14th December 2020 from around 11:56 GMT. The hashtags #googledown and #youtubedown were trending on twitter, while the memes on the internet said "How should I Google that Google is not working?" This outage effected many users across the world and the trust of the users for the tech giant seemed to be deceiving.&lt;/p&gt;

&lt;p&gt;The Google services and the error messages displayed were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;YouTube: "Something went wrong" with a monkey&lt;/li&gt;
&lt;li&gt;Gmail: "We’re sorry, but your account is temporarily unavailable. We apologise for the inconvenience and suggest trying again in a few minutes. You can view the G Suite Status Dashboard for the current status of the service."&lt;/li&gt;
&lt;li&gt;Google Docs: "Google Docs encountered and error. Please try reloading this page, or coming back to it in a few minutes."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although the Google has not officially commented on the outage yet, however a Google spokesperson said "Today, at 3.47AM PT (Pacific Time), Google experienced an authentication system outage for approximately 45 minutes due to an internal storage quota issue. Services requiring users to log in experienced high error rates during this period. The authentication system issue was resolved at 4:32AM PT. All services are now restored. We apologise to everyone affected, and we will conduct a thorough follow up review to ensure this problem cannot recur in the future"&lt;/p&gt;

&lt;p&gt;As various third party applications/websites depend on Google based authentication (Sign in with Google) which is an Oauth 2 flow, hence some of those third party applications/websites would also focus on including a Facebook based (Sign in with Facebook) authentication method on their registration process. There might be a chance that Google stocks may take a small slump and Facebook stocks might rise up a bit, so invest accordingly.&lt;/p&gt;

</description>
      <category>server</category>
      <category>google</category>
      <category>youtube</category>
      <category>gmail</category>
    </item>
    <item>
      <title>Top Universities Dataset</title>
      <dc:creator>Saumitra Jagdale</dc:creator>
      <pubDate>Thu, 29 Oct 2020 13:50:20 +0000</pubDate>
      <link>https://forem.com/saumitrajagdale/top-universities-dataset-g2c</link>
      <guid>https://forem.com/saumitrajagdale/top-universities-dataset-g2c</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Dataset of World University Rankings of past 8 years along with the parameters like Quality of Staff, Alumni Employment, Publications, Citations, etc. I used beautiful soup parser to extract data from html source code, which I obtained using requests package in python.&lt;/p&gt;

&lt;p&gt;You can find the folder of dataset on Kaggle : &lt;a href="https://www.kaggle.com/saumitrajagdale/university-rankings"&gt;https://www.kaggle.com/saumitrajagdale/university-rankings&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Scraping Data
&lt;/h1&gt;

&lt;p&gt;I scraped this data from the official rankings page provided by CWUR.&lt;br&gt;
URL: &lt;a href="https://cwur.org/"&gt;https://cwur.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The dependecy packages which I use were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pandas: For keeping data in dataframe format.&lt;/li&gt;
&lt;li&gt;Beautiful Soup (bs4): For parsing HTML source code.&lt;/li&gt;
&lt;li&gt;Requests: For obtaining the source code of a given url.&lt;/li&gt;
&lt;li&gt;Numpy: For basic array operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Code Snippet For Scraping:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Dependencies
import pandas as pd
import bs4 
import urllib.request
import numpy as np

# Obtaining source code from the url
url ="https://cwur.org/2012.php"
url_contents = urllib.request.urlopen(url).read()

# Parsing the HTML source code 
soup = bs4.BeautifulSoup(url_contents, "html.parser")

# Extracting the data according to the HTML tags
rows=[]
r=soup.findAll("tr")
for i in range(1,len(r)):
    temp=r[i].findAll("td")
    row=[]
    for j in range(0,len(temp)):
        if j==0:
            s=str(temp[j])
            s=s[4:]
            s=s[:-5]
            row.append(s)
        else:
            s=str(temp[j])
            s=s[4:]
            s=s[:-5]
            row.append(s)
    print(row)
    rows.append(row)

# Converting data into dataframe usings pandas
df=pd.DataFrame(rows,columns=["World Rank","University","Location","National Rank", "Quality of Education", "Alumni Employment", "Quality of Faculty", "Publications", "Influence", "Citations", "Patents","Score"])
print(df)

# Creating csv file from the dataframe
df.to_csv("University_Ranks_2012.csv")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Scope of Analysis
&lt;/h1&gt;

&lt;p&gt;This Dataset can be used for following analysis:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To find the most significant and weighted parameter affecting the ranks of Universities&lt;/li&gt;
&lt;li&gt;To find the trend of rankings of past 8 years based on the parameters provided as columns in dataset.&lt;/li&gt;
&lt;li&gt;To visualise the ranking rise and fall of a particular university with rankings as y- axis and years as x-axis. [Line Graphs]&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>datascience</category>
      <category>python</category>
      <category>database</category>
      <category>bs4</category>
    </item>
    <item>
      <title>Tutorial: Python Lists for Linear Data Structures</title>
      <dc:creator>Saumitra Jagdale</dc:creator>
      <pubDate>Wed, 28 Oct 2020 11:29:19 +0000</pubDate>
      <link>https://forem.com/saumitrajagdale/python-lists-for-linear-data-structures-1lm1</link>
      <guid>https://forem.com/saumitrajagdale/python-lists-for-linear-data-structures-1lm1</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Python lists are dynamic data structures that can be used in various ways while programming for an application-based project. The use of lists makes the code conceptually easy to understand and the readability of the code also increases significantly. Python lists can also be easily typecasted to many data structures according to the requirements, so the conversion is possible in just one line of code. This tutorial focuses on implementing various linear data structures using Python Lists.&lt;/p&gt;

&lt;h1&gt;
  
  
  Linear Data Structures
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Arrays
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; Array is a data structure consisting of a collection of elements, each identified by at least one array index or key.&lt;/li&gt;
&lt;li&gt; Implementation using Python lists:

&lt;ol&gt;
&lt;li&gt;Define the size of the array as N&lt;/li&gt;
&lt;li&gt;Create a list of N elements where every element is zero&lt;/li&gt;
&lt;li&gt;Now you can access each element of the list using its index ranging from [0, N-1]
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;N=5
arr = [0]*N
print(arr)
&amp;gt;&amp;gt; [0, 0, 0, 0, 0]

arr[0] = 1
arr[1] = 2
print(arr)
&amp;gt;&amp;gt; [1, 2, 0, 0, 0]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Matrices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Matrices are the data structures with m horizontal rows and the n vertical columns. Each element of a matrix is often denoted by a variable with two subscripts. For example, a21 represents the element at the second row and first column of the matrix.&lt;/li&gt;
&lt;li&gt;Implementation using Python Lists:

&lt;ol&gt;
&lt;li&gt;Define the number of columns of the matrix as M.&lt;/li&gt;
&lt;li&gt;Define the number of rows of the matrix as N.&lt;/li&gt;
&lt;li&gt;Create a list named 'cols' of M elements where every element is zero&lt;/li&gt;
&lt;li&gt;Create a nested list of N elements of the list 'cols' and name it as 'mat' &lt;/li&gt;
&lt;li&gt;Now you can access each element of the matrix by accessing the elements in the nested list format mat[1][0]
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;M=3
N=2
cols = [0]*M
mat = [cols]*N
print(mat)
&amp;gt;&amp;gt; [[0, 0, 0], [0, 0, 0]]
mat[0][1] = 24
mat[1][2] = 15
print(mat)
&amp;gt;&amp;gt; [[0, 24, 0], [0, 0, 15]]
print(mat[1][2])
&amp;gt;&amp;gt; 15

M=4
N=4
cols = [0]*M
mat = [cols]*N
print(mat)
&amp;gt;&amp;gt; [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Strings
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; String is a sequence of characters, either as a literal constant or as some kind of variable.&lt;/li&gt;
&lt;li&gt; Implementation using Python lists:

&lt;ol&gt;
&lt;li&gt;Define the string using inverted commas.&lt;/li&gt;
&lt;li&gt;Store the string value in a variable, let's say S.&lt;/li&gt;
&lt;li&gt;The object of string created can be typecast to a list, which will store each character as a separate element of the list&lt;/li&gt;
&lt;li&gt;If the string is in the form of a sentence, then the .split() method can be used to store each word as a separate element in the list.
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;S = "Saumitra"
lst = list(S)
print(lst)
&amp;gt;&amp;gt; ['S', 'a', 'u', 'm', 'i', 't', 'r', 'a']

S= "Saumitra Jagdale knows python language"
lst = S.split()
print(lst)
&amp;gt;&amp;gt; ['Saumitra', 'Jagdale', 'knows', 'python', 'language']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Dictionaries
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Dictionaries are data structures that are more generally known as an associative array. A dictionary consists of a collection of key-value pairs. Each key-value pair maps the key to its associated value.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Implementation using Python Lists:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define a nested list in the form of a matrix of order N x 2 where N is the number of key-value pairs you require in your dictionary.&lt;/li&gt;
&lt;li&gt;Let there be a variable 'i' which represents the number of a row of the matrix, hence 0 &amp;lt;= i &amp;lt; N.&lt;/li&gt;
&lt;li&gt;Create a variable 'a' for the nested list, and define the a[i][0] as the key and a[i][1] as the value elements of the matrix.&lt;/li&gt;
&lt;li&gt;Now typecast this nest list 'a' to the dictionary using dict() function.
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = [['Tendulkar', 10], ['Kohli', 18], ['Dhoni', 7]]
d = dict(a)
print(d)
&amp;gt;&amp;gt; {'Tendulkar': 10, 'Kohli': 18, 'Dhoni': 7}

a=[[1, 1], [2, 4], [3, 9], [4, 16], [5, 25], [6, 36], [7, 49]]
d = dict(a)
print(d)
&amp;gt;&amp;gt; {1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;While typecasting a dictionary into the list, only the 'key' elements from the dictionary are converted to the list whereas, the 'value' elements from the dictionary are lost in this typecasting process.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;d = {1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49}
a = list(d)
print(a)
&amp;gt;&amp;gt; [1, 2, 3, 4, 5, 6, 7]

d = {'Tendulkar': 10, 'Kohli': 18, 'Dhoni': 7}
a = list(d)
print(a)
&amp;gt;&amp;gt; ['Tendulkar', 'Kohli', 'Dhoni']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Queues
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; Queue is a collection of entities that are kept in a sequence and can be modified by the addition of elements at one end of the sequence and the removal of elements from the other end of the sequence.&lt;/li&gt;
&lt;li&gt; Implementation using Python lists:

&lt;ol&gt;
&lt;li&gt;Define the sequence of elements of the queue.&lt;/li&gt;
&lt;li&gt;Create an empty list object as variable Q and append the elements in a sequence using Q.append(val) method, this operation is also called enqueuing.&lt;/li&gt;
&lt;li&gt;For removing the elements use the Q.pop(0) method of the created object of the list which will remove the element of the zeroth index, this operation is also called dequeuing.
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Lets say sequence is: 1 4 9 16  

# Enqueuing
Q = []
Q.append(1)
Q.append(4)
Q.append(9)
print(Q)
&amp;gt;&amp;gt; [1, 4, 9]

Q.append(16)
print(Q)
&amp;gt;&amp;gt; [1, 4, 9, 16]

# Dequeuing
Q.pop(0)
print(Q)
&amp;gt;&amp;gt; [4, 9, 16]

Q.pop(0)
Q.pop(0)
&amp;gt;&amp;gt; [16]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Stacks
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; Stack is a data structure that serves as a collection of elements, with two main features: push, which adds an element to the collection, and pops, which removes the most recently added element that was not yet removed&lt;/li&gt;
&lt;li&gt; Implementation using Python lists:

&lt;ol&gt;
&lt;li&gt;Define the sequence of elements of the stack.&lt;/li&gt;
&lt;li&gt;Create an empty list object as variable S and append the elements in a sequence using S.append(val) method, this operation is also called pushing.&lt;/li&gt;
&lt;li&gt;For poping the elements use the S.pop() method of the created object of the list which will remove the element of the last index.
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Lets say sequence is: 1 4 9 16  

# Pushing
S = []
S.append(1)
S.append(4)
S.append(9)
print(S)
&amp;gt;&amp;gt; [1, 4, 9]

S.append(16)
print(Q)
&amp;gt;&amp;gt; [1, 4, 9, 16]

# Poping
S.pop()
print(S)
&amp;gt;&amp;gt; [1, 4, 9]

S.pop()
S.pop()
&amp;gt;&amp;gt; [1]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  NOTE
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The method implemented above is not an optimized way to implement data structures with respect to time and space complexity.&lt;/li&gt;
&lt;li&gt;Linked List (Singly, Doubly and Circular) needs to address allocation which is not possible by only using lists, so a proper structure of class and methods are needed to be designed for that. &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>Python Scripts </title>
      <dc:creator>Saumitra Jagdale</dc:creator>
      <pubDate>Sat, 17 Oct 2020 02:43:08 +0000</pubDate>
      <link>https://forem.com/saumitrajagdale/python-scripts-1kno</link>
      <guid>https://forem.com/saumitrajagdale/python-scripts-1kno</guid>
      <description>&lt;h2&gt;
  
  
  What I Learned From Hacktoberfest
&lt;/h2&gt;

&lt;p&gt;I had not commited an open source contribution before participating in Hacktoberfest, I learned to fork repositories and commiting pull requests on the main repositories.&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
    </item>
  </channel>
</rss>
