<?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: MercyMburu</title>
    <description>The latest articles on DEV Community by MercyMburu (@mercykiria).</description>
    <link>https://dev.to/mercykiria</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%2F1174310%2Fb1d6a837-19f7-4d19-924b-44df47ef0e29.jpg</url>
      <title>DEV Community: MercyMburu</title>
      <link>https://dev.to/mercykiria</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mercykiria"/>
    <language>en</language>
    <item>
      <title>5 analytical skills that evry Data Analyst should have</title>
      <dc:creator>MercyMburu</dc:creator>
      <pubDate>Sat, 16 Aug 2025 01:25:08 +0000</pubDate>
      <link>https://dev.to/mercykiria/5-analytical-skills-that-evry-data-analyst-should-have-2e19</link>
      <guid>https://dev.to/mercykiria/5-analytical-skills-that-evry-data-analyst-should-have-2e19</guid>
      <description>&lt;p&gt;Skill1 :The Why and How skill&lt;br&gt;
This refers to the innate curiosity that comes naturally. For instance, remember asking questions back in high school or campus and wondering why you are the only one who raised your hand as other students jeered back at you? That is a valuable skill in Analytics. Simply because the more curious you are about the business problem, the more questions you'll ask the stakeholder. Clarifies goals and objectives and enhances your data analysis process.&lt;/p&gt;

&lt;p&gt;Skill 2: Comprehending data based on context&lt;br&gt;
It's all about understanding the full picture that the data presents.&lt;br&gt;
The ability to fully grasp the context of your data can make a huge difference in your analysis process.&lt;/p&gt;

&lt;p&gt;Skill 3: Breaking down things&lt;br&gt;
Every data analyst needs to hone 'developing a technical mindset'. Having a technical mindset means tackling each problem methodogically and logically.&lt;br&gt;
An essential part because you can't just jump into analyzing right after identifying the business problem. To adress the problem, start by breaking the process into smaller manageable pieces of information.&lt;br&gt;
This includes gathering your data and then thoroughly cleaning it before you dive into the core analysis.&lt;/p&gt;

&lt;p&gt;Skill 4: Data Design&lt;br&gt;
It can be compared to working on a spreadsheetand then arranging the data neatly to spot patterns and insights. That whole process is called data design. This skill, like many others, grows stronger with practice.&lt;br&gt;
Data Design is an extension of technical mindset.&lt;br&gt;
In this phase, you’re rearranging cells and organizing data, making it easier to discover various patterns.&lt;/p&gt;

&lt;p&gt;Skill 5: Data Strategy&lt;br&gt;
Data strategy involves managing not just the data itself but also the people, processes, and tools involved in data analysis.&lt;br&gt;
Think of it as a kind of resource allocation skill. It’s all about choosing the right tools and approaches for the specific business problem at hand.&lt;br&gt;
For example if the business issue calls for a simple dashboard, the Ms. Excel will be the right tool. If it calls something more comprehensive and interactive like data modelling , then Power BI, and tableau are the go-to options.&lt;/p&gt;

&lt;p&gt;By harnessing these analytical skills, you’ll find that your understanding of the problems becomes five times clearer and more concise, even before you begin the project.&lt;/p&gt;

&lt;p&gt;Therefore, taking a step back to focus on the big picture and applying analytical thinking, as outlined above, is essential for every data analyst.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Cross-validation in Machine Learning</title>
      <dc:creator>MercyMburu</dc:creator>
      <pubDate>Thu, 11 Apr 2024 11:36:06 +0000</pubDate>
      <link>https://dev.to/mercykiria/cross-validation-in-machine-learning-3jhe</link>
      <guid>https://dev.to/mercykiria/cross-validation-in-machine-learning-3jhe</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi38eb211rzqz5lv5c0cv.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi38eb211rzqz5lv5c0cv.jpeg" alt="Cross-validation AI image" width="800" height="800"&gt;&lt;/a&gt;&lt;br&gt;
Want to learn how to use cross-validation for better measures of model perfomance? Want to understand this common term used when developing machine learning models? What does it mean? 💁‍♀️&lt;br&gt;
 You are in the right place.😊&lt;/p&gt;

&lt;p&gt;Machine learning is an iterative process. That we all agree. Basically facing the need to go some step back during development and making changes or reviews, is what we mean by iterative. You will face choices about what predictive variables to use, what types of models to use, what arguments to supply to those models, etc. &lt;/p&gt;

&lt;p&gt;Most of us and quite often, have made these choices in a data-driven way by measuring model quality with a validation set.&lt;br&gt;
But there are some drawbacks to this approach. To see this, imagine you have a dataset with 5000 rows. You will typically keep 20% of it as a validation set, right, or 1000 rows? But this leaves some random chance in determining model scores. A model might do well on a set of 1000 rows even if it will be inaccurate on a set of a different 1000 rows.&lt;/p&gt;

&lt;p&gt;At an extreme you could imagine having only one row of data in the validation set. If you compare alternative models, which one makes the best predictions on a single data point will be mostly a matter of luck!&lt;/p&gt;

&lt;p&gt;In general, the larger the validation set, the less randomness there is in our measure of model quality and the more reliable it will be. Unfortunately, we can only get our validation set by picking a set of rows from the training data and smaller training datasets mean worse models.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Cross-validation?
&lt;/h2&gt;

&lt;p&gt;In cross-validation, we run our models on different subsets of data to get different performances of the models, or we can say, it's a way of getting multiple measures of quality of the models.&lt;br&gt;
For example, we could begin by dividing our datasets into 5 parts, each 20% of the full dataset. In this case, we say we have broken the data into 5 folds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs5145zfu11dclwfqhnvm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs5145zfu11dclwfqhnvm.png" alt="Image description" width="800" height="205"&gt;&lt;/a&gt;&lt;br&gt;
Then we run one experiment for each fold.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In &lt;strong&gt;experiment 1&lt;/strong&gt;, we use the first fold as a validation set and everything else as training data. This gives us a measure of quality based on a 20% holdout set.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;experiment 2&lt;/strong&gt;, we hold out data from the second fold and use everything else as except the second fold for training. Gives a second estimate of the model quality.&lt;/li&gt;
&lt;li&gt;We repeat this process, using every fold once as the holdout set. Putting this together, 100% of the data is used as holdout at some point, and we end up with a measure of model quality that is based on all of the rows in the dataset (even if we don't use all rows simultaneously).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  When should you use cross-validation?
&lt;/h2&gt;

&lt;p&gt;Cross-validation gives a more accurate measure of model quality, which is especially important if you are making a lot of modelling decisions. It can however take long to run because it estimates multiple models(one for each fold).&lt;/p&gt;

&lt;p&gt;So, given these tradeoffs, when should you use each approach?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For small datasets, where extra computational burden isn't a big deal, you should run cross-validation.&lt;/li&gt;
&lt;li&gt;For larger datasets, a single validation set is sufficient. Your code will run faster, and you may have enough data that there's little need to reuse some of it for holdout.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There's no way to conclude what measure constitutes of a large dataset vs a small dataset. But if your model takes a couple of minutes to run, then it's worth to switch to cross-validation.&lt;/p&gt;

&lt;p&gt;Alternatively, you can run cross-validation and see if the scores for each experiment seem close. If the experiment yields the same results, a single validation set is probably sufficient.&lt;/p&gt;

&lt;p&gt;Let's see this with an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd
# Read the data
data = pd.read_csv('../input/melbourne-housing-snapshot/melb_data.csv')
# Select subset of predictors
cols_to_use = ['Rooms', 'Distance', 'Landsize', 'BuildingArea', 'YearBuilt']
X = data[cols_to_use]
# Select target
y = data.Price
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we define a pipeline that uses an imputer to fill in missing values and a random forest model to make predictions.&lt;br&gt;
While it's possible to do cross-validation without an imputer,it's quite difficult! Using a pipeline will make the code quite straightforward.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.ensemble import RandomForestRegressor
from sklearn.pipeline import Pipeline
from sklearn.impute import SimpleImputer
my_pipeline=Pipeline(steps=[('preprocessor',SimpleImputer()),
                      ('model', RandomForestRegressor(n_estimators=50,random_state=0])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We obtain the cross-validation scores with the cross_val_score() from scikit learn. We set the number of folds with the cv parameter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.model_selection import cross_val_score
# Multiply by -1 since sklearn calculates *negative* MAE
scores= -1 * cross_val_score(my_pipeline, X, y, cv=5, scoring=neg_mean_absolute_error)
print("MAE scores:\n, "scores)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output: MAE scores:&lt;br&gt;
 [301628.7893587  303164.4782723  287298.331666   236061.84754543&lt;br&gt;
 260383.45111427]&lt;/p&gt;

&lt;p&gt;The scoring parameter chooses a measure of model quality to report : in this case, we choose negative mean absolute error(MAE).&lt;/p&gt;

&lt;p&gt;It's is a little surprising that we specify negative MAE. Scikit-learn has a convention where all metrics are defined so a high number is better. Using negatives here allows them to be consistent with that convention, though negative MAE is almost unheard of elsewhere.&lt;/p&gt;

&lt;p&gt;We typically want a single measure of model quality to compare alternative models. So we take the average across experiments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("Average MAE score (across experiments):")
print(scores.mean())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output: Average MAE score (across experiments):&lt;br&gt;
277707.3795913405&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Using cross-validation yields a much better measure of model quality, with the added benefit of cleaning up our code: note that we no longer need to keep track of separate training and validation sets. So, especially for small datasets, it's a good improvement!&lt;/p&gt;

&lt;p&gt;This whole content was extracted from the Kaggle intermediate machine learning course, module : &lt;a href="https://www.kaggle.com/code/alexisbcook/cross-validation"&gt;Cross-validation.&lt;/a&gt;💌&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>datascience</category>
      <category>ai</category>
    </item>
    <item>
      <title>Mastering Python iteration: Loops and the magic of list comprehensions</title>
      <dc:creator>MercyMburu</dc:creator>
      <pubDate>Mon, 08 Apr 2024 09:11:24 +0000</pubDate>
      <link>https://dev.to/mercykiria/mastering-python-iteration-loops-and-the-magic-of-list-comprehensions-7fp</link>
      <guid>https://dev.to/mercykiria/mastering-python-iteration-loops-and-the-magic-of-list-comprehensions-7fp</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm254epjtf69mpbbowzbj.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm254epjtf69mpbbowzbj.jpeg" alt="An image illustrating loops in python" width="800" height="800"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;&lt;h2&gt;What are loops?&lt;/h2&gt;&lt;/strong&gt; ➰&lt;br&gt;
They can be termed simply as a way to repeatedly execute some code➿.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;planets= ['mercury','venus','earth','mars','jupyter','saturn','uranus','neptune']
for planet in planets:
print(planet,end='')

# The end='' overrides the \n behavior and instead adds a space ('') after each planet name

output: Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The for loop specifies:&lt;/p&gt;

&lt;p&gt;The variable names to use in this case, ‘planet’&lt;br&gt;
The set of values to loop over ‘planets’&lt;br&gt;
You use the word ‘in’ to link them together.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;NB :The object right to the ‘in’ can be thought of as a set of a group of things you can probably loop over.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We can also iterate over elements in a tuple. Difference between lists and tuples is that tuple elements are put inside parenthesis and they are immutable i.e. cannot be assigned new values to them once assigned.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;multiplicands=(2,2,2,3,3,5)
product = 1
for mult in multiplicands:
product=product*mult

product

Output:360
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Multiplicands holds the values to be multiplied together. The ‘product=1’ initializes the variable product that will be used to store the final multiplication answer. ‘for mult in multiplicands’ is a for loop that iterates over each number represented by variable ‘mult’ in the multiplicands tuple.&lt;br&gt;
‘product = product * mult’ is a line executed for each iteration on the loop.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retrieves the current value of the product variable.&lt;/li&gt;
&lt;li&gt;Multiplies it with the current mult value from the tuple.&lt;/li&gt;
&lt;li&gt;Assigns the result back to the product variable, updating it with the new product.&lt;/li&gt;
&lt;li&gt;The code effectively multiplies together all the numbers in the multiplicands tuple, resulting in 2 x 2 x 2 x 3 x 3 x 5 = 360.
You can even loop through each character in a string:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;s = 'steganograpHy is the practicE of conceaLing a file, message, image, or video within another fiLe, message, image, Or video.'
msg = ''
# print all the uppercase letters in s, one at a time

for char in s:
if char.isupper():
print(char)

output: HELLO
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Range()&lt;/strong&gt;&lt;br&gt;
A function that returns a sequence of numbers and is very useful in writing loops. For instance, if we want to repeat some action 5 times:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for i in range(5):
print('Doing important work.i=',i)
Output:
Doing important work. i = 0
Doing important work. i = 1
Doing important work. i = 2
Doing important work. i = 3
Doing important work. i = 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case the loop variable is named i and range(5) generates a sequence of numbers from 0 to 5.In each iteration, the value of i is inserted into the string using string formatting. So the printing is done 5 times equivalent to the sequence range.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;While loops&lt;/strong&gt;➰&lt;br&gt;
Iterate until some condition is met.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;i=0
while i&amp;lt;10:
print(i)
i+= 1 #increase the value of i by 1
output: 0 1 2 3 4 5 6 7 8 9 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;List Comprehensions&lt;/strong&gt;&lt;br&gt;
Are one of python’s most beloved features. The easiest way of understanding them is to probably look at examples.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;squares= [n**2 for n in range(10)]
squares

Output: [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here’s how we would do the same thing without a list comprehension:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;squares=[]
for n in range(10):
squares.append(n**2)
squares

Output:[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also add an ‘if’ condition&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;short_planets = [planet for planet in planets if len(planet) &amp;lt; 6]
short_planets

Output: ['Venus', 'Earth', 'Mars']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(If you’re familiar with SQL, you might think of this as being like a “WHERE” clause)&lt;/p&gt;

&lt;p&gt;Here’s an example for filtering with an ‘if’ condition and applying some transformations to the loop variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# str.upper() returns all-caps version of a string
loud_short_planets=[planet.upper() + '!' for planet in planets if len(planet)&amp;lt;6]
loud_short_planets

Output:['VENUS!', 'EARTH!', 'MARS!']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;People usually write these on a single line, but you might find the structure clearer when split into 3 lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
planet.upper()+'!'
for planet in planets
if len(planet)&amp;lt;6
]
Output: ['VENUS!', 'EARTH!', 'MARS!']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Continuing in the SQL analogy, you could think of these 3 lines as SELECT, FROM and WHERE.&lt;/p&gt;

&lt;p&gt;List comprehensions combined with functions like min, max and sum can lead to impressive one-line solutions for problems that would otherwise require several lines of code.&lt;/p&gt;

&lt;p&gt;For example compare the following two cells of code that do the same thing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def count_negatives(nums):
"""Return the number of negative numbers in the given list.
&amp;gt;&amp;gt;&amp;gt; count_negatives([5, -1, -2, 0, 3])
    2
    """
n_negative=0
for num in nums:
if num&amp;lt;0:
n_negative=n_negative + 1
return n_negative
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is a code using list comprehension instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def count_negatives(nums):
return len([num for num in nums if num&amp;lt;0])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Much better right? Especially in terms of lines of code.&lt;/p&gt;

&lt;p&gt;Solving a problem with less code is always nice, but it’s worth keeping in mind the following lines from The Zen of Python:&lt;/p&gt;

&lt;p&gt;Readability counts&lt;br&gt;
Explicit is better than implicit&lt;br&gt;
So use tools that make compact readable programs. But when you have to choose, favor code that is easy for others to understand.&lt;/p&gt;

&lt;p&gt;A special thanks to the Kaggle community for their contributions to open-source data and code. This article benefitted greatly from the resources available on their platform: &lt;a href="https://www.kaggle.com/"&gt;https://www.kaggle.com/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thank you!💌&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>lists</category>
      <category>loops</category>
    </item>
    <item>
      <title>Analyzing criminal incident data from Seattle or San Francisco</title>
      <dc:creator>MercyMburu</dc:creator>
      <pubDate>Wed, 06 Mar 2024 00:29:42 +0000</pubDate>
      <link>https://dev.to/mercykiria/analyzing-criminal-incident-data-from-seattle-or-san-francisco-5e61</link>
      <guid>https://dev.to/mercykiria/analyzing-criminal-incident-data-from-seattle-or-san-francisco-5e61</guid>
      <description>&lt;p&gt;(This blog post has been written as one of the assignments of the Data Science MOOC being offered on Coursera by the University of Washington)&lt;br&gt;
We will compare and contrast the crime data gathered from Seattle and San Francisco in this brief essay. In summary, we will track how the crimes in the two cities change over the course of a year. In order to determine which parts of the cities are more likely to see criminal activity, we will also map out the crimes that have been reported in the area.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusions&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Over the course of a year, Seattle commits significantly more crimes than San Francisco does. June, July, and August are the busiest months for crimes in both cities.&lt;/li&gt;
&lt;li&gt;The northeastern part of San Francisco is where most crime events occur. In Seattle, most crimes happen in the core area of the city, with small urban pockets hosting the majority of crime incidences.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The yearly variations in the crime statistics in Seattle are as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fusxv0j8iunt0zvozvsew.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fusxv0j8iunt0zvozvsew.png" alt="Image description" width="627" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The yearly variations in the crime cases in San Francisco are as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjtxo6adeneehfd9xdw29.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjtxo6adeneehfd9xdw29.png" alt="Image description" width="638" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The two charts above show that the months of June, July, and August are when crime peaks in both cities. In contrast to San Francisco, Seattle has a significantly higher number of crime cases, and from September to December, the city sees a sharp decline in the number of instances. San Francisco's data, however, does not indicate such a tendency. The fact that the dataset we utilized didn't have all of the information for San Francisco could be one explanation for the data gap.&lt;/p&gt;

&lt;p&gt;The following diagram illustrates the distribution of crime incidents across the areas of Seattle.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl07vssu8jeqqemzzr5de.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl07vssu8jeqqemzzr5de.png" alt="Image description" width="464" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The visualization above shows that the majority of crimes are recorded from Seattle's center metropolitan neighborhoods. In addition, there is a concentration of crime cases reported in little clusters that are divided by areas with lower crime case densities. This pattern lends credence to the theory that Seattle's densely populated metropolitan regions have a higher distribution of crime cases.&lt;br&gt;
The following illustration displays the crime cases reported across the city of San Francisco:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctiiw90ao516yjtymyz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctiiw90ao516yjtymyz0.png" alt="Image description" width="464" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The visualization indicates that the northeastern area of San Francisco reports the highest number of crime data. The visualization unequivocally demonstrates that the northeastern portion of San Francisco is more criminalized than the rest of the city, despite the fact that there are pockets of the city with moderately high reported crime rates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code for the exercise:&lt;/strong&gt;&lt;br&gt;
The following is the code that I used to generate these graphs. The code was written in R.&lt;br&gt;
require(googleVis)&lt;br&gt;
require(ggmap)&lt;br&gt;
sanfrancisco_dataset &amp;lt;- read.csv("sanfrancisco.csv")&lt;br&gt;
seattle_dataset &amp;lt;- read.csv("seattle.csv")&lt;br&gt;
seattle_dataset$Date.Reported &amp;lt;- as.Date(seattle_dataset$Date.Reported,"%Y/%m/%d")&lt;br&gt;
seattle_crime_count_date&amp;lt;-aggregate(seattle_dataset$Offense.Type,by=list(seattle_dataset$Date.Reported), FUN = length)&lt;br&gt;
names(seattle_crime_count_date) &amp;lt;- c("Date","Count")&lt;br&gt;
SeattleHeatMap &amp;lt;- gvisCalendar(seattle_crime_count_date,datevar = "Date",numvar = "Count",options=list(&lt;br&gt;
title="Calendar heat map of Crime cases in Seattle over the year",&lt;br&gt;
calendar="{cellSize:10,yearLabel:{fontSize:20, color:'#444444'},focusedCellColor:{stroke:'red'}}",width=590, height=320),chartid="Calendar")&lt;br&gt;
plot(SeattleHeatMap)&lt;br&gt;
sanfrancisco_dataset$Date &amp;lt;- as.Date(sanfrancisco_dataset$Date,"%Y/%m/%d")&lt;br&gt;
sanfrancisco_crime_count_date&amp;lt;-aggregate(sanfrancisco_dataset$IncidntNum, by = list(sanfrancisco_dataset$Date), FUN = length)&lt;br&gt;
names(sanfrancisco_crime_count_date) &amp;lt;- c("Date", "Count")&lt;br&gt;
SanFranciscoHeatMap &amp;lt;- gvisCalendar(sanfrancisco_crime_count_date,datevar = "Date",numvar = "Count",options=list(&lt;br&gt;
title="Calendar heat map of Crime cases in San Francisco over the year",&lt;br&gt;
calendar="{cellSize:10,yearLabel:{fontSize:20, color:'#444444'},focusedCellColor:{stroke:'red'}}",width=590, height=320),chartid="Calendar")&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Distributed Data and NoSQL</title>
      <dc:creator>MercyMburu</dc:creator>
      <pubDate>Mon, 12 Feb 2024 20:29:21 +0000</pubDate>
      <link>https://dev.to/mercykiria/distributed-data-and-nosql-4o3p</link>
      <guid>https://dev.to/mercykiria/distributed-data-and-nosql-4o3p</guid>
      <description>&lt;p&gt;Relational Databases are of huge help when it comes to analysis. Data is arranged in form of rows and columns and this in one or more tables or relations; Based on the relational model of data proposed by E.F. Codd in 1970.&lt;br&gt;
However with the rapid increasing growth of information like web transactions and machine-generated data, large-scale analytics(problems require finding meaningful patterns in data sets that are so large as to require leading-edge processing and storage capability), it is becoming hard to use just relational databases.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnyw8my4x5s2cbtoej677.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnyw8my4x5s2cbtoej677.jpg" alt="an relational database image from bing AI" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Components of a Relational Database System
&lt;/h2&gt;



&lt;ul&gt;
&lt;li&gt;Database management system software&lt;/li&gt;
&lt;li&gt;Physical servers on which software the loaded&lt;/li&gt;
&lt;li&gt;Disks where the data items are stored&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Imagine a scenario where more databases are coming in and more powerful servers are needed to process the large databases containing more data. Eventually a limit will be reached. &lt;br&gt;
Alternatively, cloud-based distributed processing takes a large volume of data and breaks it into pieces. Viola!! The solution to our storage problems ladies and gentlemen!🙌&lt;br&gt;
These small amounts of data are distributed among many computers in different locations. Basically, each computer has it's own task. However after processing, the data still has to be stored somewhere🤔. Another type of database is needed.&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/em&gt;: Relational databases still allow this kind of distribution but sometimes to really take advantage of this distribution or unstructured data, NoSQL database is needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;NoSQL and how it works&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;You should know:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A NoSQL database stores and accesses data differently that relational ones.&lt;/li&gt;
&lt;li&gt;NoSQL is sometimes called non-relational because it doesn't organize data into tables conforming to a structured schema. So data is stored in a non structured or semi-structured format that makes database design simpler.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are 4 main types of NoSQL databases&lt;br&gt;
&lt;strong&gt;&lt;u&gt;Key-value stores&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
This type stores just the key and its value and each key is unique. For example, storing all the contents of a shopping cart for one session on a online retail website. Also, a session ID that identifies all the activity of a single user during one session on a website. Remember it's still possible to do this on a relational database but key-value stores are optimized to store billions of these keys and are very efficient at retrieving the data quickly.The values of the keys can have a totally different structure from one key to another.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg58n5spwgl5kpek5cx9p.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg58n5spwgl5kpek5cx9p.jpg" alt="example of a key and value" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Document databases&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
Store documents in a machine readable format;JSON,XML. They aren't as efficient as relational databases when it comes to managing the relationships between documents but instead, are efficient when it comes to reading and searching them.&lt;br&gt;
The structure of one document doesn't need to be the same as the other documents'. Elements can therefore be easily added without needing to change any tables or schemas.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcquh3txzwte2x0n4i1jz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcquh3txzwte2x0n4i1jz.png" alt="An example photo of a document database from Cisco Networking Essentials Data Analytics course" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Graph Databases&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
These databases store nodes that are connected to other nodes in a network. An example of a node can be a user on social media who is connected to all other friends. Another example is points on a map that are connected in real life, so it's easy to find routes between them.&lt;br&gt;
Graph databases are optimized to query through these networks and navigate through the connections a lot faster and more efficiently than a relational database can join tables and find those relationships. They are designed to store huge amounts of interrelated nodes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8u9i9z6cpd5azwhbevlz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8u9i9z6cpd5azwhbevlz.png" alt="Example of a graph node database system" width="800" height="727"&gt;&lt;/a&gt;&lt;br&gt;
The image above is a fragment of a movies graph database, where we can see movie nodes(purple), person nodes(orange) and relationships between them(arrows).&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Wide column stores&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Store information in tables but the difference is that the columns are not attributes,they are values. Imagine a huge table from a streaming platform with a row for each user in the system and a column for each movie in the platform, where we record whether a user has watched that movie or not and some information about that viewing.To have a table like that in a relational database or in a flat file would be impossible when we are talking about millions or rows and columns. Most of those “cells” would be empty, because a user usually has just watched a few of the videos. These databases are designed to store these huge tables with “sparse” information in a very efficient way and retrieve it very quickly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important points to note&lt;/strong&gt; &lt;br&gt;
Relational databases are known for reliability, correctness, and version control, but NoSQL databases leave open many more possibilities for error and retrieving data that is not from the most recent version of the database. Something that needs to be considered when deciding to use a NoSQL solution.&lt;/p&gt;

&lt;p&gt;NoSQL is usually a good choice when there are large amounts of data that change frequently, or when working with flexible formats that don't fit into a relational database model. Common NoSQL database systems include MongoDB, Apache Cassandra, and Amazon DynamoDB.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The advantages and challenges of NoSQL databases as compared to relational databases are as follows:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Advantages:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Designed for large, unstructured datasets.&lt;/li&gt;
&lt;li&gt;Able to add new data that is structured differently than the data already in the database, which is not possible with flat files or RDBMS.&lt;/li&gt;
&lt;li&gt;Can scale quickly to support rapid data growth.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Challenges:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Validating input fields against existing data like SQL databases do is not possible.&lt;/li&gt;
&lt;li&gt;Temporal inconsistencies that allow for different versions to be confused.&lt;/li&gt;
&lt;li&gt;Less application support for NoSQL.&lt;/li&gt;
&lt;li&gt;No standardization of the ways to query the NoSQL databases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This article has been written with 🩶.&lt;br&gt;
Please feel free to add any comments pertaining more about NoSQL approach and literally any other random stuff🌝.&lt;/p&gt;

</description>
      <category>distributedsystems</category>
      <category>nosql</category>
      <category>sql</category>
      <category>programming</category>
    </item>
    <item>
      <title>Exploratory Data Analysis using Data Visualization Techniques.</title>
      <dc:creator>MercyMburu</dc:creator>
      <pubDate>Fri, 13 Oct 2023 20:07:17 +0000</pubDate>
      <link>https://dev.to/mercykiria/exploratory-data-analysis-using-data-visualization-techniques-3i3g</link>
      <guid>https://dev.to/mercykiria/exploratory-data-analysis-using-data-visualization-techniques-3i3g</guid>
      <description>&lt;p&gt;Happy to be here again. In today's article, two keywords in the title are going to be defined. Exploratory Data Analysis and Data Visualization. With an understanding of these and a sample project for the purposes of description, everything will be understood. I have discovered that Exploratory Data Analysis is a step that cannot be skipped in any Data Science project, whether one likes it or not.&lt;/p&gt;

&lt;h3&gt;
  
  
  Exploratory Data Analysis.
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Is the process of investigating a dataset in order to come up with summaries/hypothesis based on our understanding of the data, discovering patterns, detecting outliers and gaining insights through various techniques. Data visualization is one of them.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Visualization
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;A graphical representation of the information and the data.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Importance of Data Visualization
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;In the cleaning process, it helps identify incorrect data or missing values.&lt;/li&gt;
&lt;li&gt;The results can be interpreted and operated on because they become clear.&lt;/li&gt;
&lt;li&gt;Enables us to visualize stuff that cannot be observed by directly looking. Phenomenons like weather patterns and medical conditions. Also matematical relationships e.g when doing finance analysis.&lt;/li&gt;
&lt;li&gt;Helps us to construct and select variables. We can be able to choose which to discard and which to use.&lt;/li&gt;
&lt;li&gt;Bridge the gap between Technical and non-technical users by explaining figuratively what has been written in code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F37vn4t3gzd5h5gfgnbv8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F37vn4t3gzd5h5gfgnbv8.png" alt="A pictorial description of how visualized Data is convinient." width="500" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Knowing the different types of analysis for data visualization is an important additional concept.&lt;br&gt;
&lt;strong&gt;Univariate Analysis:&lt;/strong&gt;In this type, we analyze almost all the properties of only one feature.&lt;br&gt;
&lt;strong&gt;Bivariate Analysis&lt;/strong&gt;: In this one, analysis of properties is done for two features. We compare exactly two features.&lt;br&gt;
&lt;strong&gt;Multivariate Analysis:&lt;/strong&gt;Here, we compare more than two variables.&lt;br&gt;
Let's get right to it.&lt;/p&gt;
&lt;h3&gt;
  
  
  Import the necessary libraries
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;import numpy as np&lt;br&gt;
import matplotlib.pyplot as plt&lt;br&gt;
import pandas as pd&lt;br&gt;
%matplotlib inline&lt;br&gt;
import seaborn as sns&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Reading the data
&lt;/h3&gt;

&lt;p&gt;Step two is reading the data which is mostly in csv format. Using pandas library. &lt;a href="https://drive.google.com/file/d/1GWne7KfNmBLR6leU1yOcOg38bePW3VvW/view?usp=sharing"&gt;I used this dataset&lt;/a&gt;.&lt;br&gt;
&lt;code&gt;df = pd.read_csv('StudentsPerformance.csv')&lt;br&gt;
df.head()&lt;/code&gt; &lt;br&gt;
Our dataset looks like this after running df.head(), which outputs the first 5 rows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvj34hnwiwaevgti9s9gq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvj34hnwiwaevgti9s9gq.png" alt="Ouput after loading the dataset using pandas." width="800" height="163"&gt;&lt;/a&gt;&lt;br&gt;
You can easily tell just by looking at the dataset that it contains data about different students at a school/college, and their scores in 3 subjects. &lt;/p&gt;
&lt;h3&gt;
  
  
  Describe the Data
&lt;/h3&gt;

&lt;p&gt;After loading the dataset,the next step is to summarize the info and it's main characteristics. Consider it as a way to get summary statistics like the mean, the maximum, minimum values, the 25th percentile e.t.c of the different columns in a data frame.&lt;br&gt;
The output is something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6uwmvya8b22j2tls54zb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6uwmvya8b22j2tls54zb.png" alt="output of dataset description" width="393" height="267"&gt;&lt;/a&gt;&lt;br&gt;
 Please also note, if you want to include categorical features(features that have not been represented by numbers) also in your output, just run df.head(include='all').&lt;br&gt;
Now, in the output, count, unique and the most appearing values(top) have been filled. See below,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqfjjdae0fx7jvex59bx6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqfjjdae0fx7jvex59bx6.png" alt="Image description" width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Check for missing values
&lt;/h3&gt;

&lt;p&gt;Incase of any missing entries, it is advisable we fill them. For categorical features, with mode and for numerical features with median or mean. Run &lt;code&gt;df.isnull().sum()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkkuz0t1k07clrp8lwvy8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkkuz0t1k07clrp8lwvy8.png" alt="Output for missing entries" width="287" height="162"&gt;&lt;/a&gt;&lt;br&gt;
Phwyuuks!! We don't have any missing values.&lt;br&gt;
We can now proceed to observe any underlying patterns, analyze the data and identify any outliers using visual representations. I loooovee this part. Let's do it!&lt;/p&gt;
&lt;h2&gt;
  
  
  Graphs
&lt;/h2&gt;

&lt;p&gt;Remember the three types of analysis we mentioned before? Let's look at them. We'll start with Univariate analysis. A bar graph. Look at the distribution of the students across gender, race, their lunch status and whether they have a course to prepare for or not.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;plt.subplot(221)
df['gender'].value_counts().plot(kind='bar', title='Gender of students', figsize=(16,9))
plt.subplot(222)

df['race/ethnicity'].value_counts().plot(kind='bar', title='Race/ethnicity of students')

plt.xticks(rotation=0)

plt.subplot(223)

df['lunch'].value_counts().plot(kind='bar', title='Lunch status of students')

plt.xticks(rotation=0)

plt.subplot(224)

df['test preparation course'].value_counts().plot(kind='bar', title='Test preparation course')

plt.xticks(rotation=0)

plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5smtqasutkuaas8dlp3v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5smtqasutkuaas8dlp3v.png" alt="graph output" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can conclude a lot of information. For instance, &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There are more girls that boys. &lt;/li&gt;
&lt;li&gt;The majority of students belong to race groups C and D.&lt;/li&gt;
&lt;li&gt;More than 60% of the students have a standard lunch.&lt;/li&gt;
&lt;li&gt;More than 60% of the students have not taken any test preparation course.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, lets look at univariate analysis and use a boxplot. A boxplot helps us in visualizing the data in terms of quartiles. Numerical columns are visualized very well with boxplots. We use function &lt;code&gt;df.boxplot()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbnkpo4n4lggo2jouaoip.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbnkpo4n4lggo2jouaoip.png" alt="Output boxplot" width="536" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgb71tespsivawjf4v7c1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgb71tespsivawjf4v7c1.png" alt="Boxplot" width="300" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The horizontal green line in the middle represents the median of the data. &lt;/li&gt;
&lt;li&gt;The hollow circles near the tails represent outliers in the dataset.&lt;/li&gt;
&lt;li&gt;The middle portion represents the inter-quartile range(IQR)
From those points, we conclude that a box plots show the distribution of data. How far is our middle value data dispersed or spread. So lets plot some distribution plots to see. We'll start with the math score.
&lt;code&gt;sns.distplot(df['math score'])&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F740nwligef3g16l0x2gz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F740nwligef3g16l0x2gz.png" alt="Mathscore distribution plot" width="579" height="389"&gt;&lt;/a&gt;&lt;br&gt;
Well, the tip of the curve is at around 65 marks, the mean of the math score of the students in the dataset. We can make for the reading score and the writing score.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2zychryt6ht6a3f745b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2zychryt6ht6a3f745b.png" alt="Reading score distribution plot" width="537" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For our reading score curve, it's not a perfect bell curve. We conclude that the mean of the reading score is at around 72 marks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fno4teim5ywcikfdzem69.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fno4teim5ywcikfdzem69.png" alt="Writing score distribution plot" width="543" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For our writing score, it's also not a perfect bell curve. The mean of the writing score is at around 70 marks.
So far so good, right?
One more thing, let's look at the correlation between the three scores by use of a heatmap. Correlation basically means looking at the linear relationship between variables. If one variable changes, how does that affect the other?
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;corr = df.corr()
sns.heatmap(corr, annot=True, square=True)
plt.yticks(rotation=0)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3s8flr4jdiu5jbi1tss0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3s8flr4jdiu5jbi1tss0.png" alt="Heatmap or the three variables" width="544" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The 3 scores are highly correlated.&lt;/li&gt;
&lt;li&gt;Reading score has a correlation coefficient of 0.95 with the writing score. Math score has a correlation coefficient of 0.82 with the reading score.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Bivariate analysis:&lt;/strong&gt;Understand the relationship between 2 variables on different subsets of the dataset. We can try to understand the relationship between the math score and the writing score of students of different genders.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sns.relplot(x='math score', y='writing score', hue='gender', data=df)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;``&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flz26vdmoa4xnpgc7mefe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flz26vdmoa4xnpgc7mefe.png" alt="Image description" width="553" height="445"&gt;&lt;/a&gt;&lt;br&gt;
The graph shows a clear difference in scores between the male and female students.For the math score, female students are more likely to have a higher writing score than male students. For writing score, male students are expected to have a higher math score than female students.&lt;br&gt;
Finally,let’s look at the impact of the test preparation course on students’ performance using a horizontal bar graph.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2vm2tbl5g0x1o5mxhce.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2vm2tbl5g0x1o5mxhce.png" alt="Image description" width="800" height="391"&gt;&lt;/a&gt;&lt;br&gt;
It is very evident that students who completed the test preparation course perfomed better than those who didn't.&lt;br&gt;
That's the end Guys. &lt;br&gt;
Thank you for following through. &lt;br&gt;
YOU CAN DO IT!&lt;/p&gt;

</description>
      <category>visualization</category>
      <category>datascience</category>
      <category>luxdev</category>
      <category>luxdatanerds</category>
    </item>
    <item>
      <title>Data Science for Beginners: 2023–2024 Complete Roadmap.</title>
      <dc:creator>MercyMburu</dc:creator>
      <pubDate>Mon, 02 Oct 2023 08:20:25 +0000</pubDate>
      <link>https://dev.to/mercykiria/data-science-for-beginners-2023-2024-complete-roadmap-3ge7</link>
      <guid>https://dev.to/mercykiria/data-science-for-beginners-2023-2024-complete-roadmap-3ge7</guid>
      <description>&lt;p&gt;In a recent EastAfrican datascience bootcamp, a speaker asked attendants in a google meeting, what had initially piqued their interest in data science. One lady raised their hand and answered, ”Uhm..because data is the new gold.” Was she right? Yes! A huge yes. &lt;br&gt;
Data Science is such a driving force behind a majority of innovations in the world today due to its ability to extract valuable insights from datasets and make informed decisions that aid in problem solving. Furthermore, according to a Business Havard Review, the role ‘Data Scientist’ is the ‘The Sexiest Job in the 21st century’.&lt;br&gt;
It is also a field that continues to evolve everyday and one must keep up with the latest news and trends. That is why a roadmap is important.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fktvbx0fxbei7j26p8yi5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fktvbx0fxbei7j26p8yi5.jpg" alt="An image showing various terms in data science"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Data Science?
&lt;/h2&gt;

&lt;p&gt;It is the science of analyzing raw data using statistics and machine learning techniques with the purpose of drawing conclusions about that information.&lt;/p&gt;

&lt;p&gt;Usually, data scientists come from various educational and work experience backgrounds, most should be proficient in:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Domain Knowledge:- Take for instance you want to be one in the bank sector knowing about finance, insurance , credit risks e.t.c will be important information when drawing conclusions and tackling problems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mathematical Skills:- Linear Algebra, Calculus, probability and Statistics help us in understanding algorithms and perform data analysis.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Communication skills:- It includes both written and verbal communication. Data Science involves some form of communication of project findings.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Roadmap
&lt;/h2&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fknu3b2lmqusow0whcsn1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fknu3b2lmqusow0whcsn1.png" alt="A graphical representation of the roadmap"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Mathematics
&lt;/h2&gt;

&lt;p&gt;In data science, statistics is essential. It provides one with mathematical ideas necessary for conducting hypothesis testing and data analysis, as well as for making decisions based on the given data. Some significant applications of statistics in data science are listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data scientists can quickly summarize and define a dataset’s characteristics by using descriptive statistics. Included in this are statistics like mean (average), median (middle value), mode (most frequent value), variance (spread), and standard deviation (average deviation from the mean). For a basic understanding of the data, descriptive statistics are helpful.&lt;/li&gt;
&lt;li&gt;Making assumptions or projections about a population based on a sample of data is known as inferential statistics. Regression analysis, confidence intervals, and hypothesis testing are some of the methods used in this.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Probability theory is crucial in data science for modeling uncertainty and randomness. It’s used in various applications, such as Bayesian statistics for machine learning. Others : Linear Algebra, Vector Calculus&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Programming Skills
&lt;/h2&gt;

&lt;p&gt;The most recommended languages are R and Python. While R is not mandatory, it is valuable for statisticians.&lt;/p&gt;

&lt;p&gt;In python, familiarize yourself with numpy, pandas, matplotlib, visualization and analysis. Object oriented and procedure oriented python exercises will improve your mastery. Python offers several built-in data structures like lists and tuples that allow you to store and manipulate data efficiently.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Structured Query Language(SQL)
&lt;/h2&gt;

&lt;p&gt;It plays a crucial role in data science, particularly in the context of working with structured data stored in relational databases. It is useful in :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Data Cleaning&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Retrieval&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;3.Data Aggregation&lt;br&gt;
Can be found &lt;a href="https://www.kaggle.com/learn/intro-to-sql" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Data Visualization
&lt;/h2&gt;

&lt;p&gt;Understand the principles of data visualization and storytelling with data. Tools like Matplotlib, Seaborn, and Tableau can help you create compelling visuals.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.  Machine learning concepts
&lt;/h2&gt;

&lt;p&gt;One at least needs to understand basic algorithms of Supervised and Unsupervised Learning. There are multiple libraries available in Python and R for implementing these algorithms. &lt;a href="https://www.kaggle.com/learn" rel="noopener noreferrer"&gt;Kaggle Machine learning&lt;/a&gt; courses are very helpful here.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Practice pratice practice!
&lt;/h2&gt;

&lt;p&gt;In the process of doing this, create repositories for your work and track your progress. Collaborate on projects, network with like-minded people, share your insights on social media and engage in discussions.&lt;/p&gt;

&lt;p&gt;Don't forget to refer to a graphical roadmap above .&lt;br&gt;
All the best!&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
