<?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>DEV Community: Anita Okoh</title>
    <description>The latest articles on DEV Community by Anita Okoh (@anitaokoh).</description>
    <link>https://dev.to/anitaokoh</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F359544%2Fd155cbce-e85d-45b1-b5d9-f86699e75fb9.jpeg</url>
      <title>DEV Community: Anita Okoh</title>
      <link>https://dev.to/anitaokoh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anitaokoh"/>
    <language>en</language>
    <item>
      <title>Linear regression</title>
      <dc:creator>Anita Okoh</dc:creator>
      <pubDate>Thu, 23 Apr 2020 17:04:30 +0000</pubDate>
      <link>https://dev.to/anitaokoh/linear-regression-2lpf</link>
      <guid>https://dev.to/anitaokoh/linear-regression-2lpf</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclaimer: My study note on Linear Regression&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Linear Regression&lt;/strong&gt; is an algorithm used to find the best fit line( trend) for a set of data points.&lt;br&gt;
It revolves around the straight-line equation &lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathdefault"&gt;y&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathdefault"&gt;m&lt;/span&gt;&lt;span class="mord mathdefault"&gt;X&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;+&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathdefault"&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;


&lt;p&gt;where &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;y is the dependent variable( the variable we went to predict), &lt;/li&gt;
&lt;li&gt;X is the dependent variable ( or the predictor or feature variable) and &lt;/li&gt;
&lt;li&gt;the two parameters or weights which are the slope and intercepts respectively.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The whole game or idea in a linear regression model is to adjust the weights to find the best-suited line that fits the data enough to predict the y variable accurately or near-accurately. In turn, the best-fit line is the equation which has the least error/lowest error&lt;/p&gt;

&lt;p&gt;There are two major ways of getting the best line by adjusting the weights&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The absolute and square trick&lt;/li&gt;
&lt;li&gt;The error functions (MAE OR MSE) along with gradient descent&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Types of Gradients
&lt;/h2&gt;

&lt;p&gt;There are 3 major types&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Batch Gradient descent:&lt;/strong&gt; This involves summing all the errors and updating the weights&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stochastic Gradient Descent:&lt;/strong&gt; This involves using each point to update the weights&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mini-Batch Gradient Descent:&lt;/strong&gt; This involves splitting the data into small equal batches and use each batch to update the weights.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;(N:B, the mini-batch method is most times used because the earlier two types can be computationally expensive.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;It would be great to understand the mechanics behind each Gradient descent visually&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Dimensions in Linear Regression Models
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Two-dimension:&lt;/strong&gt; This includes one feature variable and a dependent variable. In this case, the prediction is in the form of a line&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Three-dimension:&lt;/strong&gt; This includes two feature variables and a dependent variable. In this case, the prediction is in the form of a plane&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;N-dimension:&lt;/strong&gt; This includes n-number of features along with a dependent variable. In this case, the prediction is in the form of a hyperplane.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is good to note that when we have one feature(X) variable, it is known as a &lt;strong&gt;Simple Linear Regression&lt;/strong&gt; because it builds a simple model. More than one feature variable makes it a &lt;strong&gt;Multiple Linear regression&lt;/strong&gt;  and as more features are introduced, the more the model becomes complex.&lt;/p&gt;

&lt;p&gt;There are two major red flags to note about Linear Regression Model.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It works best when the data is linear or has a linear relationship. If the x and y variable has no linear relationship, you may need to 

&lt;ul&gt;
&lt;li&gt;Make adjustments (or transform the data)&lt;/li&gt;
&lt;li&gt;Add more features&lt;/li&gt;
&lt;li&gt;Use another type of non-linear model&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Linear Regression is sensitive to outliers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Polynomial Regression&lt;/strong&gt; is a method to transform the data that have a non-linear relationship. It is more of a preprocessing/data transformation method. It also adds more complexity to the linear model. &lt;em&gt;It would be great to understand more on its intuition.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Regularization&lt;/strong&gt; is a way to penalize complex models and help smoothen the line to make the model more generalized. &lt;br&gt;
There are two types of Regularization: L1 and L2 which are penalties that can be found in the lasso regression and Ridge Regression respectively( These are variations of the vanilla Linear Regression). In each of the &lt;em&gt;Variation models&lt;/em&gt;, the parameter lambda is used to regulate these penalties.&lt;/p&gt;

&lt;p&gt;Below is an image that shows the difference between L1 and L2&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S2Nn4ZRV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hxskywojwfh15fpfi2jg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S2Nn4ZRV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hxskywojwfh15fpfi2jg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Feature Scaling
&lt;/h2&gt;

&lt;p&gt;This is a way of transforming your data into a common range of values. There are two types&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Standardizing&lt;/strong&gt; - This is a process of subtracting each data point with the mean and dividing by the standard deviation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Normalizing&lt;/strong&gt; - This is a process where the data is scaled between 0 and 1.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to feature scale&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When your algorithm uses a distance-based metric to predict like SVMs, KNN, K-means, etc.&lt;/li&gt;
&lt;li&gt;When you incorporate regularization.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Some questions to ponder are:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Can feature scaling improve the linearity of the variables?&lt;/li&gt;
&lt;li&gt;How does scaling affect distance-based models or regularization?&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Some Software engineering Concepts </title>
      <dc:creator>Anita Okoh</dc:creator>
      <pubDate>Thu, 09 Apr 2020 11:57:13 +0000</pubDate>
      <link>https://dev.to/anitaokoh/some-software-engineering-concepts-2ak2</link>
      <guid>https://dev.to/anitaokoh/some-software-engineering-concepts-2ak2</guid>
      <description>&lt;p&gt;Lately, I have been taking some software engineering classes to combine  the knowledge with my data science skills&lt;/p&gt;

&lt;p&gt;These are some of the concepts I have picked up so far&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Refactoring&lt;/strong&gt;: This means restructuring your code to improve the internal structure without changing external functionality. In other words, rearranging your code to improve efficiency and readability without change the purpose or the original functions of the code. This includes cleaning your code by using descriptive but concise variable names and decluttering the lines of codes in a function as well as using appropriate white spaces. It also includes proper documentation, be it an inline-level, function/module level or project level&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Modularization&lt;/strong&gt;: This means converting your codes into modules based on their functionalities. Someone once told me that "similar functions should be grouped together". This helps for each module to be independent in function, improve readability and reusability for future references&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Test-Driven Development&lt;/strong&gt;: This is the process of writing tests for tasks before developing or writing the code to implement those tasks. &lt;strong&gt;This is such an abstract technique in data science and it would be nice to practice this.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One thing to keep in mind is: &lt;em&gt;Classes, inheritance, object, attributes, and methods are common to all object-oriented programming language&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If one were to think about python concepts ( like packages, modules, functions, etc) in a hierarchical method, I would say it would look like this below (from small to big)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--z6yPNMSt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sy7bo54jsl8oer1nsihe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z6yPNMSt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sy7bo54jsl8oer1nsihe.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Classes , Magic Methods and Inheritances</title>
      <dc:creator>Anita Okoh</dc:creator>
      <pubDate>Wed, 08 Apr 2020 15:26:39 +0000</pubDate>
      <link>https://dev.to/anitaokoh/classes-magic-methods-and-inheritances-502e</link>
      <guid>https://dev.to/anitaokoh/classes-magic-methods-and-inheritances-502e</guid>
      <description>&lt;h3&gt;
  
  
  CLASSES
&lt;/h3&gt;

&lt;p&gt;A Class is a blueprint of an object. Classes are a great way for object-oriented programs to group similar data and functions in a manner that is reusable and to avoid redundancy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5W43RGbu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4zhs2fodhho2b1d78vcq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5W43RGbu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4zhs2fodhho2b1d78vcq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Magic Methods
&lt;/h3&gt;

&lt;p&gt;Python Magic Methods are methods specifically to override default python behaviors or rules, most of the time, &lt;strong&gt;operator overrides&lt;/strong&gt;. They can be identified with two prefix and suffix underscores in the method name. Examples of Magic codes are &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the __&lt;strong&gt;&lt;em&gt;init&lt;/em&gt;&lt;/strong&gt;__() method in a Class which overrides how python instantiate an object&lt;/li&gt;
&lt;li&gt;the __&lt;strong&gt;&lt;em&gt;add&lt;/em&gt;&lt;/strong&gt;__() method which overrides the behaviour of the plus sign. These methods could be the reason we can add two strings with ‘+’ operator with no error  and without any explicit typecasting(i.e Converting one data type to another data type)&lt;/li&gt;
&lt;li&gt;The __&lt;strong&gt;&lt;em&gt;rep&lt;/em&gt;&lt;/strong&gt;__() method which overrides what gets printed as a variable value&lt;/li&gt;
&lt;li&gt;The __&lt;strong&gt;&lt;em&gt;len&lt;/em&gt;&lt;/strong&gt;__() method which probably has to do with the length of a data structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And etc.&lt;/p&gt;

&lt;p&gt;Magic Methods seem to be super cool but super technical and seem to be only applicable in a Class&lt;/p&gt;

&lt;h3&gt;
  
  
  Inheritance
&lt;/h3&gt;

&lt;p&gt;Inheritance is the technique where a class inherits the properties of another class(which most times is considered as the parent class). And these properties being both attributes and methods. And the main rationale for this is so that the child class can have more varieties without affecting the design of the parent class.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Jr-qy2S4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/p2y057s0n2f80365f711.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Jr-qy2S4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/p2y057s0n2f80365f711.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Combinatorics</title>
      <dc:creator>Anita Okoh</dc:creator>
      <pubDate>Sat, 04 Apr 2020 18:53:57 +0000</pubDate>
      <link>https://dev.to/anitaokoh/combinatorics-2019</link>
      <guid>https://dev.to/anitaokoh/combinatorics-2019</guid>
      <description>&lt;p&gt;Combinatorics is the combination of outcomes from a finite set.&lt;br&gt;
There are two major types of combinatorics.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Permutation&lt;/li&gt;
&lt;li&gt;Combination
Factors that differentiate each combinatorics are&lt;/li&gt;
&lt;li&gt;Order&lt;/li&gt;
&lt;li&gt;Repetition&lt;/li&gt;
&lt;li&gt;Entire set/Subset&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Permutation and  combination both have to do with the number of different ways to arrange or pick certain elements of a set&lt;/p&gt;

&lt;p&gt;The major differences between the two are &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Order: For Permutation, how the set/subset is arranged or the order is very critical while for combination, the order is irrelevant. For example, trying to decode the passcode of a locker has a lot to do with how the elements/letters would be arranged. Therefore,  this is a permutation problem&lt;/li&gt;
&lt;li&gt;Double Counting: For Permutation, no matter how identical two subsets are in terms of elements( not order), there are still considered distinct sets. Unlike the combination, where each combination of sets should not be identical in elements. An example is a collection of the following subsets: AB, BA, AC, CA, BC. Although there are 5 permutations, there are just 3 combinations because for combinations AB &amp;amp; BA are not distinct selections. This is why there would be more permutation selections than combination selections in a given set. Therefore, permutation does not take into account double counting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Permutation can be split further into two&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The vanilla Permutation&lt;/li&gt;
&lt;li&gt;Variation&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Vanilla Permutation in the sense that all elements in the set would be used in the selection ways problem.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Variation, as the name implies, infers that we pick and arrange some elements in the given set i.e a subset(s) from a total set(n)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example,  &lt;strong&gt;how many ways can the sets: A, B, C, D, E be arranged?&lt;/strong&gt; can be a vanilla permutation problem while &lt;strong&gt;how many ways can the sets: A, B, C, D, E be arranged in twos?&lt;/strong&gt; is a variation problem&lt;/p&gt;

&lt;p&gt;I would like to say that combinations can be confused with variation permutation. One major difference is if the order is relevant. ( A second difference is obviously the formulas)&lt;/p&gt;

&lt;p&gt;It is also good to know that both permutations and combinations have different formulas based on if the elements in question should be repeated or not. &lt;em&gt;(combination problems with repetitions are very hard to identify)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let's talk about the formulas. Take note of the difference in the order and repetition constraints from the image below&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xnOaGQO1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jutgit2ca2s9ty9axgg4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xnOaGQO1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jutgit2ca2s9ty9axgg4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also created a decision tree to help as well&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jApXrrg9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6ioi11delamlrirhb1j3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jApXrrg9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6ioi11delamlrirhb1j3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above information is not exhaustive therefore I would update as I learn more about the topic.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>So many Types of Probability distributions</title>
      <dc:creator>Anita Okoh</dc:creator>
      <pubDate>Sat, 04 Apr 2020 10:54:52 +0000</pubDate>
      <link>https://dev.to/anitaokoh/so-many-types-of-probability-distributions-41j4</link>
      <guid>https://dev.to/anitaokoh/so-many-types-of-probability-distributions-41j4</guid>
      <description>&lt;p&gt;Today in my Nanodegree course, I got to be aware of some of the different types of probability distributions&lt;br&gt;
The common ones are &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the continuous probability distribution(CPD) and &lt;/li&gt;
&lt;li&gt;the discrete probability distribution (DPD)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;CPD in terms of  Normal Distribution( Gaussian distribution)&lt;br&gt;
DPD in terms of  Binomial Distribution &lt;/p&gt;

&lt;p&gt;I guess for CPD, the random variable ( variable in question) can be any range of number while fo the DPD, the random variable are discrete( integers) only&lt;/p&gt;

&lt;p&gt;Some questions that popped up to my minds are&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What are the other PDs?&lt;/li&gt;
&lt;li&gt;How are the Bernoulli and multinominal different? &lt;/li&gt;
&lt;li&gt;And when do you use each in naive Bayes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I also have to know how to build the gaussian distribution and any other distribution from scratch.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
