<?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: Nick Kimani</title>
    <description>The latest articles on DEV Community by Nick Kimani (@nickkimani).</description>
    <link>https://dev.to/nickkimani</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%2F1177181%2F033d42f7-f9ca-4cb2-8713-3603860d4f7e.jpeg</url>
      <title>DEV Community: Nick Kimani</title>
      <link>https://dev.to/nickkimani</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nickkimani"/>
    <language>en</language>
    <item>
      <title>The Complete Guide To Time Series Models</title>
      <dc:creator>Nick Kimani</dc:creator>
      <pubDate>Thu, 02 Nov 2023 19:01:33 +0000</pubDate>
      <link>https://dev.to/nickkimani/the-complete-guide-to-time-series-models-5elk</link>
      <guid>https://dev.to/nickkimani/the-complete-guide-to-time-series-models-5elk</guid>
      <description>&lt;p&gt;You might be wondering, what are time series models? These are models built leveraging time series data. There are a variety of time series models to choose from, ranging from simple models like Autoregressive (AR) time series models to deep learning time series models like Recurrent Neural Networks (RNN). &lt;/p&gt;

&lt;p&gt;However, time series modelling doesn't only start at that, there are steps leading to it. This whole process is called Time Series Analysis.&lt;/p&gt;

&lt;p&gt;And what are the possible benefits of conducting time series analysis?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You can identify trends and seasonality in data which may not have been as obvious. From this you can gain valuable insights as a business that help in decision making such as marketing. &lt;/li&gt;
&lt;li&gt;Forcasting future events. From analysis and creating models you can predict future values. For example predicting the GDP of a nation from previous GDP values of the nation. &lt;/li&gt;
&lt;li&gt;It can aid in identifying relationships between variables over time. For example identifying the postive relationship of labor, gross enrollment ratio and development over time for a country like Kenya.&lt;/li&gt;
&lt;li&gt;By viewing trends and distribution of variabes over time, it is more convinient to observe anomalies in organizations. This could be relevant in fraud detection or failure of machines or amenities.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this article, I will take you through the steps involved in time series analysis.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Where to source data?
&lt;/h2&gt;

&lt;p&gt;When it comes to time series analysis, the data used has to be indexed by a time dimension. This means that the data has to be recorded in a temporal way, whether every minute, hour or day etc. Because of this the data is commonly referred to as time series.&lt;/p&gt;

&lt;p&gt;An important point to note is that no missing values should be present in the data being used for time series analysis. This is to ensure that the trend observed on the data is as accurate as possible. &lt;/p&gt;

&lt;h2&gt;
  
  
  2. What should be the nature of the data?
&lt;/h2&gt;

&lt;p&gt;Data used in time series analysis should be stationary. And what does it mean for data to be stationary? When observations at given points in time in our data are not affected by the points preceeding it in any way, the data is said to be stationaty. This means that said data has no:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trend&lt;/li&gt;
&lt;li&gt;Drift&lt;/li&gt;
&lt;li&gt;Seasonality&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Cyclicality &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NB:&lt;/strong&gt; As much as the data used needs some 'predictability' removed, extreme randomness in the data is still not suitable. Meaning that data with random walks cannot be used for time series analysis. Afterall, the whole purpose of a time series model is to predict values right? :&amp;gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because stationarity is a major consideration when using data, it is important to diagnose the data early. Luckily there are tests to ease our decision making. The most popular test is the Augmented Dickey Fuller (ADF) test. This test has the null hypothesis that there is an existence of a unit root (non stationarity) in the time series against the alternative that the time series is stationary.&lt;/p&gt;

&lt;p&gt;If the data is found to be stationary, then you can proceed with your analysis comfortably. However, if it is not stationary, there is no need to worry, there are ways to transform the time series to stationary. &lt;/p&gt;

&lt;h3&gt;
  
  
  1. Differencing the data points.
&lt;/h3&gt;

&lt;p&gt;This is done by taking the difference between n-lag points. For example: &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a 1st lag differnce would be x(t) - x(t-1) 
a 2nd lad differnce would be x(t) - x(t-2)
................................................................
a nth lag difference would be x(t) - x(t-n)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  2. Log-transforming
&lt;/h3&gt;

&lt;p&gt;This is done by log teansforming all datapoints in the time series. &lt;br&gt;
    From x to ln(x)&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Seasonal decomposition
&lt;/h3&gt;

&lt;p&gt;This invloves identifying trends and seasonality in data. After that the trend can be removed from the data to make it stationary.&lt;/p&gt;

&lt;p&gt;After applying one of these methods your time series should be stationary and ready for modelling.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Identifying the autoregressive (p) and moving average (q) lags for the models.
&lt;/h2&gt;

&lt;p&gt;As discussed earlier, there are a variety of time series models to choose from. Moving average (MA) and autoregressive (AR) models can be considered as foundational in time esries analysis. Whne building such models we look for the best moving average and autoregressive lags to use. We do this by the help of functions. Namely the Autocorrelation (ACF) and partial autocorrelation (PACF) functions. The 'p' in AR models is determined from the PACF function while the 'q' in MA models is obtained from the ACF function. &lt;a href="https://www.baeldung.com/cs/acf-pacf-plots-arma-modeling"&gt;More resources on this&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In the case where an ARIMA model is being used, an 'i' parameter will be inrtoduced, similar to 'p' and 'q'. This 'i' stands for intergration and is the value for differencing applied to the data to make it stationary. So 1 for a 1st lag differenced, 2 for a 2nd lag differenced and so on and so forth. &lt;/p&gt;
&lt;h2&gt;
  
  
  4. Building the model
&lt;/h2&gt;

&lt;p&gt;Now that all necessary parameters are ready, all that is left is to chose what model is suitable for your problem. The basic models are AR and MA models. If you want to move your model performance futher you can apply the ARMA model which is a combination of both AR and MA models. ARIMA models are also a combination of AR and MA models however an 'intergrated' parameter is introduced and the beauty of it is that the data used for ARIMA models can be non-stationary.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**NB:** The non-stationarity in the data for ARIMA models should only be due to unit root as the model cannot deal with other causes of non-stationarity.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I hope from this you have gotten an idea of what time series modelling is and how to do it.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Exploratory Data Analysis using Data Visualization Techniques</title>
      <dc:creator>Nick Kimani</dc:creator>
      <pubDate>Fri, 13 Oct 2023 11:24:16 +0000</pubDate>
      <link>https://dev.to/nickkimani/exploratory-data-analysis-using-data-visualization-techniques-263h</link>
      <guid>https://dev.to/nickkimani/exploratory-data-analysis-using-data-visualization-techniques-263h</guid>
      <description>&lt;p&gt;Data is everywhere in this new age. However, data cannot make sense of itself. This aspect is what leads us to Exploratory data analysis (EDA).&lt;/p&gt;

&lt;p&gt;EDA is the method by which we can make sense of data. It involves analysing data to gain insights, and identify relationships and patterns. By performing EDA an individual can detect outliers and anomalies, view distributions of data e.g. sales per region, detect trends and come up with insights useful to stakeholders. &lt;/p&gt;

&lt;p&gt;EDA involves the use of certain visualization techniques implemented by various tools. &lt;/p&gt;

&lt;h2&gt;
  
  
  Visualization Tools for EDA
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt; - Python is an object oriented programming language popularly used in data analysis. Within python, there are a number of libraries dedicated to data visualization.&lt;br&gt;
They include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maplotlib&lt;/li&gt;
&lt;li&gt;Seaborn&lt;/li&gt;
&lt;li&gt;Plotly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is how to import them to your script or notebook:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FKGQ-nvL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gi6eieksu0skl68fpk3g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FKGQ-nvL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gi6eieksu0skl68fpk3g.png" alt="Importing Libraries" width="626" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;To note&lt;/em&gt;: Plotly creates interactive visualizations whereas the other 2 create static visualizations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Visualization Softwares&lt;/strong&gt; - These are softwares fully dedicated to data visualization and analysis tasks.&lt;br&gt;
They include: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tableau&lt;/li&gt;
&lt;li&gt;PowerBI&lt;/li&gt;
&lt;li&gt;Qlik&lt;/li&gt;
&lt;li&gt;Plotly&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Visualization Techniques for EDA
&lt;/h2&gt;

&lt;p&gt;In this section we look at the popular visualization techniques (Plots &amp;amp; Graphs) for performing EDA. All of the techniques discussed can be implemented in any of the tools mentioned above.&lt;/p&gt;

&lt;p&gt;Before that it is important to know the different types of data:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Categorical data&lt;/li&gt;
&lt;li&gt;Continuous data&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Bar Graphs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is a way of visualizing categorical data usually with rectangular bars of different heights or lengths that depict the size of a category. It is used for scenarios such as comparing the sales per city or per product. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uOQ1GJl8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/thpdqbwox3atx24yvsty.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uOQ1GJl8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/thpdqbwox3atx24yvsty.png" alt="Bar Graph" width="800" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pie Charts&lt;/strong&gt;&lt;br&gt;
Just as the bar graph, this is also used for comparing categorical data. It is a circle, to which proportions are assigned to categories based on their size in relation to the whole data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tZnF4-E8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ei5056earr437g6rcvec.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tZnF4-E8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ei5056earr437g6rcvec.png" alt="Pie Chart" width="750" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Histograms&lt;/strong&gt;&lt;br&gt;
It is used for checking the distribution of continuous data such as sales, profits, e.t.c.. It can be viewed as the equivalent of bar graphs but for continuous data. This is because it groups the data into ranges, called bins, and displays the total count of records in each bin as bars.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7uKMzJ3Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a7ky7jdtvg27ic1cgn06.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7uKMzJ3Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a7ky7jdtvg27ic1cgn06.png" alt="Histogram" width="700" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Box and Whisker plots&lt;/strong&gt;&lt;br&gt;
This is used to check the distribution of continuous data, it is more popular for its usefulness in detecting outliers. The 'box' displays the 1st, 2nd(median) and 3rd quartiles. The endpoints of the whiskers are &lt;em&gt;1.5*Interquartile range (+3rd quartile OR -1st quartile)&lt;/em&gt;. Any records beyond the whiskers are considered to be outliers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7JEf0au2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hl0pfxo3ls08jklww3m9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7JEf0au2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hl0pfxo3ls08jklww3m9.png" alt="Box and Whisker" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scatterplots&lt;/strong&gt;&lt;br&gt;
They are used in bivariate analysis in checking whether two variables could have a correlation to each other. They are typically used with continuous data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k-8OsBUv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/trfg7ph90vfa1h4dfrn4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k-8OsBUv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/trfg7ph90vfa1h4dfrn4.png" alt="Scatterplot" width="730" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;For example&lt;/em&gt;: The figure on the left shows that the two variables are likely to have a high positive correlation. Whereas the figure on the right shows that there is a low possibility of correlation between the variables. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wordcloud&lt;/strong&gt;&lt;br&gt;
It is a technique of visualizing text data. The size of the word is dictated by the frequency of the word, with large words signifying high frequency. It is popular in analysis for comments or sentiment analysis. &lt;br&gt;
For example a teleco company seeking to find out what its customers think about their products.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AclU8OM9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6cb5smozw90i8ekp5cz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AclU8OM9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6cb5smozw90i8ekp5cz.png" alt="Wordcloud" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Correlation Matrix&lt;/strong&gt;&lt;br&gt;
This is a type of heatmap visualization that uses correlation values between variables in data to determine the 'heatcolor' to assign to a relationship between variables. It is useful in finding patterns and relationships in large datasets as it saves on the time that would have been used to inspect the variable relationships individually.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bbSc50QO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ns9h3v6tyh38n11zpp2d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bbSc50QO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ns9h3v6tyh38n11zpp2d.png" alt="Correlation Matrix" width="800" height="677"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Exploratory data analysis (EDA) is an important aspect in making sense of data and extracting valuable and actionable insights from it. The good news is that there are a myriad of ways to perform EDA, from the tools to use, to the techniques. It is important to understand the use cases of the various techniques and because applying them to unsuitable cases would lead to errors in interpretation or illogical visualizations.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>datascience</category>
      <category>dataanalysis</category>
    </item>
    <item>
      <title>Data Science for Beginners: 2023 - 2024 Road Map.</title>
      <dc:creator>Nick Kimani</dc:creator>
      <pubDate>Wed, 04 Oct 2023 20:14:47 +0000</pubDate>
      <link>https://dev.to/nickkimani/data-science-for-beginners-2023-2024-road-map-4jkg</link>
      <guid>https://dev.to/nickkimani/data-science-for-beginners-2023-2024-road-map-4jkg</guid>
      <description>&lt;h1&gt;
  
  
  &lt;strong&gt;Guide to starting a career in datascience&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v87aYY4V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4r72mxnf3fx7fy3kbuj0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v87aYY4V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4r72mxnf3fx7fy3kbuj0.png" alt="Roadmap Picture" width="281" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Get familiar with the basics.
&lt;/h2&gt;

&lt;p&gt;There are a lot of tools used in data science. However there are some fundamentals needed. You would need to get familiar with statistics, calculus, linear algebra, an object oriented programming language of choice (Python, R or Java) and Structured Query Language.&lt;/p&gt;

&lt;h2&gt;
  
  
  Apply the basics.
&lt;/h2&gt;

&lt;p&gt;It is one thing to read/know about something and another to put it n practice. The next step would be to learn and actively apply the tools you've gotten familiar with, learn their use cases and methods of application. This would be in the form of data analysis, data visualization, and/or data cleaning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn Intermediate datascience concepts.
&lt;/h2&gt;

&lt;p&gt;You should familiarize yourself with concepts such as machine learning, processing leading to machine learning and the do's and don'ts. Learn how to preprocess and create machine learning algorithms/models, improve created models by hyperparameter tuning and/or selecting important or relevant features for the models. &lt;/p&gt;

&lt;h2&gt;
  
  
  Participate in competitions or learning forums.
&lt;/h2&gt;

&lt;p&gt;Sites such as Kaggle, Zindi and others hold various competitions which are a good platform to polish your acquired skills and also identify areas of improvement. &lt;/p&gt;

&lt;h2&gt;
  
  
  Learn advanced datascience concepts
&lt;/h2&gt;

&lt;p&gt;You would need to learn advanced machine learning techniques. These include, deep learning techniques, computer vision, natural language processing(NLP), keras and cloud computing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep Learning!
&lt;/h2&gt;

&lt;p&gt;The data field is always growing, you should join data communities and platforms not only for networking (which is important) but for keeping in touch with the current trends in order to keep your skills on toes. These communities can be found on Kaggle, Zindi, LinkedIn, and Twitter.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Godspeed on your data science journey!!&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

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