<?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: Thatohatsi Matshidiso Tilodi</title>
    <description>The latest articles on DEV Community by Thatohatsi Matshidiso Tilodi (@thatohatsi880).</description>
    <link>https://dev.to/thatohatsi880</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%2F1403713%2F41ce8811-d8b3-45f3-90ef-2d21648fee6f.jpeg</url>
      <title>DEV Community: Thatohatsi Matshidiso Tilodi</title>
      <link>https://dev.to/thatohatsi880</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thatohatsi880"/>
    <language>en</language>
    <item>
      <title>Mastering System Analysis and Architecture: A Comprehensive Guide</title>
      <dc:creator>Thatohatsi Matshidiso Tilodi</dc:creator>
      <pubDate>Sun, 02 Mar 2025 21:16:16 +0000</pubDate>
      <link>https://dev.to/thatohatsi880/mastering-system-analysis-and-architecture-a-comprehensive-guide-86a</link>
      <guid>https://dev.to/thatohatsi880/mastering-system-analysis-and-architecture-a-comprehensive-guide-86a</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.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%2Fxeql5e7kl2ytjp0mbn0i.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fxeql5e7kl2ytjp0mbn0i.gif" alt="Image description" width="280" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;System Analysis and Design?&lt;/h1&gt;

&lt;p&gt;System Analysis and Design has to do with studying and examining the existing system in order to understand the problems it might contain so to be able to create a better tech solution for it. &lt;/p&gt;

&lt;p&gt;Its like  you building a new system for a school that works better than the old one. This strategy is more efficient in a way that it uses a user-friendly way to help meet the needs of everyone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There are mainly two parts involved in it:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There is the system analysis which requires one to   examine who things look now and then see what is good and bad. Also engage with the users whether through observation or communicating with them to find out the needs and wants from the new system itself.&lt;/p&gt;

&lt;p&gt;The other part is the system design which firstly requires one to outline the blueprint that is examining the requirements you collected from the analysis phase then based on those plan out how you going to make the new system work. Secondly would be a break down of the system, into smaller components so to be able to study them individually on how they would interact with one another.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h1&gt;Software Development Life Cycle (SDLC)&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Famn8b43iyzkofufs6xda.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Famn8b43iyzkofufs6xda.png" alt="Image description" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Software Development Life Cycle is a structured process that is divided into four stages. Namely &lt;strong&gt;planning, creating, testing and deploying.&lt;/strong&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;Planning:&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fnrvcve03q3z5vs5ahjbr.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fnrvcve03q3z5vs5ahjbr.gif" alt="Image description" width="440" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Planning&lt;/strong&gt; deals with listing down the goals, scope and feasibility of the project. So say for instance, you want to plan on building a new mobile application, you first decide what it will do, who will be the target audiences and the amount of finances and time it will consume for you to develop it.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;Analysis:&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ft73h19ihztuebekulrpl.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ft73h19ihztuebekulrpl.gif" alt="Image description" width="372" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Secondly would be &lt;strong&gt;analysis&lt;/strong&gt; where you would gather up what is required and study the system you are currently busy with. So if we were to put in a scenario of the mobile application, this is the part where you engage with the potential users through interviews to try and understand their needs and what they would prefer. You also try look at othet mobile applications that operate similarily to the one you ought to build and compare so you be able to see what works and what doesn't.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;Design:&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fd1koojpkkia7z8kgqizq.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fd1koojpkkia7z8kgqizq.gif" alt="Image description" width="498" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of my favorite parts of the system development  life cycle is the &lt;strong&gt;design&lt;/strong&gt; phase where you design the system through means of creating these technical specification. Say with the web application this is basically where you design the database and then choose on which technology stack you will be utilizing for this part of development phase.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;Implementation:&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F6lh842wlwsjrh6dw1cu3.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F6lh842wlwsjrh6dw1cu3.gif" alt="Image description" width="498" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;implementation&lt;/strong&gt; phase is basically involves coding and integrating the system. So with the web application this is where developers start being in action and they build backend, fontend and database and once you done building them individually, you integrate them together. &lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;Testing:&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fn8iq3ilvqd3tuxwkb0pt.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fn8iq3ilvqd3tuxwkb0pt.gif" alt="Image description" width="498" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;testing&lt;/strong&gt; phase simply makes sure that the system works as intended. This is where we check if there aren't any issues or bugs contained in the application. To make sure that everything works smoothly and accordingly, the developers test the performance, features, and interaction of the user.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;Deployment:&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fsyc5t1tszf4sml0756e7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fsyc5t1tszf4sml0756e7.gif" alt="Image description" width="480" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deployment&lt;/strong&gt; is all about releasing the system for usage. This is when the application is published on platforms like Heroku, the Apple App Store, or Google Play and can be downloaded.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;Maintanance:&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fabp4w6bdgwf7tpfh7ky7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fabp4w6bdgwf7tpfh7ky7.gif" alt="Image description" width="498" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maintaining&lt;/strong&gt; the system has to do with scanning through the system and seeing if there aren't any bugs after deployment. If there are bugs, then we fix the bugs and update the available features on the system. In the scenario of software application development, this is the last phase where developers continue to monitor the performance of the system. They also continuously improve the application by means of adding new features, releasing updates to help fix the bugs and improving more on the user experience.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;There are also 3 different types of models that fall under the Software Development Life Cycle:&lt;/h3&gt;



&lt;h3&gt;The Waterfall Model:&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F8abjx8mslihgxeyqf9g2.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F8abjx8mslihgxeyqf9g2.gif" alt="Image description" width="498" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The steps included under the waterfall model are requirement, design, implementation, testing, deployment and maintenance.&lt;/p&gt;

&lt;p&gt;Practical example would be that of the above of building a house. You first gather what is needed to building the house like the deign, the number of rooms, the size of the house and then draw that on your architectural plan of it. What then follows is constructing the architectural design step by step, from outlining the base to completing the inside parts of the house. Once all completed, people can move into it and start utilizing it.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;The Iterative Model:&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fmyhnfr2tsvasit7pbop6.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fmyhnfr2tsvasit7pbop6.gif" alt="Image description" width="498" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This model basically structures the system in an incremental format as it allows for revision based on user's feedback at each stage to take place.&lt;/p&gt;

&lt;p&gt;Like this model deals with collecting feedback from users so to be able to improve on the system, like say for instance you are building an e-commerce website. Obviously you will start with a very simple product catalog and then start gathering feedback from the users. From the feedback you are able to implement a lot such as adding the user's account and a search functionality and then combining the two options. Each step will improve based on user's input.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;The Agile Model:&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fo48q7rmun2gu3wsvt9d1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fo48q7rmun2gu3wsvt9d1.gif" alt="Image description" width="498" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This model basically concentrates on iterative progress, flexibility, and collaboration through frequent releases.&lt;/p&gt;

&lt;p&gt;An example would be creating a new social media application and making sure it evolves to meet the needs of the users through means of working closely with the developers and designers, keeping up intact with the new releases and versions of the app, and adding the features and improvements.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;There are also three diagram I recently learned about and those are &lt;strong&gt;Use Case diagrams, Entity-Relationship Diagrams and the Data Flow Diagrams.&lt;/strong&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;Use Case Diagram:&lt;/h2&gt;

&lt;p&gt;So with the Use case diagram, it visually shows how the user iteracts with the system. So basically the &lt;strong&gt;actors are the users&lt;/strong&gt; and different &lt;strong&gt;actions are the use cases.&lt;/strong&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Below is basically an example one would see when a person interacts with an online ordering system&lt;/strong&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.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%2F9rdc3xpirp3q8xzlbeqy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F9rdc3xpirp3q8xzlbeqy.png" alt="Image description" width="800" height="707"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Actors&lt;/strong&gt; are basically your delivery guy, admin and customer and then &lt;strong&gt;use cases&lt;/strong&gt; are basically processes of  placing the order, making payment, managing menu, assigning delivery and placing order.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;Entity Relationship Diagram:&lt;/h2&gt;

&lt;p&gt;The next one is the entity relationship diagram which visually show the relationships and data in a system. So basically this helps one understand how the database is organized and structured.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Fm3s5w10pmlsba1cnl8hm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fm3s5w10pmlsba1cnl8hm.png" alt="Image description" width="800" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Entities&lt;/strong&gt; is the order and customer. &lt;strong&gt;Attributes&lt;/strong&gt; on the other hand are basically the properties which in this instance is the Customer's name and order ID and lastly is the &lt;strong&gt;relationships component&lt;/strong&gt; which shows the  interaction between entities and in this instance that is managers and places.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt; Data Flow Diagram:&lt;/h2&gt;

&lt;p&gt;The last one is definitely the Data Flow Diagram(DFD) is simply a diagram that shows how data flows in a system.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Fhwozhco60cd2c2qs8jm1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhwozhco60cd2c2qs8jm1.png" alt="Image description" width="800" height="537"&gt;&lt;/a&gt;&lt;br&gt;
This in terms of the food ordering scenario, is divided into &lt;strong&gt;four parts.&lt;/strong&gt; &lt;strong&gt;First being processes that includes the update order status component, view menu component, place order, make payment and assign delivery.&lt;/strong&gt;&lt;br&gt;
Another one that follows is the &lt;strong&gt;data stores&lt;/strong&gt; that is basically deals with payment records, menu database and order database. Another one would be &lt;strong&gt;extenal entities&lt;/strong&gt; like delivery person, customer, payment gateway and admin. The last component is the data flows which shows that the customer sending order details to order database, order database updates order status, payment gateway processes payment, delivery person receives delivery assignment.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;Any Thoughts?&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fkpha4pl27onbr78nz8em.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fkpha4pl27onbr78nz8em.gif" alt="Image description" width="498" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My journey to learning all about system design and architecture continues, and if you have read till this far, please let me know what you think in the commentary section. Thank you!😊&lt;/p&gt;

</description>
      <category>database</category>
      <category>sql</category>
      <category>design</category>
      <category>architecture</category>
    </item>
    <item>
      <title>House_Price_Prediction</title>
      <dc:creator>Thatohatsi Matshidiso Tilodi</dc:creator>
      <pubDate>Sat, 02 Nov 2024 16:09:18 +0000</pubDate>
      <link>https://dev.to/thatohatsi880/housepriceprediction-3ldg</link>
      <guid>https://dev.to/thatohatsi880/housepriceprediction-3ldg</guid>
      <description>&lt;p&gt;In the world of real estate, determining property prices involves numerous factors, from location and size to amenities and market trends. Simple linear regression, a foundational technique in machine learning, provides a practical way to predict housing prices based on key features like the number of rooms or square footage. &lt;/p&gt;

&lt;p&gt;In this article, I delve into the process of applying simple linear regression to a housing dataset, from data preprocessing and feature selection to building a model that can offer valuable price insights. Whether you’re new to data science or seeking to deepen your understanding, this project serves as a hands-on exploration of how data-driven predictions can shape smarter real estate decisions.&lt;/p&gt;

&lt;p&gt;First things first, you start by importing your libraries:&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
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Read from the directory where you stored the data

data  = pd.read_csv('/kaggle/input/california-housing-prices/housing.csv')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fpa1uifx6x02p9hmsrle9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fpa1uifx6x02p9hmsrle9.png" alt="Image description" width="800" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fxcpwjzq3qdu34036h0qy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fxcpwjzq3qdu34036h0qy.png" alt="Image description" width="800" height="550"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Test to see if there arent any null values
data.info()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fl2xrpkv85m5bo18lrjv6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fl2xrpkv85m5bo18lrjv6.png" alt="Image description" width="586" height="472"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Trying to draw the same number of null values
data.dropna(inplace = True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data.info()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fdr2aux5twtary76cfiyb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fdr2aux5twtary76cfiyb.png" alt="Image description" width="556" height="470"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#From our data, we are going to train and test our data

from sklearn.model_selection import train_test_split

X = data.drop(['median_house_value'], axis = 1)
y = data['median_house_value']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fmj3ek68bs9mpwespnzm5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fmj3ek68bs9mpwespnzm5.png" alt="Image description" width="612" height="307"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Examining correlation between x and y training data
train_data = X_train.join(y_train)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;train_data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2F0gkpnd3zaywige5c71m2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F0gkpnd3zaywige5c71m2.png" alt="Image description" width="800" height="577"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fh9kg7xqxue7nkoh6uejx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fh9kg7xqxue7nkoh6uejx.png" alt="Image description" width="800" height="615"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Visualizing the above
train_data.hist(figsize=(15, 8))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fi4m91h046pfzr4z4zrsz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fi4m91h046pfzr4z4zrsz.png" alt="Image description" width="800" height="707"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Encoding non-numeric columns to see if they are useful and categorical for analysis

train_data_encoded = pd.get_dummies(train_data, drop_first=True)
correlation_matrix = train_data_encoded.corr()
print(correlation_matrix)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fo0dqapyjss06pfzas0h1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fo0dqapyjss06pfzas0h1.png" alt="Image description" width="800" height="686"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fj8xsnfc15hfbmtfqd2h7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fj8xsnfc15hfbmtfqd2h7.png" alt="Image description" width="800" height="642"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ftl2nogqsqvg74gf73x4m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftl2nogqsqvg74gf73x4m.png" alt="Image description" width="723" height="665"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;train_data_encoded.corr()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fpztct2xi73o6hklyp1t6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fpztct2xi73o6hklyp1t6.png" alt="Image description" width="800" height="688"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ffd5ymduje8v6szmqqidb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ffd5ymduje8v6szmqqidb.png" alt="Image description" width="800" height="646"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fery74jh1294uqvkmze3d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fery74jh1294uqvkmze3d.png" alt="Image description" width="800" height="716"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;plt.figure(figsize=(15,8))
sns.heatmap(train_data_encoded.corr(), annot=True, cmap = "inferno")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fuxzyog7n1ocowutaof6p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fuxzyog7n1ocowutaof6p.png" alt="Image description" width="800" height="622"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;train_data['total_rooms'] = np.log(train_data['total_rooms'] + 1)
train_data['total_bedrooms'] = np.log(train_data['total_bedrooms'] +1)
train_data['population'] = np.log(train_data['population'] + 1)
train_data['households'] = np.log(train_data['households'] + 1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;train_data.hist(figsize=(15, 8))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fqnn5oqt2u1xym16vxlcf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqnn5oqt2u1xym16vxlcf.png" alt="Image description" width="800" height="723"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#convert ocean_proximity factors into binary's using one_hot_encoding
train_data.ocean_proximity.value_counts()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ocean_proximity&lt;br&gt;
&amp;lt;1H OCEAN     7267&lt;br&gt;
INLAND        5183&lt;br&gt;
NEAR OCEAN    2108&lt;br&gt;
NEAR BAY      1783&lt;br&gt;
ISLAND           5&lt;br&gt;
Name: count, dtype: int64&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#For each feature of the above we will then create its binary(0 or 1)
pd.get_dummies(train_data.ocean_proximity)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Furwmtp0wcw1vsdnhzfbn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Furwmtp0wcw1vsdnhzfbn.png" alt="Image description" width="572" height="620"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Dropping afterwards the proximity
train_data = train_data.join(pd.get_dummies(train_data.ocean_proximity)).drop(['ocean_proximity'], axis=1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;train_data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2F153qv6r8g1lsfjvve7xs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F153qv6r8g1lsfjvve7xs.png" alt="Image description" width="767" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fp2ydccjvxgy8wco75b00.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fp2ydccjvxgy8wco75b00.png" alt="Image description" width="800" height="536"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#recheck for correlation
plt.figure(figsize=(18, 8))
sns.heatmap(train_data.corr(), annot=True, cmap ='twilight')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Ftyspzhe1h4sqfssovdsy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftyspzhe1h4sqfssovdsy.png" alt="Image description" width="800" height="613"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#visualize the coordinates
plt.figure(figsize=(15, 8))
sns.scatterplot(x='latitude', 
                y = 'longitude',
                data= train_data, 
                hue='median_house_value', palette='Spectral')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fh80thyfkalduhzxa8m08.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fh80thyfkalduhzxa8m08.png" alt="Image description" width="800" height="602"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Combine new features with the ones we already have(using feature engineering)

train_data['bedroom_ratio'] = train_data['total_bedrooms']/train_data['total_rooms']
train_data['household_rooms'] = train_data['total_rooms']/train_data['households']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#show correlation
plt.figure(figsize=(18, 8))
sns.heatmap(train_data.corr(), annot=True, cmap ='ocean')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fbjujmmh33k56sm5u8wvi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fbjujmmh33k56sm5u8wvi.png" alt="Image description" width="793" height="643"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#train data using linear regression
from sklearn.linear_model import LinearRegression

X_train, y_train = train_data.drop(['median_house_value'], axis=1), train_data['median_house_value']

reg = LinearRegression()

reg.fit(X_train, y_train)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fnczkaa23msx0e32h3cp4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fnczkaa23msx0e32h3cp4.png" alt="Image description" width="290" height="158"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Assuming 'data' is the original dataset with 'ocean_proximity'
test_data = X_test.join(y_test)
test_data['ocean_proximity'] = data.loc[test_data.index, 'ocean_proximity']

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Join X_test and y_test to form test_data
test_data = X_test.join.join(y_test)

#Apply log transformations
test_data['total_rooms'] = np.log(test_data['total_rooms'] + 1)
test_data['total_bedrooms'] = np.log(test_data['total_bedrooms'] + 1
test_data['population'] = np.log(test_data['population'] + 1)
test_data['households'] = np.log(test_data['households'] + 1)

#One-hot encode 'ocean_proximity' with the same prefix as in training data
#Assuming the training data used no prefix or a different one, adjust accordingly
#test_data = test_data.join(pd.get_dummies(test_data['ocean_proximity'], prefix='')).drop(['ocean_proximity'], axis=1) #prefix =''for no prefix
# or rename columns to match training data after one-hot encoding
test_data = test_data.rename(columns = {
       'ocean_&amp;lt;1H OCEAN': '&amp;lt;1H OCEAN',
       'ocean_INLAND  : 'INLAND',
       'ocean_ISLAND : 'ISLAND',
       'ocean_NEAR BAY: 'NEAR BAY',
       'ocean_NEAR OCEAN : 'NEAR OCEAN'
})

#Create new feature columns
test_data['bedroom_ratio'] = test_data['total_bedrooms']/test_data['total_rooms']
test_data['household_rooms'] = test_data['total_rooms']/test_data['household_rooms]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#test_data = test_data.join(pd.get_dummies(test_data['ocean_proximity']. prefix='')).drop(['ocean_proximity'], axis=1) #prefix='' for no prefix #or rename columns to match training data after one-hot encoding:
test_data = test_data.rename(columns = {
       'ocean_&amp;lt;1H OCEAN': '&amp;lt;1H OCEAN',
       'ocean_INLAND  : 'INLAND',
       'ocean_ISLAND : 'ISLAND',
       'ocean_NEAR BAY: 'NEAR BAY',
       'ocean_NEAR OCEAN : 'NEAR OCEAN'
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;X_test, y_test = test_data.drop(['median_house_value'], axis=1), test_data['median_house_value']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;X_test_s = scaler.transfrom(X_test)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reg.score(X_test_s, y_test)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;0.5092972905670141&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.metrics import mean_squared_error

forest = RandomForestRegressor()

forest.fit(X_train_s, y_train)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2F0vuxltfgtidy354g8h22.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F0vuxltfgtidy354g8h22.png" alt="Image description" width="377" height="126"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;forest.score(X_test_s, y_test)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;0.4447616558596853&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 GridSearchCV

param_grid ={
     'n_estimators': [3, 10, 30],
     'max_features' : [2, 4, 6, 8]

}

grid_search = GridSearchCV(forest, Param_grid, 
                           cv=5,
                           scoring ="neg_mean_squared_error",
                          return_train_score=True)
grid_search.fit(X_train_s, y_train)

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2F1d2jzo3jpkyljso2vk54.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F1d2jzo3jpkyljso2vk54.png" alt="Image description" width="437" height="176"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grid_search.best_estimator_
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fdzn950zbbegusxi07fmj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fdzn950zbbegusxi07fmj.png" alt="Image description" width="660" height="78"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grid_search.best_estimator_.score(X_test_s, y_test)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;0.5384474921332503&lt;/p&gt;

&lt;p&gt;I would really say that training a machine is not the easiest of processes but to keep improving the results above you can add more features under the param_grid  such as the min_feature and in that way your best estimator score can keep on improvimng.&lt;/p&gt;

&lt;p&gt;If you got till this far please like and share your comment below, your opinion really matters. Thank you!😊🥰❤️&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>python</category>
      <category>learning</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>🚢Exploratory Data Analysis on the Titanic Dataset🚢</title>
      <dc:creator>Thatohatsi Matshidiso Tilodi</dc:creator>
      <pubDate>Mon, 28 Oct 2024 16:59:51 +0000</pubDate>
      <link>https://dev.to/thatohatsi880/exploratory-data-analysis-on-the-titanic-dataset-kpb</link>
      <guid>https://dev.to/thatohatsi880/exploratory-data-analysis-on-the-titanic-dataset-kpb</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.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%2Frylk1qbpux0sdjxgin8b.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Frylk1qbpux0sdjxgin8b.gif" alt="Image description" width="223" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Titanic dataset from Kaggle is more than just the numbers, its a snapshot of history, rich with stories waiting to be uncovered through data. &lt;/p&gt;

&lt;p&gt;In this project, I embarked on an exploratory data analysis of the iconic Titanic dataset. Using Python libraries like Pandas(pd), Matplotlib(Matlib) and Seaborn(sns), I explored data cleaning techniques, addressed missing values and visualized key patterns and distributions. &lt;/p&gt;

&lt;p&gt;The findings offer a fascinating glimpse into correlations and demographics that played a role in the survival outcomes of those on board. In the article delves into the process and insights gained along the way, revealing what the data tells us about that fateful voyage. &lt;/p&gt;

&lt;h1&gt;&lt;b&gt;Importing and reading the data&lt;/b&gt;&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd
import numpy as np
import matplotlib.pylab as plt
import seaborn as sns
plt.style.use('ggplot')
#pd.set_option('max_columns', 200)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Defining the path to the Titanic Folder
path = "/kaggle/input/titanic/"

#Loading the CSV files into Dataframes
gender_submission_df = pd.read_csv(path + gender_submission.csv)
train_df = pd.read_csv(path + train.csv)
test_df = pd.read_csv(path + test.csv)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;&lt;b&gt;Step 1: Understanding the data&lt;/b&gt;&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Checking the shape of each Dataframe
print("Gender Submission DataFrame shape:", gender_submission_df.shape)
print("Train DataFrame shape:", train_df.shape)
print("Test DataFrame shape:", test_df.shape)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gender Submission DataFrame shape: (418, 2)&lt;br&gt;
train DataFrame shape: (891, 12)&lt;br&gt;
test DataFrame shape: (418, 11)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Displaying the first few rows of each DataFrame
print("First 5 rows of Gender Submission DataFrame:")
print(gender_submission_df.head())
print("-"*70)

print("First 5 rows of Train DataFrame:")
print(train_df.head())
print("-"*70)

print("First 5 rows of Test DataFrame:")
print(test_df.head())
print("-"*70)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First 5 rows of Gender Submission DataFrame:&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media2.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%2F72gn9n73bdiz5lmoiws3.png" alt="Image description" width="800" height="160"&gt;
&lt;/h2&gt;

&lt;p&gt;First 5 rows of Train DataFrame:&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media2.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%2Fo9hrhkm782k104n9kgvn.png" alt="Image description" width="800" height="266"&gt;
&lt;/h2&gt;

&lt;p&gt;First 5 rows of Test DataFrame:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Foq03uwjws4qnnp1vdftr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Foq03uwjws4qnnp1vdftr.png" alt="Image description" width="800" height="266"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Displaying the columns for the above

print("Column for gender submission data_frame: ")
print(gender_submission_df.columns)
print(" ")

print("Column for train data_frame: ")
print(train_df.columns)
print(" ")

print("Column for test data_frame: ")
print(test_df.columns)
print(" ")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Column for gender submission data_frame: &lt;br&gt;
Index(['PassengerId', 'Survived'], dtype='object')&lt;/p&gt;

&lt;p&gt;Column for train data_frame: &lt;br&gt;
Index(['PassengerId', 'Survived', 'Pclass', 'Name', 'Sex', 'Age', 'SibSp',&lt;br&gt;
       'Parch', 'Ticket', 'Fare', 'Cabin', 'Embarked'],&lt;br&gt;
      dtype='object')&lt;/p&gt;

&lt;p&gt;Column for test data_frame: &lt;br&gt;
Index(['PassengerId', 'Pclass', 'Name', 'Sex', 'Age', 'SibSp', 'Parch',&lt;br&gt;
       'Ticket', 'Fare', 'Cabin', 'Embarked'],&lt;br&gt;
      dtype='object')&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Finding out what d_type Pandas has discovered for each

print("d_type for gender submission data_frame: ")
print(gender_submission_df.dtypes)
print(" ")

print("d_type for train data_frame: ")
print(train_df.dtypes)
print(" ")

print("d_type for test data_frame: ")
print(test_df.dtypes)
print(" ")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;d_type for gender submission data_frame: &lt;br&gt;
PassengerId    int64&lt;br&gt;
Survived       int64&lt;br&gt;
dtype: object&lt;/p&gt;

&lt;p&gt;d_type for train data_frame: &lt;br&gt;
PassengerId      int64&lt;br&gt;
Survived         int64&lt;br&gt;
Pclass           int64&lt;br&gt;
Name            object&lt;br&gt;
Sex             object&lt;br&gt;
Age            float64&lt;br&gt;
SibSp            int64&lt;br&gt;
Parch            int64&lt;br&gt;
Ticket          object&lt;br&gt;
Fare           float64&lt;br&gt;
Cabin           object&lt;br&gt;
Embarked        object&lt;br&gt;
dtype: object&lt;/p&gt;

&lt;p&gt;d_type for test data_frame: &lt;br&gt;
PassengerId      int64&lt;br&gt;
Pclass           int64&lt;br&gt;
Name            object&lt;br&gt;
Sex             object&lt;br&gt;
Age            float64&lt;br&gt;
SibSp            int64&lt;br&gt;
Parch            int64&lt;br&gt;
Ticket          object&lt;br&gt;
Fare           float64&lt;br&gt;
Cabin           object&lt;br&gt;
Embarked        object&lt;br&gt;
dtype: object&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fnq8acbbjdy15jw7ln0hm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fnq8acbbjdy15jw7ln0hm.png" alt="Image description" width="800" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fpofv9w0al4zz8ee9d09o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fpofv9w0al4zz8ee9d09o.png" alt="Image description" width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ffnrtmjw8mekt1cae4ra9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ffnrtmjw8mekt1cae4ra9.png" alt="Image description" width="800" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F485rfbgk9f30hq3zycw1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F485rfbgk9f30hq3zycw1.png" alt="Image description" width="800" height="519"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fg8vlxhfifb76mr7yyajg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fg8vlxhfifb76mr7yyajg.png" alt="Image description" width="800" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;&lt;b&gt;Step 2: Data Preparation&lt;/b&gt;&lt;/h1&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Dropping irrelevant columns and rows(Cleaning the data)
#Displaying the first few rows of each DataFrame
print("First 5 rows of Gender Submission DataFrame:")
print(gender_submission_df.head())
print("-"*90)

print("First 5 rows of Train DataFrame:")
print(train_df.head())
print("-"*90)

print("First 5 rows of Test DataFrame:")
print(test_df.head())
print("-"*90)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media2.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%2Fogpgpwiu7sxbbz9pw8do.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fogpgpwiu7sxbbz9pw8do.png" alt="Image description" width="800" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F47ug7p4vjob3qkl1q2xp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F47ug7p4vjob3qkl1q2xp.png" alt="Image description" width="800" height="686"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fhn94i5t3z4l32ai6ahpc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhn94i5t3z4l32ai6ahpc.png" alt="Image description" width="800" height="717"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fox3rd73j7fqy2ayhpw2q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fox3rd73j7fqy2ayhpw2q.png" alt="Image description" width="800" height="572"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F70tnt10muo49149etogl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F70tnt10muo49149etogl.png" alt="Image description" width="800" height="674"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("Column for gender submission data_frame: ")
gender_submission_cleaned_df = gender_submission_df[['PassengerId', 'Survived']].copy()
print(gender_submission_cleaned_df)
print("-"*75)

print("Column for train data_frame: ")
train_cleaned_df = train_df[[#'PassengerId', 
    'Survived', 'Pclass', 
    #'Name', 
        'Sex', 'Age', 'SibSp',
       'Parch', #'Ticket', 
        'Fare', 
        #'Cabin', 
        'Embarked']].copy()
print(train_cleaned_df)
print("-"*75)

print("Column for test data_frame: ")
test_cleaned_df = test_df[['PassengerId', 'Pclass', #'Name', 
               'Sex', 'Age', 'SibSp', 'Parch',
       #'Ticket', 
               'Fare', 'Cabin', 'Embarked']].copy()
print(test_cleaned_df)
print("-"*75)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Ff43ufc7eou647swlphvo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ff43ufc7eou647swlphvo.png" alt="Image description" width="800" height="703"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fpzb1tw0alqy9imrq3swa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fpzb1tw0alqy9imrq3swa.png" alt="Image description" width="800" height="732"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F3thefqchdcj1expzwlsm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F3thefqchdcj1expzwlsm.png" alt="Image description" width="800" height="742"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fn1icg62wndokcta5o3kl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fn1icg62wndokcta5o3kl.png" alt="Image description" width="800" height="742"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F8xtuhaumxq10m8l8ws10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F8xtuhaumxq10m8l8ws10.png" alt="Image description" width="800" height="692"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("d_type for gender submission data_frame: ")
print(gender_submission_cleaned_df.dtypes)
print(" ")

print("d_type for train data_frame: ")
print(train_cleaned_df.dtypes)
print(" ")

print("d_type for test data_frame: ")
print(test_cleaned_df.dtypes)
print(" ")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;d_type for gender submission data_frame: &lt;br&gt;
PassengerId    int64&lt;br&gt;
Survived       int64&lt;br&gt;
dtype: object&lt;/p&gt;

&lt;p&gt;d_type for train data_frame: &lt;br&gt;
Survived      int64&lt;br&gt;
Pclass        int64&lt;br&gt;
Sex          object&lt;br&gt;
Age         float64&lt;br&gt;
SibSp         int64&lt;br&gt;
Parch         int64&lt;br&gt;
Fare        float64&lt;br&gt;
Embarked     object&lt;br&gt;
dtype: object&lt;/p&gt;

&lt;p&gt;d_type for test data_frame: &lt;br&gt;
PassengerId      int64&lt;br&gt;
Pclass           int64&lt;br&gt;
Sex             object&lt;br&gt;
Age            float64&lt;br&gt;
SibSp            int64&lt;br&gt;
Parch            int64&lt;br&gt;
Fare           float64&lt;br&gt;
Cabin           object&lt;br&gt;
Embarked        object&lt;br&gt;
dtype: object&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Renaming our columns
print("Column for gender submission data_frame: ")
gender_submission_cleaned_df = gender_submission_cleaned_df.rename(columns = {'PassengerId': 'Passenger_Id',
                                                'Survived': 'Survival_Status'}) 
print(gender_submission_cleaned_df)
print("-"*75)

print("Column for train data_frame: ")
train_cleaned_df = train_cleaned_df.rename(columns = {'Survived': 'Survival_Status',
                                                       'Pclass' : 'Passenger_Class',
                                                        'Sex' : 'Gender',
                                                         'Age' : 'Passenger_Age',
                                                        'SibSp': 'Siblings_Spouses',
                                                        'Parch': 'Parents_Children',
                                                         'Fare': 'Ticket_Fare',
                                                        'Embarked':'Port_of_Embarkation'})


print(train_cleaned_df)
print("-"*75)

print("Column for test data_frame: ")
test_cleaned_df = test_cleaned_df.rename(columns = {'PassengerId': 'Passenger_Id', 
                                                    'Pclass': 'Passenger_Class',
                                                    'Sex': 'Gender', 
                                                    'Age': 'Passenger_Age', 
                                                    'SibSp': 'Siblings_Spouses', 
                                                    'Parch': 'Parents_Children',
                                                    'Fare': 'Ticket_Fare', 
                                                    'Cabin': 'Cabin_Number', 
                                                    'Embarked': 'Port_of_Embarkation',})
print(test_cleaned_df)
print("-"*75)`

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2F6uxa0js4k7w7yq67d8cg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F6uxa0js4k7w7yq67d8cg.png" alt="Image description" width="800" height="643"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fnsp4gbit4vakn2tzjf15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fnsp4gbit4vakn2tzjf15.png" alt="Image description" width="800" height="751"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Fc0oqlbirldjzye1msam9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fc0oqlbirldjzye1msam9.png" alt="Image description" width="800" height="701"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fa9gkd8m2niyzvvyk0nsm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fa9gkd8m2niyzvvyk0nsm.png" alt="Image description" width="800" height="702"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F5ynurfmy35w3p90f3idl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F5ynurfmy35w3p90f3idl.png" alt="Image description" width="800" height="751"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Checking if there arent any missing values:
print("for gender submission data_frame: ")
print(gender_submission_cleaned_df.isna().sum())
print("-" * 90)

print("for gender submission data_frame: ")
print(train_cleaned_df.isna().sum())
print("-" * 90)

print("for gender submission data_frame: ")
print(test_cleaned_df.isna().sum())
print("-" * 90)`

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2F3qj1y7rzgn599r5hp2h2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F3qj1y7rzgn599r5hp2h2.png" alt="Image description" width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fr2mhkn8d9f14jkwjrf0u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fr2mhkn8d9f14jkwjrf0u.png" alt="Image description" width="800" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fhi934lmn3u1qpg580vbo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhi934lmn3u1qpg580vbo.png" alt="Image description" width="800" height="568"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Checking if there aren't any duplicates
print("Gender submission data_frame: ")
print(gender_submission_cleaned_df.loc[gender_submission_cleaned_df.duplicated()])
print("-" * 90)

print("Test data_frame: ")
print(test_cleaned_df.loc[test_cleaned_df.duplicated()])
print("-" * 90)

print("Train data_frame: ")
print(train_cleaned_df.loc[train_cleaned_df.duplicated()])
print("-" * 90)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Feg8v2yvbrgpalq2184wb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Feg8v2yvbrgpalq2184wb.png" alt="Image description" width="800" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F78k94lxtaotsxraoiv4p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F78k94lxtaotsxraoiv4p.png" alt="Image description" width="800" height="651"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fzmvk68zps8ty9aluwcwt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fzmvk68zps8ty9aluwcwt.png" alt="Image description" width="800" height="254"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("Gender submission data_frame shape: ", gender_submission_df.shape)
print("train DataFrame shape:", train_df.shape)
print("test DataFrame shape:", test_df.shape)

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

&lt;/div&gt;



&lt;p&gt;Gender submission data_frame shape:  (418, 2)&lt;br&gt;
train DataFrame shape: (891, 12)&lt;br&gt;
test DataFrame shape: (418, 11)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Checking if there arent any duplicated rows
print("Checking duplicates for gender submission data_frame shape: ")
duplicates = gender_submission_cleaned_df.loc[gender_submission_cleaned_df.duplicated(subset=['Survival_Status'], keep=False)].head(5)
print(duplicates)
print("-" * 90)


print("Checking duplicates for train data_frame shape: ")
duplicates = train_cleaned_df.loc[train_cleaned_df.duplicated(subset=['Parents_Children', 'Ticket_Fare', 'Gender'], keep=False)].head(5)
print(duplicates)
print("-" * 90)


print("Checking duplicates for test data_frame shape: ")
duplicates = test_cleaned_df.loc[test_cleaned_df.duplicated(subset=['Siblings_Spouses', 'Passenger_Age', 'Port_of_Embarkation'], keep=False)].head(5)
print(duplicates)
print("-" * 90)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Ftl3xzly4h56uz0g3dewd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftl3xzly4h56uz0g3dewd.png" alt="Image description" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F250fdo4s7pc9o0n25w1v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F250fdo4s7pc9o0n25w1v.png" alt="Image description" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fcm86uxbzazgy9cersxbn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fcm86uxbzazgy9cersxbn.png" alt="Image description" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F0ovit1x2hl74t5vcbzvu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F0ovit1x2hl74t5vcbzvu.png" alt="Image description" width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fvqymkdqxlj0d235k7gsd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fvqymkdqxlj0d235k7gsd.png" alt="Image description" width="800" height="396"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Filtering and Querying my data above:
#Checking an example duplicate
print('gender submission data_frame: ')
Filter = gender_submission_cleaned_df.query('Survival_Status == 0')
print(Filter)
print("-" * 90)

print('train data_frame: ')
Filter = train_cleaned_df.query('Passenger_Age == 35.0' )
print(Filter)
print("-" * 90)

print('test data_frame: ')
Filter = test_cleaned_df.query('Siblings_Spouses')
print(Filter)
print("-" * 90)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Flf7kch7ks0yf1e1uy6e7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Flf7kch7ks0yf1e1uy6e7.png" alt="Image description" width="800" height="704"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fcmg38mqtmoudocisss85.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fcmg38mqtmoudocisss85.png" alt="Image description" width="800" height="721"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fk4u51g1pbvb8dnn8sggb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fk4u51g1pbvb8dnn8sggb.png" alt="Image description" width="800" height="717"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fa88bpj6yevw87b5d6aom.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fa88bpj6yevw87b5d6aom.png" alt="Image description" width="800" height="697"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fyrux04v84cjxbf92nzsj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fyrux04v84cjxbf92nzsj.png" alt="Image description" width="800" height="677"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print('Column for gender submission data_frame: ')
print(gender_submission_cleaned_df.columns)
print("-" * 90)

print('Column for gender submission data_frame: ')
print(train_cleaned_df.columns)
print("-" * 90)

print('Column for gender submission data_frame: ')
print(test_cleaned_df.columns)
print("-" * 90)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Checking duplicated rows for gender submission data_frame:&lt;/p&gt;

&lt;h2&gt;
  
  
  Number of duplicates: 416
&lt;/h2&gt;

&lt;p&gt;Checking duplicated rows for train data_frame:&lt;/p&gt;

&lt;h2&gt;
  
  
  Number of duplicates: 486
&lt;/h2&gt;

&lt;p&gt;Checking duplicated rows for test data_frame:&lt;/p&gt;

&lt;h2&gt;
  
  
  Number of duplicates: 231
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Cleaning up duplicates in each DataFrame

print("Gender submission data_frame: ")
gender_submission_cleaned_df = gender_submission_cleaned_df.loc[~gender_submission_cleaned_df.duplicated(subset=['Survival_Status'])] \
     .reset_index(drop=True).copy()
print(gender_submission_cleaned_df)
print('-' * 90)

print("Train data_frame: ")
train_cleaned_df = train_cleaned_df.loc[~train_cleaned_df.duplicated(subset=['Passenger_Class', 'Passenger_Age', 'Ticket_Fare'])] \
     .reset_index(drop=True).copy()
print(train_cleaned_df)
print('-' * 90)

print("Test data_frame: ")
test_cleaned_df = test_cleaned_df.loc[~test_cleaned_df.duplicated(subset=['Ticket_Fare', 'Cabin_Number', 'Port_of_Embarkation'])] \
     .reset_index(drop=True).copy()
print(test_cleaned_df)
print('-' * 90)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fcf0gcdf4l27tc4owcd8e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fcf0gcdf4l27tc4owcd8e.png" alt="Image description" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fwal7bc8o6zavydxg99d1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fwal7bc8o6zavydxg99d1.png" alt="Image description" width="800" height="742"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fk6bgq3ckli3jrgm7nxi2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fk6bgq3ckli3jrgm7nxi2.png" alt="Image description" width="800" height="737"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fbfx52d7mf8g932ytmh1i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fbfx52d7mf8g932ytmh1i.png" alt="Image description" width="800" height="719"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fdjjigwyws406guyacwl3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fdjjigwyws406guyacwl3.png" alt="Image description" width="800" height="707"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("Gender submission data_frame shape: ", gender_submission_cleaned_df.shape)
print("train DataFrame shape:", train_cleaned_df.shape)
print("test DataFrame shape:", test_cleaned_df.shape)

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

&lt;/div&gt;



&lt;p&gt;Gender submission data_frame shape:  (2, 2)&lt;br&gt;
train DataFrame shape: (712, 8)&lt;br&gt;
test DataFrame shape: (208, 9)&lt;/p&gt;

&lt;h1&gt;&lt;b&gt;Step 3: Feature Understanding&lt;/b&gt;&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Plotting Feature Distributions&lt;/li&gt;
&lt;li&gt;Histogram&lt;/li&gt;
&lt;li&gt;KDE&lt;/li&gt;
&lt;li&gt;Boxplot
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("Gender submission data_frame shape: ", gender_submission_cleaned_df)
print('-' * 90)
print("train DataFrame shape:", train_cleaned_df)
print('-' * 90)
print("test DataFrame shape:", test_cleaned_df)
print('-' * 90)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media2.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%2Fb3bzmjpdanoh6ynovub0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fb3bzmjpdanoh6ynovub0.png" alt="Image description" width="800" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fvbqmj27cuzwxc0fpn9hk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fvbqmj27cuzwxc0fpn9hk.png" alt="Image description" width="800" height="688"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ft5u5xq0cbnztye54ekgj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ft5u5xq0cbnztye54ekgj.png" alt="Image description" width="800" height="717"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Futebp6tyvmh6gay04jow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Futebp6tyvmh6gay04jow.png" alt="Image description" width="800" height="705"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ffb3esl9pdzsof02bqvjn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ffb3esl9pdzsof02bqvjn.png" alt="Image description" width="800" height="667"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#value_counts

print(gender_submission_cleaned_df['Passenger_Id'].value_counts())
print('-' * 90)
print(train_cleaned_df['Passenger_Age'].value_counts())
print('-' * 90)
print(test_cleaned_df['Cabin_Number'].value_counts())
print('-' * 90)`

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

&lt;/div&gt;



&lt;p&gt;Passenger_Id&lt;br&gt;
892    1&lt;br&gt;
893    1&lt;/p&gt;
&lt;h2&gt;
  
  
  Name: count, dtype: int64
&lt;/h2&gt;

&lt;p&gt;Passenger_Age&lt;br&gt;
24.00    27&lt;br&gt;
18.00    23&lt;br&gt;
22.00    21&lt;br&gt;
21.00    21&lt;br&gt;
30.00    21&lt;br&gt;
         ..&lt;br&gt;
36.50     1&lt;br&gt;
0.92      1&lt;br&gt;
23.50     1&lt;br&gt;
55.50     1&lt;br&gt;
74.00     1&lt;/p&gt;
&lt;h2&gt;
  
  
  Name: count, Length: 88, dtype: int64
&lt;/h2&gt;

&lt;p&gt;Cabin_Number&lt;br&gt;
C101    2&lt;br&gt;
C78     2&lt;br&gt;
B45     1&lt;br&gt;
C89     1&lt;br&gt;
B69     1&lt;br&gt;
       ..&lt;br&gt;
C6      1&lt;br&gt;
G6      1&lt;br&gt;
A29     1&lt;br&gt;
F       1&lt;br&gt;
C105    1&lt;br&gt;
Name: count, Length: 76, dtype: int64&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ax = gender_submission_cleaned_df['Survival_Status'].value_counts()\
      .head(10)\
      .plot(kind='bar', title='Top 10 Gender submission Survival_Status Counts')
ax.set_xlabel('Passenger_Age')
ax.set_ylabel('Count')
plt.show()

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fi18ztvjjjlg5dc8gf9vw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fi18ztvjjjlg5dc8gf9vw.png" alt="Image description" width="574" height="455"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ax = train_cleaned_df['Passenger_Age'].value_counts()\
      .head(10)\
      .plot(kind='bar', title=' Top 10 counts for Passenger_Age from train dataset')
ax.set_xlabel('Passenger_Age')
ax.set_ylabel('Count')
plt.show()

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fbvs6o2flxnwkwcsq30uf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fbvs6o2flxnwkwcsq30uf.png" alt="Image description" width="582" height="477"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ax = test_cleaned_df['Cabin_Number'].value_counts()\
      .head(10)\
      .plot(kind='bar', title='Top 10 counts for Cabin_Number from test dataset')
ax.set_xlabel('Cabin_Number')
ax.set_ylabel('Count')
plt.show()

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2F8y5po79w5z634xohe90g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F8y5po79w5z634xohe90g.png" alt="Image description" width="586" height="505"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(gender_submission_cleaned_df)
print('-' * 90)
print(train_cleaned_df)
print('-' * 90)
print(test_cleaned_df)
print('-' * 90)

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Frwbj1xxqqn5jj7qyn9qb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Frwbj1xxqqn5jj7qyn9qb.png" alt="Image description" width="800" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fjzcc9flu6mr96jezjmh9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fjzcc9flu6mr96jezjmh9.png" alt="Image description" width="800" height="650"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fki9j78pyjk51nx7c4q0e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fki9j78pyjk51nx7c4q0e.png" alt="Image description" width="800" height="723"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ax = gender_submission_cleaned_df['Passenger_Id'].plot(kind = 'hist',
                                                       bins = 20,
                                                       title = 'Gender_Submission Dataset')
ax.set_label('Passenger_Id')
plt.show()

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fmmx998epktdpl6724cfz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fmmx998epktdpl6724cfz.png" alt="Image description" width="571" height="436"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ax = train_cleaned_df['Passenger_Class'].plot(kind = 'hist',
                                              bins = 20,
                                              title = 'Train Dataset')
ax.set_label('Passenger_Class')
plt.show()

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fgs9c1svol366oblba3ze.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fgs9c1svol366oblba3ze.png" alt="Image description" width="575" height="436"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ax = test_cleaned_df['Ticket_Fare'].plot(kind = 'hist',
                                         bins = 20,
                                         title = 'Train Dataset')
ax.set_label('Ticket_Fare')
plt.show()

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Frujpaa0sy9e7xx8tys79.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Frujpaa0sy9e7xx8tys79.png" alt="Image description" width="575" height="436"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ax = gender_submission_cleaned_df['Passenger_Id'].plot(kind = 'kde',
                                                      title = 'Gender_Submission Dataset')
ax.set_label('Passenger_Id')
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Favtszi6tfw5w603cp54f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Favtszi6tfw5w603cp54f.png" alt="Image description" width="581" height="436"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ax = train_cleaned_df['Passenger_Class'].plot(kind = 'kde',
                                         title = 'Train Dataset')
ax.set_label('Passenger_Class')
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fpy9ccu6nh9tovobz5mwu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fpy9ccu6nh9tovobz5mwu.png" alt="Image description" width="571" height="436"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ax = test_cleaned_df['Ticket_Fare'].plot(kind = 'kde',
                                         title = 'Test Dataset')
ax.set_label('Ticket_Fare')
plt.show()

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fkiph9fgnjv6ro5hde6ci.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fkiph9fgnjv6ro5hde6ci.png" alt="Image description" width="593" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;&lt;b&gt;Step 4: Feature Relationships&lt;/b&gt;&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Heatmap Correlation&lt;/li&gt;
&lt;li&gt;Scatterplot&lt;/li&gt;
&lt;li&gt;Pairplot&lt;/li&gt;
&lt;li&gt;Groupby Comparison
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(gender_submission_cleaned_df)
print('-' * 90)
print(train_cleaned_df)
print('-' * 90)
print(test_cleaned_df)
print('-' * 90)

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fnlqmbv7f1rswfeheq0uf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fnlqmbv7f1rswfeheq0uf.png" alt="Image description" width="800" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F24wqinduc9eefiktgafr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F24wqinduc9eefiktgafr.png" alt="Image description" width="800" height="716"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F9mc9nk1c0hs487oo3lxi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F9mc9nk1c0hs487oo3lxi.png" alt="Image description" width="800" height="706"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fwsww5olql6amkoncvri1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fwsww5olql6amkoncvri1.png" alt="Image description" width="800" height="711"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F0keb5g9tcx6y223yhzf4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F0keb5g9tcx6y223yhzf4.png" alt="Image description" width="800" height="664"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Scatterplot Analysis
gender_submission_cleaned_df.plot(kind= 'scatter',
                            x = 'Passenger_Id',
                            y = 'Survival_Status',
                            title = 'Relationship Analysis: Passenger_Id vs Survival_Status(Gender Submission Data)')
plt.show()

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fejhd07tqq6wrvqqi0b9z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fejhd07tqq6wrvqqi0b9z.png" alt="Image description" width="800" height="442"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Scatterplot
train_cleaned_df.plot(kind= 'scatter',
                       x = 'Siblings_Spouses',
                       y = 'Parents_Children',
                       title = 'Relationship Analysis: Siblings_Spouses vs Parents_Children(Train Data)')
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Ffql4jkjtw3safl6npsml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ffql4jkjtw3safl6npsml.png" alt="Image description" width="738" height="460"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Scatterplot
test_cleaned_df.plot(kind= 'scatter',
                            x = 'Parents_Children',
                            y = 'Ticket_Fare',
                            title = 'Relationship Analysis: Ticket_Fare vs Family Size(Parents/Children) in Test Dataset')
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fg4j881gkgxi63fct7f8k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fg4j881gkgxi63fct7f8k.png" alt="Image description" width="800" height="438"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#With a hue included

sns.scatterplot(x = 'Passenger_Id',
                y = 'Survival_Status',
                hue ='Passenger_Id',
                data = gender_submission_cleaned_df)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fhw5otahdnwfeg84pu8rg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhw5otahdnwfeg84pu8rg.png" alt="Image description" width="571" height="437"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sns.scatterplot(y = 'Siblings_Spouses',
                x = 'Parents_Children',
                hue = 'Passenger_Age',
                data = train_cleaned_df)
plt.show()

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2F7ndroccquf3k40oeu29a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F7ndroccquf3k40oeu29a.png" alt="Image description" width="558" height="437"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sns.scatterplot(x = 'Parents_Children',
                y = 'Ticket_Fare',
                hue = 'Passenger_Age',
                data = test_cleaned_df)
plt.show()``

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fbzeelhrrt6cgxlxyvi4t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fbzeelhrrt6cgxlxyvi4t.png" alt="Image description" width="575" height="437"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Pairplot

sns.pairplot(data=gender_submission_cleaned_df,
         vars=['Passenger_Id', 'Survival_Status'],
         hue = 'Survival_Status')
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fezbt9etczum75cljm1zy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fezbt9etczum75cljm1zy.png" alt="Image description" width="618" height="496"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sns.pairplot(data = train_cleaned_df,
                vars = ['Siblings_Spouses','Parents_Children'],
                hue = 'Passenger_Age')
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fcbfuqlgs3d4vi8tadnq9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fcbfuqlgs3d4vi8tadnq9.png" alt="Image description" width="615" height="496"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sns.pairplot(data = test_cleaned_df,
             vars =['Passenger_Class',
                     'Passenger_Age',
                      'Parents_Children','Ticket_Fare'],
              hue = 'Passenger_Age')
plt.show()

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fy788o0zju5l2fmhiupnr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fy788o0zju5l2fmhiupnr.png" alt="Image description" width="800" height="710"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Heatmap Correlation
gender_submission_cleaned_df = gender_submission_cleaned_df[['Passenger_Id', 'Survival_Status']].dropna().corr()

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sns.heatmap(gender_submission_cleaned_df, annot=True)

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fhenywfjxqavtsvg46e4l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhenywfjxqavtsvg46e4l.png" alt="Image description" width="533" height="418"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;train_cleaned_df = train_cleaned_df[['Passenger_Class', 
                                    'Passenger_Age',
                                    'Siblings_Spouses',
                                    'Parents_Children',
                                    'Ticket_Fare']].dropna().corr()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sns.heatmap(train_cleaned_df, annot=True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fgutlghavx026inee4gh2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fgutlghavx026inee4gh2.png" alt="Image description" width="631" height="523"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;test_cleaned_df = test_cleaned_df[['Passenger_Id', 
                                    'Passenger_Age',
                                    'Parents_Children',
                                    'Ticket_Fare']].dropna().corr()`

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sns.heatmap(test_cleaned_df, annot=True)

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fulnqdj51gizpp2q0954t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fulnqdj51gizpp2q0954t.png" alt="Image description" width="618" height="521"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;&lt;b&gt;Questions And Visualisation&lt;/b&gt;&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#What is the relationship between Passenger_Age and Survival_Status under trained data?
print(train_cleaned_df.columns)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Index(['Passenger_Class', 'Passenger_Age', 'Siblings_Spouses',&lt;br&gt;
       'Parents_Children', 'Ticket_Fare'],&lt;br&gt;
      dtype='object')&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(train_cleaned_df['Passenger_Age'].isnull().sum())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;0&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#option 1: Drop rows with null values
train_cleaned_df = train_cleaned_df.dropna(subset=['Passenger_Age'])

#option 2: Fill null values with specific value(e.g., mean or median)
train_cleaned_df['Passenger_Age'] = train_cleaned_df['Passenger_Age'].fillna(train_cleaned_df['Passenger_Age'].mean())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Verifying DataTypes
print(train_cleaned_df.dtypes)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Passenger_Class     float64&lt;br&gt;
Passenger_Age       float64&lt;br&gt;
Siblings_Spouses    float64&lt;br&gt;
Parents_Children    float64&lt;br&gt;
Ticket_Fare         float64&lt;br&gt;
dtype: object&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Plot Again
sns.scatterplot(data=train_cleaned_df, x='Passenger_Age', y='Passenger_Class')
plt.title('Passenger_Class vs. Passenger_Age')
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fabn4vlpd6l6oigzu6765.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fabn4vlpd6l6oigzu6765.png" alt="Image description" width="583" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you have read till this far please like and comment below, your input matters alot. Thank you😊&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>python</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
    <item>
      <title>Data Science and Web Development Integration?🤔...</title>
      <dc:creator>Thatohatsi Matshidiso Tilodi</dc:creator>
      <pubDate>Tue, 30 Jul 2024 18:36:28 +0000</pubDate>
      <link>https://dev.to/thatohatsi880/data-science-and-web-development-integration-2ldn</link>
      <guid>https://dev.to/thatohatsi880/data-science-and-web-development-integration-2ldn</guid>
      <description>&lt;h1&gt;Machine Learning and JavaScript &lt;/h1&gt;

&lt;h3&gt;Introduction to Machine Learning &lt;/h3&gt;  

&lt;p&gt;&lt;a href="https://media2.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%2Fcd8yjwxc6ih57oy930mt.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fcd8yjwxc6ih57oy930mt.gif" alt="Image description" width="498" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ever wondered if it is possible to integrate data science and web development?... &lt;/p&gt;

&lt;p&gt;Well, we all know that machine learning is a vital element of today's technological evolution. In multitudes of fields, ranging from healthcare to agriculture, businesses have begun to leverage the potential of machine learning for decision-making and strategy planning. Although JavaScript was initially designed to augment web development with smooth, interactive features, developers increasingly use JavaScript for purposes beyond web design and development. Type casting and mobile device tracking are examples of machine learning functions that can be performed with JavaScript. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overview of JavaScript Files and Libraries HTML and CSS dictate web face design and structure.&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;JavaScript typically provides the interactivity that users look for when viewing webpages. What I did not know or rather was not aware of is that this is sometimes achieved by injecting JavaScript code into the HTML document directly, by creating a separate .js file and using the script tag in an HTML file, or by linking the JavaScript file using a URL. The full web address of a JavaScript file can be referenced in the src attribute of such a script tag just as it would in the href attribute of a hyperlink. To facilitate these interactions and seamless processes, developers use a range of JavaScript-based libraries and frameworks. Also having to incorporate these tools, I further learned that one can simplify operations such as streaming video, fulfilling requests for free documentation, page layout, and customizing virtual reality (VR) gameplay design. &lt;/p&gt;

&lt;h1&gt;Popular Libraries for Machine Learning in JavaScript&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fiqt5cbn4dqcph9lwd62w.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fiqt5cbn4dqcph9lwd62w.gif" alt="Image description" width="410" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are many machine learning libraries that are either written in JavaScript or have APIs for JavaScript. All these libraries target different use cases, from simple model deployment to training models in the browser. Below are some of these technologies that make machine learning in the browser not just possible, but even easy and fun. &lt;/p&gt;

&lt;p&gt;A little bit that kept me wondering about Brain.js and Tensorflow.js (which I have never used before)  well with &lt;strong&gt;Brain.js&lt;/strong&gt;, also known to be developed by the Liquid Studio Group, is a library for training neural networks in "vanilla" JavaScript. The library provides a high-level abstraction layer above TensorFlow.js, which simplifies the training and working with neural networks. Brain.js, however, is a great solution for training models in browser environments. &lt;/p&gt;

&lt;p&gt;I know a lot of data scientists or even data science students like myself are aware of tensorflow, well **tensorflow.js **is something new or rather a library I heard under the integration of data science and web development. TensorFlow.js is basically a Google library used for training models in the browser. It supports both classic models from conventional machine learning and models for deep learning with relatively advanced capabilities. The library contains convolutional networks, recurrent neural networks, and others, and developers on the other hand can create, train, and deploy different model types directly in JavaScript. &lt;/p&gt;

&lt;p&gt;One thing I really never saw coming is that KNN, which is also known as K-nearest neighbors, is a small machine learning library written in TypeScript (what you would expect to use under web development). One can also say that it is simple and user-friendly, the library has a limited set of functions that make it possible to solve some problems related to a machine learning task in a browser or a server-side environment. It's especially good for problems with classification. &lt;/p&gt;

&lt;p&gt;Synaptic on the other hand is a JavaScript neural network library for both Node and the browser. It's good for experimenting with different types of neural networks like both high-level and primitive. At first, it may look more complex than it really is. The library is about training and working with models "a la Brain.js," but can be more flexible and meet more specific requirements. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dljs&lt;/strong&gt;is a library for deep learning in JavaScript. The authors pursued a bold goal that being to provide the most powerful tools for deep learning in the simplest available scripts. The library contains six models, twelve losses, and thirteen optimizers. It's probably a good choice for a limited number of specific tasks. &lt;/p&gt;

&lt;h2&gt;
  
  
  Comparing Machine Learning Frameworks in JavaScript
&lt;/h2&gt;

&lt;h3&gt;Key Features and Capabilities of Popular Machine Learning Frameworks &lt;/h3&gt;

&lt;p&gt;We shall briefly review the core features and capabilities of popular JavaScript machine learning frameworks. Specifically, we will review the following three frameworks namely &lt;strong&gt;TensorFlow.js, Brain.js and Synaptic.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. TensorFlow.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will eventually present an in-depth comparison of these ML frameworks based on different perspectives summarized in Section 4. Specifically, we rely on both our comprehensive study and further feedback from the communities and experienced developers who have contributed to these frameworks. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A. TensorFlow.js&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;We all know that TensorFlow is an open-source machine learning library developed by Google, commonly used to build various neural networks. TensorFlow is developed primarily with Python. However, evolving TensorFlow.js recently allows JavaScript developers to train and use models directly in the browser or at Node.js. Therefore, it improves user experience by enabling server-side and client-side implementation, especially allowing browsers to run predictive machine learning models without sending user data to the server. TensorFlow.js directly exposes low-level operations which are performed server-side on CPUs and client-side on WebGL, with later devices such as CPUs and GPUs for opening on mobile. Our study uses both CPU and WebGL backends for comparison. The training of a machine learning model is now possible on a webpage. The library is billed to carry out "training from a user's own data" in an incremental way, which is expected as users become able to add functions, they want to use JavaScript libraries without using Python libraries. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to go about some of the installations and some of the real-life applications examples:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fab3pweklanjpnfrghgbp.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fab3pweklanjpnfrghgbp.gif" alt="Image description" width="498" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First step:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;With the first step what is basically required of you is to have Node.js or npm first installed so that you are able to install tensorflow.js via your command prompt using the configuration below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @tensorflow/tfjs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Second Step:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The second step basically requires one to start loading using pre-trained models. These pre-trained models can also come from the tensorflow.js hub. This can be done using the configuration in code set below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import * as tf from '@tensorflow/tfjs'; 

import * as mobilenet from '@tensorflow-models/mobilenet'; 



const img = document.getElementById('img'); 

const model = await mobilenet.load(); 

const predictions = await model.classify(img); 

console.log(predictions);  

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Third Step:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the part where one gets to build and train models in browser. &lt;/p&gt;

&lt;p&gt;The below example is simple neural network that basically assisting a model to recognize handwritten digits.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import * as tf from '@tensorflow/tfjs'; 

import * as mobilenet from '@tensorflow-models/mobilenet'; 



const img = document.getElementById('img'); 

const model = await mobilenet.load(); 

const predictions = await model.classify(img); 

console.log(predictions);  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Fourth Step/ last step:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is where real-life applications come into play  and this is by example, we can try using the above pre-trained models to help classify web-cam images in real-time&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const video = document.getElementById('webcam'); 

const model = await mobilenet.load(); 



async function classifyVideo() { 

  const predictions = await model.classify(video); 

  console.log(predictions); 

  requestAnimationFrame(classifyVideo); 

} 



classifyVideo();  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;Practical Applications of JavaScript in Machine Learning&lt;/h1&gt;
 

&lt;p&gt;&lt;a href="https://media2.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%2F5b9xsrwgckf7gr6ruchz.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F5b9xsrwgckf7gr6ruchz.gif" alt="Image description" width="302" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, we now have a basic understanding of JavaScript and event listeners and their functions. Let's try move forward and get into more practical applications of JavaScript and see some case studies of it in machine learning and web development. We are going to explain how to create a convolutional neural network in TensorFlow.js, create a few types of chatbots using plain JavaScript with different conversational services, and how to perform sentiment analysis. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pure JavaScript Sentiment Analysis:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can find several models trained for Natural Language Processing (NLP) in machine learning libraries. There are several powerful libraries in Python which can create, train, and test several models for NLP. However, what is going to happen when you want to run a large pre-trained model in the front-end using a web browser? .... Well the answer is that you have TensorFlow.js. But, how can you perform the same task using plain JavaScript without a powerful library like TensorFlow.js? ...Of course, you do not need TensorFlow.js to perform this task, or sometimes to apply Machine Learning in the browser. The reason to use TensorFlow.js for NLP tasks is that it allows you to train and test your selected models for NLP. But, what you are going to learn in this article is how you can still use traditional machine learning models for NLP without TensorFlow.js. Therefore, you are going to need the classification model from compromised_sentiment, which is just an NLP model within compromised, applied to perform sentiment analysis using the compromise package. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case studies provided with their code examples:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case Studies of Successful Implementations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Case studies constituting this section are provided to look at several successful implementations of JavaScript for the work of training and predictions with different machine learning models. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case Study 1: Lemonade Sales Prediction Webapp&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F77w4mqrrmop3j18hkois.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F77w4mqrrmop3j18hkois.jpeg" alt="Image description" width="220" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A simple regression model known to many beginners is predicting lemonade sales dependent upon the temperature. This is one of the most basic applications of the idea behind the significance of machine learning and how it can be utilized practically. This is one such application where D_Meta allows the user to forecast sales dependent upon given average temperatures. This is implemented via JS/Keras Neural Network API. For most JavaScript frameworks, using D_Meta's model to predict is similar. Data Fields contain Predictions used to input index against test data/training data with Pivot.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt; 

&amp;lt;html&amp;gt; 

&amp;lt;head&amp;gt; 

    &amp;lt;title&amp;gt;Lemonade Sales Prediction&amp;lt;/title&amp;gt; 

    &amp;lt;script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"&amp;gt;&amp;lt;/script&amp;gt; 

&amp;lt;/head&amp;gt; 

&amp;lt;body&amp;gt; 

    &amp;lt;h1&amp;gt;Lemonade Sales Prediction&amp;lt;/h1&amp;gt; 

    &amp;lt;input type="number" id="temperature" placeholder="Enter Temperature"&amp;gt; 

    &amp;lt;button onclick="predictSales()"&amp;gt;Predict Sales&amp;lt;/button&amp;gt; 

    &amp;lt;p id="prediction"&amp;gt;&amp;lt;/p&amp;gt; 



    &amp;lt;script&amp;gt; 

        const modelUrl = 'path/to/your/model.json'; // Replace with your model URL 



        let model; 

        async function loadModel() { 

            model = await tf.loadLayersModel(modelUrl); 

            console.log("Model Loaded"); 

        } 



        async function predictSales() { 

            const temperature = parseFloat(document.getElementById('temperature').value); 

            const inputTensor = tf.tensor2d([[temperature]]); 

            const prediction = model.predict(inputTensor); 

            const sales = prediction.dataSync()[0]; 

            document.getElementById('prediction').innerText = `Predicted Sales: ${sales.toFixed(2)}`; 

        } 



        loadModel(); 

    &amp;lt;/script&amp;gt; 

&amp;lt;/body&amp;gt; 

&amp;lt;/html&amp;gt;  

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Case Study 2: Predicting Bike Sales in Time Series&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fh3hxo2holxaacsidweuo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fh3hxo2holxaacsidweuo.png" alt="Image description" width="800" height="567"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In addition to being familiar with beginners, another concept called Time Series prediction is forecasting the amount of unit sales or cash amount variables in the future by using the machine learning model. This is a JS module using Keras LSTM and TimeWindow to &lt;/p&gt;

&lt;p&gt;forecast next month sales through updating at each target pivot - in a sequential manner amongst different models. The default state of accomplishment is achieved when obtained time-series data wrapping is used surrounding Bikesales CSV inside the app-items for a time window of size four. Side value functions provided include chart_interval, define_target_field, file_selected, predict.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt; 

&amp;lt;html&amp;gt; 

&amp;lt;head&amp;gt; 

    &amp;lt;title&amp;gt;Bike Sales Prediction&amp;lt;/title&amp;gt; 

    &amp;lt;script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"&amp;gt;&amp;lt;/script&amp;gt; 

&amp;lt;/head&amp;gt; 

&amp;lt;body&amp;gt; 

    &amp;lt;h1&amp;gt;Bike Sales Prediction&amp;lt;/h1&amp;gt; 

    &amp;lt;button onclick="predictBikeSales()"&amp;gt;Predict Next Month Sales&amp;lt;/button&amp;gt; 

    &amp;lt;p id="prediction"&amp;gt;&amp;lt;/p&amp;gt; 



    &amp;lt;script&amp;gt; 

        const modelUrl = 'path/to/your/bike-sales-model.json'; // Replace with your model URL 



        let model; 

        async function loadModel() { 

            model = await tf.loadLayersModel(modelUrl); 

            console.log("Model Loaded"); 

        } 



        async function predictBikeSales() { 

            const last4MonthsSales = [/* array of last 4 months sales */]; 

            const inputTensor = tf.tensor2d([last4MonthsSales]); 

            const prediction = model.predict(inputTensor); 

            const nextMonthSales = prediction.dataSync()[0]; 

            document.getElementById('prediction').innerText = `Predicted Next Month Sales: ${nextMonthSales.toFixed(2)}`; 

        } 



        loadModel(); 

    &amp;lt;/script&amp;gt; 

&amp;lt;/body&amp;gt; 

&amp;lt;/html&amp;gt;  

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Case Study 3: Weather Forecasting Using OpenWeather API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fc5lruq7fchfhq5rafg8v.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fc5lruq7fchfhq5rafg8v.jpg" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A weather forecasting model utilizing the OpenWeatherMap API, the temperature, pressure, humidity, etc. are all used. This project is not advanced, but it is serving as a means of providing all the relevant inputs and thus providing the capabilities of fetching both historic as well as current weather data. City inputs are used for predicted temperature response, which hence can be created via a basic LSTM as outlined in case study 2. The JS model present wraps around the model located within the API via the server making use of Open REST API services. The experiment then provides final temperature forecasts and steps where particularly interested individuals can look at the code. Code is directly passed on to like-minded learners with the final experiment report being a pertinent means of deploying ready-made base models thereby updating the code for fetching competing yearly or weekly forecasts for every future workshop.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt; 

&amp;lt;html&amp;gt; 

&amp;lt;head&amp;gt; 

    &amp;lt;title&amp;gt;Weather Forecasting&amp;lt;/title&amp;gt; 

    &amp;lt;script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"&amp;gt;&amp;lt;/script&amp;gt; 

&amp;lt;/head&amp;gt; 

&amp;lt;body&amp;gt; 

    &amp;lt;h1&amp;gt;Weather Forecasting&amp;lt;/h1&amp;gt; 

    &amp;lt;input type="text" id="city" placeholder="Enter City"&amp;gt; 

    &amp;lt;button onclick="predictWeather()"&amp;gt;Predict Weather&amp;lt;/button&amp;gt; 

    &amp;lt;p id="prediction"&amp;gt;&amp;lt;/p&amp;gt; 



    &amp;lt;script&amp;gt; 

        const apiKey = 'your_openweather_api_key'; // Replace with your OpenWeather API key 

        const modelUrl = 'path/to/your/weather-model.json'; // Replace with your model URL 



        let model; 

        async function loadModel() { 

            model = await tf.loadLayersModel(modelUrl); 

            console.log("Model Loaded"); 

        } 



        async function fetchWeatherData(city) { 

            const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&amp;amp;appid=${apiKey}`); 

            const data = await response.json(); 

            return [data.main.temp, data.main.pressure, data.main.humidity]; // Example of features used 

        } 



        async function predictWeather() { 

            const city = document.getElementById('city').value; 

            const weatherData = await fetchWeatherData(city); 

            const inputTensor = tf.tensor2d([weatherData]); 

            const prediction = model.predict(inputTensor); 

            const forecastedTemperature = prediction.dataSync()[0]; 

            document.getElementById('prediction').innerText = `Predicted Temperature: ${forecastedTemperature.toFixed(2)}°C`; 

        } 



        loadModel(); 

    &amp;lt;/script&amp;gt; 

&amp;lt;/body&amp;gt; 

&amp;lt;/html&amp;gt;  

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

&lt;/div&gt;



&lt;h1&gt;Challenges and Future Directions&lt;/h1&gt; 

&lt;p&gt;&lt;strong&gt;How would I conclude if you may ask?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fi8par8aeqbm78k47nicd.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fi8par8aeqbm78k47nicd.gif" alt="Image description" width="390" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a student who is stuck between the likes of data science and web development I have actually come to understand that the goal of integrating JS with machine learning and data science has long been the ultimate goal of the package development journey of which I never knew is possible integrating the two in the very first place. In addition to practical techniques such as memory reuse, code optimizations, and benchmarking, some challenges were raised to the integration of JS with data science. Such efforts and experience are valuable, like for instance their insights provide an excellent starting point for further research. One of the main obstacles is that of the potential difficulty in working with polymorphic and nonspecialized data. Arrays in C, Python, and R tend to be more compact than objects, and for loops tend to be considerably slower for JavaScript with random access arrays than for JavaScript with fast integer-typed array methods. So what is your pick on that?...Do you also think integrating the two will go a long way especially if you're also stuck between the likes of data science and web development?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you read this far, please comment below and tell what you think, I will appreciate your inputs.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F8eu93a36gic31w1w3yea.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F8eu93a36gic31w1w3yea.gif" alt="Image description" width="250" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>machinelearning</category>
      <category>datascience</category>
    </item>
    <item>
      <title>React Hooks?</title>
      <dc:creator>Thatohatsi Matshidiso Tilodi</dc:creator>
      <pubDate>Thu, 23 May 2024 21:01:26 +0000</pubDate>
      <link>https://dev.to/thatohatsi880/react-hooks-14ka</link>
      <guid>https://dev.to/thatohatsi880/react-hooks-14ka</guid>
      <description>&lt;h1&gt;Introduction&lt;/h1&gt;

&lt;p&gt;Like as always, we will be asked the question on whether we have heard of React hooks or not. And just like the title suggested, today I am going to be discussing as well as covering React hooks and what they are. Now, hooks were introduced in React 16.8 and they are nothing but the addition of new features that have been released as part of 16.8. But before 16.8, state for components was only available in class components and to use states, we had to convert our functional components to class components. &lt;/p&gt;

&lt;p&gt;The reason they used to love functional components earlier was because of their simplicity. But according to the new way of using state in functional components, this enables us to create functional components that have states, so we can do data-related tasks using state in our functional components without any calls to the class components at all. &lt;/p&gt;

&lt;p&gt;Well then...This will be the first of many articles that will help us understand hooks better in React. There are many articles as well as documentation provided by React, helping us get the hang of hooks. I have tried my best to do the same but through this article, just to make your lives easier as well. I won't lie its still not yet the easiest route for me but I have also tried compiling all the code snippets that will help you figure out hooks from the beginning as well as try to get a small understanding of what hooks are and how to use them. &lt;/p&gt;

&lt;h1&gt;Overview of state management hooks&lt;/h1&gt;

&lt;p&gt;The useState hook is part of a set of hooks that are shipped with React, which allow us to add local state management to functional components. The values that are returned from hooks such as useState and useReducer are referred to as hook states.&lt;/p&gt;

&lt;p&gt;Using the useState hook, we can add state to functional components of React. This hook returns a pair of values which represent the current state of the application, and a method to update the value of the state. The method to update the state can take a parameter which is the new value to be assigned to the state. The useState hook accepts a parameter which is the initial value of the state when the component is rendered for the very first time. Its function signature is as follows:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;const [state, setState] = useState(initialState).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following hooks I will try to explore in this article:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;useState&lt;/li&gt;
&lt;li&gt;useReducer&lt;/li&gt;
&lt;li&gt;useContext&lt;/li&gt;
&lt;li&gt;useMemo&lt;/li&gt;
&lt;li&gt;useCallback&lt;/li&gt;
&lt;li&gt;useRef&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article, I will explore various hooks which belong to the category of state management hooks in React. There are many hooks such as useState, useReducer, useContext, etc. which provide us with the capability to declaratively manage state in functional components of React.&lt;/p&gt;

&lt;h3&gt;Using State Management Hooks&lt;/h3&gt;

&lt;p&gt;Here, you define a function component named Counter that returns a div element, with a paragraph element that displays the current state's counter value, and a button element for incrementing the counter's value when clicked. In line 5, the useState hook is called to initialize a state variable named counter with an initial value of 0. You destructure the array returned by the useState hook, and use the first element of the array as the state variable that represents the current counter state. This state is displayed in the paragraph element in line 7, within the caption element that is rendered as the children of the paragraph element.&lt;/p&gt;

&lt;p&gt;To keep track of component state within a function component, you can use the useState hook. This hook takes in a single argument, which is the initial state value, and returns an array with two elements: a state variable that keeps track of the current state's value, and a setState function that is used to update the current state, which triggers a re-render of the component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const Counter = () =&amp;gt; {
    const [counter, setCounter] = useState(0);
    const incrementCounter = () =&amp;gt; setCounter(counter + 1);

    return (
        &amp;lt;div&amp;gt;
            &amp;lt;p&amp;gt;{counter}&amp;lt;/p&amp;gt;
            &amp;lt;button onClick={incrementCounter}&amp;gt;Increment&amp;lt;/button&amp;gt;
        &amp;lt;/div&amp;gt;
    );
};
import React, { useState } from 'react';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope it’s starting to become a little bit easier to understand what hooks are doing right now and how these overall functions and features of React hooks will continue to make our lives much easier from here on. Well let's continue then yeah?&lt;/p&gt;

&lt;h1&gt; Understanding the useContext Hook using code snippets &lt;/h1&gt;

&lt;p&gt;These are known to creates a state that is accessible  from all the components.&lt;/p&gt;

&lt;p&gt;At first glance, the function UserProfilePage in the code snippet above might look like some TypeScript code. However, it is simple JSX. The following useContext call returns the current UserContext context value with its corresponding Provider's value. Although it might seem like a beauty overkill for getting access to the context value, useContext gives you a bit more elegance in the code and functions well in a functional component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function UserProfilePage() {
  const user = useContext(UserContext);
  return &amp;lt;UserProfile user={user} /&amp;gt;;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you saw in the examples above, direct usage of contextType is not possible without middleware libraries. &lt;/p&gt;

&lt;h1&gt; Introduction to useReducer Hook using code snippets&lt;/h1&gt;

&lt;p&gt;This one works exactly like the useState but the only difference is that unlike the useState having a single value, it contains an object.&lt;/p&gt;

&lt;p&gt;like for instance useState can store only one value eg. 1&lt;/p&gt;

&lt;p&gt;useReducer on the other hand stores the object that being multiple values.Meaning that it should be used when one has an object like for instances when wanting to name, age, contact detail....&lt;/p&gt;

&lt;p&gt;Like the instance below where there is one useReducer, compared to 3 useState's for each user values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function reducer(state, action) {
  switch (action.type) {
    case "increment":
      return { count: state.count + 1 };

    case "decrement":
      return { count: state.count - 1 };

    default:
      return state;
  }
}

const App = () =&amp;gt; {
  const [state, dispatch] = useReducer(reducer, { count: 0 });

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;{state.count}&amp;lt;/h1&amp;gt;
      &amp;lt;button onClick={() =&amp;gt; dispatch({ type: "increment" })}&amp;gt;Increase&amp;lt;/button&amp;gt;
      &amp;lt;button onClick={() =&amp;gt; dispatch({ type: "decrement" })}&amp;gt;Decrease&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};


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

&lt;/div&gt;



&lt;h1&gt;useCallback Hook&lt;/h1&gt;

&lt;p&gt;The useCallback() hook makes the function to be used within a child component so that a parent component pass to it will not re-render if its inputs are not changing. It can also be useful in that sense when wanting to pass props into the function&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Like for instance:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Returns the value 100
const apiResults = useMemo(() =&amp;gt; {
  return 100
}, [apiURL]);

// Returns a function, which then can be called
const getApiResults = useCallback((value) =&amp;gt; {
  return 100 + value
}, [apiURL]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;The useMemo Hook&lt;/h1&gt;

&lt;p&gt;The useMemo Hook in React is similar to the useCallback Hook. Keep in mind that useMemo is not memoization and should only be used when you have a performance optimization in your React application. useMemo can be imported from the React module by adding the following snippet in your &lt;strong&gt;JavaScript file: import { useMemo } from 'react'.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Defining your useMemo will look something similar to either of the following snippets. The main difference between the two is that the first piece of code directly defines the function, does not have function scope, and exists in the same scope as other hooks. The following script is an example of a direct &lt;strong&gt;useMemo: const cacheValue = useMemo(() =&amp;gt; yourFunction(arg),);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When writing React applications, using hooks is a great way to maintain variables, functions, and state in your application. useMemo is a useful hook that allows you to cache the value of a function call based on a specific dependency. You can think of useMemo as a caching behavior that React provides as a hook so that you can avoid re-calling a function or expensive calculation unless the specific dependency of a function changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useState, useMemo } from "react";

const App = () =&amp;gt; {
  const [apiURL, setApiURL] = useState("https://callAPI/");

  const apiResults = useMemo(() =&amp;gt; {
    callAPI();
  }, [apiURL]);

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;button onClick={() =&amp;gt; setApiURL("https://dummyAPI")}&amp;gt;Change API Url&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

const callAPI = () =&amp;gt; {
  console.log("Call API");
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;The useRef Hook:&lt;/h1&gt;

&lt;p&gt;One of the most frequently used hooks for certain types of side effects in React is the &lt;code&gt;useEffect&lt;/code&gt; hook. However, there's also a &lt;code&gt;useRef&lt;/code&gt; hook in React as well which is very useful to access a DOM element or some other value that persists across renders. &lt;code&gt;useRef&lt;/code&gt; returns a mutable ref object which can be initialized with the initialValue.&lt;/p&gt;

&lt;p&gt;The returned object will persist for the full lifetime of the component. The primary purpose of the &lt;code&gt;useRef&lt;/code&gt; hook is to store mutable data or values that would be lost on each re-render. Those values can be of type &lt;strong&gt;number, string, array, function, object, or any other type&lt;/strong&gt;that you could store as instance variable or class properties. Below is the type that shows on how the useRef can be used when wanting to create an input field and needing to access the value&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useRef } from "react";

const App = () =&amp;gt; {
  const inputRef = useRef();

  return (
    &amp;lt;input
      ref={inputRef}
      onChange={() =&amp;gt; {
        console.log(inputRef.current.value);
      }}
    /&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope this makes your lives easier especially for beginners in React like myself, and also feel free to leave your opinions about the article. Thanks.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Uhmm Virtual DOM In React?...</title>
      <dc:creator>Thatohatsi Matshidiso Tilodi</dc:creator>
      <pubDate>Thu, 23 May 2024 02:27:15 +0000</pubDate>
      <link>https://dev.to/thatohatsi880/uhmm-virtual-dom-in-react-3oo9</link>
      <guid>https://dev.to/thatohatsi880/uhmm-virtual-dom-in-react-3oo9</guid>
      <description>&lt;h1&gt;Introduction to the Virtual DOM&lt;/h1&gt;

&lt;p&gt;React was finally introduced to us the past two days and one of the topics that triggered my interest was the the virtual DOM. Well... based on my understanding, the virtual DOM is a brilliant technique that was invented to simplify the pain point of manually updating the actual DOM when a component's state or props change. It acts as an additional hidden layer that is very lightweight and can improve the performance of a web application. So meaning that everytime a component's state or props change, the virtual DOM will get re-rendered. It is important to understand that not the entire virtual DOM will re-render from scratch, but just the nodes that have changed will be updated. It is oOnly after the completion of the virtual DOM updates, the actual DOM also gets updated.&lt;/p&gt;

&lt;p&gt;So it actually makes sense to say that it is one of the most helpful features in developing UI using React is its ability to use a virtual DOM. This is because it is a lightweight JavaScript object which is a copy of the actual DOM. The creation of the virtual DOM is a one-time activity in the React context. Whenever a component's state changes, a new virtual DOM can be re-created. Under the hood it is said that React implements a reconciliation algorithm to help ensure the UI gets updated. It will compare the current and old state of a virtual DOM and based on the output, it will decide which nodes need to be re-rendered in the actual DOM.&lt;/p&gt;

&lt;h1&gt;Ever wondered on how it works?&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fw28yabgzycew11qrmhv8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fw28yabgzycew11qrmhv8.jpg" alt="Image description" width="800" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It came to my realization that it can be quite expensive to manipulate the DOM for every small thing. If we can solve as many changes as possible off of the real DOM, then we can minimize changes. Therefore, using a virtual DOM, we can decide that only a small part of the page has changed and tell React to only update parts that we care about. Besides improvement of efficiency in terms of reducing the frequency and area for actual manipulation in the real DOM with minimal updates, utilizing the concept of virtual DOM also allows the React application to track changes to components even if just part of the data changes.&lt;/p&gt;

&lt;p&gt;The virtual DOM (VDOM) is a programming concept where an ideal, or "virtual", representation of a UI is kept in memory and synced with the "real" DOM by a library such as React. This process is called reconciliation. In React, for every VDOM, there is a corresponding "real" parent VDOM that connects the tree to the root of the actual rendered HTML landscape. For a UI with a tree structure, we normally use a tree to describe all elements and their relationships. Each element is a node in the tree and the tree instantiation recursively adds to this further node instances, describing the relation between the child and parent nodes.&lt;/p&gt;

&lt;h1&gt;Consistent User Experience(Benefits of Virtual DOM)&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fkt15tynqg8o38ndquqqm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fkt15tynqg8o38ndquqqm.jpg" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I further learned about some of the benefits that come with using JavaScript. I’m assume that all my seniors in react development or those yet starting like myself use or at least have heard of a couple of JavaScript frameworks, and among them being Angular, Ember, Backbone, etc. Well we all know by now that React is popular for a couple of reasons like it’s simple to understand and use, plays well with different frameworks, it’s fast, and the one very big point is that it uses Virtual DOM. Other frameworks use the regular DOM model. They make changes directly into the DOM like adding a couple of nodes here or removing a couple of nodes there. Because of that, there are some problems and React solves all of these using the Virtual DOM. Let’s discuss these in detail in the next couple of minutes. First and important point: Optimization. With the normal DOM, it leads to re-flow and re-paint for every modification that happens in the DOM. &lt;/p&gt;

&lt;h3&gt;Wonder where I read that?&lt;/h3&gt;

&lt;p&gt;If you read Steve’s article (scrolling performance), you would understand that we should avoid re-flow and re-paint to make the scrolling performance good. And it might lead to performance issues. Well not with Virtual DOM, as React will write all those changes to the Virtual DOM first and then will do the re-flow and re-paint at the end. So making more changes will not affect your application and the user can interact with the page without any lag. That is, your application looks faster. It’s one of the important parts in providing a good user experience to the user.&lt;/p&gt;

&lt;h1&gt; Benefits of Virtual DOM in React&lt;/h1&gt; 

&lt;p&gt;&lt;a href="https://media2.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%2F9v2xghth7kih9nwroebk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F9v2xghth7kih9nwroebk.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Working with a Virtual DOM allows React to do a lot of cool stuff. With the help of currently available hardware, React can optimize and balance the different parts of a system like rendering, preserving state, and making the app still responsive. It's not just working with the Virtual DOM. The Virtual DOM is the way to make all components work in harmony.&lt;/p&gt;

&lt;p&gt;This is a system a developer can use to know what has changed and what needs to be modified in the actual DOM. React uses efficient heuristics to decide what changed in the Virtual DOM and it's able to update the actual DOM the best way. React makes sure the impact of updating the actual DOM is minimal and keeps it synchronized with the latest version of Virtual DOM. This feature is the key part of the conversation "React is fast".&lt;br&gt;
React uses the object pooler pattern to use memory that is allocated for components efficiently. This render-to-Virtual DOM compared with updating the actual DOM means React is increasing the performance of rendering and the user experience of your app.&lt;/p&gt;

&lt;p&gt;React is fast. While rendering and performing an update, it only works with Virtual DOM. &lt;strong&gt;It never updates the actual DOM directly.&lt;/strong&gt; This concept is similar to double buffering in window systems or computer graphics. Updating the Virtual DOM is a much cheaper operation than updating the actual DOM. This optimization helps developers to build complex, feature-rich and heavy apps.&lt;/p&gt;

&lt;h1&gt;Creating a virtual DOM element:&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fjii91dntj7ymrsmj73sg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fjii91dntj7ymrsmj73sg.jpg" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;jsx const parentDiv = React.createElement('div', { id: 'parentDiv' },
       [ React.createElement('h1', null, 'A title'), 
           React.createElement('p', null, 'Some content') 
         ]
            );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This helps us to maintain the markup and the JavaScript in different files and it makes it easy for us to maintain the JavaScript files and markup. This is a very small example of a virtual DOM created using React. We just need to remember that whenever we need to make a dynamic representation of the contents, we need to do it using a render method and return the virtual DOM element from it.&lt;/p&gt;

&lt;p&gt;For the above code, the equivalent JavaScript node structure will be:&lt;/p&gt;

&lt;p&gt;export default App; In this example, the render method gets called when the component gets created. We return the virtual DOM element from it. The HTML structure which we see in the form of JSX gets converted into a function and that function creates the equivalent JavaScript node structure of the DOM_ (M. Mohammad El-Basioni &amp;amp; M. Abd El-Kader, 2024) or Virtual DOM.&lt;/p&gt;

&lt;p&gt;Now that we have the environment ready, let’s create a virtual DOM element using React. Take a look at this example snippet where we create a virtual DOM element using React.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';

class App extends React.Component{ render(){ 

    return( 

    &amp;lt;div id="parentDiv"&amp;gt; 
    &amp;lt;h1&amp;gt;A title&amp;lt;/h1&amp;gt; 
    &amp;lt;p&amp;gt;Some dynamic content&amp;lt;/p&amp;gt; 
    &amp;lt;/div&amp;gt; 
  );
 } 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Barsocchi et al., 2021)&lt;/p&gt;

&lt;h4&gt; Using JSX?&lt;/h4&gt;

&lt;p&gt;In the first case, the virtual representation of the real DOM model is created and then assigned to the real DOM. Initially, when the page is loaded and elements are being created, React starts from the root and creates the entire virtual DOM. (Jain et al., 2019) (Olarotimi Badru et al., 2023) &lt;/p&gt;

&lt;p&gt;When the logic in the constructor changes the virtual DOM, React first applies the changes to the virtual elements and then searches for differences between the old and the new elements, and then it finally applies these changes to the real elements (Crijan 2020) (Jain et al., 2019). &lt;/p&gt;

&lt;p&gt;Armed with the basic knowledge of JSX and VDOM, let’s proceed with some code examples (L. Sega et al., 2022). I will not delve into the details of React or its components at this stage. This shouldn’t bother you much – with a snippet you don’t need to understand the entire system to see how the basic principles work. Below are code snippets in both JS/TS and JSX that depict working with React components, loops, JS operations and errors. Note that JSX snippets can be saved in .jsx or .tsx files (an optional syntax extension that can be used as a placeholder within JS).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Demonstrated in code snippet&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React comprises of different components and states associated with these components which reflect updates on the system. React’s component can be considered as part or extent of the DOM Tree. In case any component is changed then it impacts the resultant representation of the rendered tree. Within this phase, a representation (either a mapping or transpilation) is produced and used inside a renderer like a browser, via an HTML generation step or any kind of Visual DOM building. (&lt;a href="https://react.universome.io/html/virtual-dom" rel="noopener noreferrer"&gt;https://react.universome.io/html/virtual-dom&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;For coping with the large amount of rendered elements, React has adopted a concept of Virtual DOM. Through this Virtual DOM, React identifies the DOM elements associated with its components and during the execution, whenever update operation is performed, so React compares these changes with the resultant Virtual DOM if there are any changes then indeed these will be taken over to the real DOM. This concept/technique enhances the overall system performance. &lt;/p&gt;

&lt;p&gt;(&lt;a href="https://react.universome.io/html/introduction" rel="noopener noreferrer"&gt;https://react.universome.io/html/introduction&lt;/a&gt;). (Barsocchi et al., 2021) An example of how Virtual DOM works on React is shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react'
import Employee from './Employee'

// employee component 

function Employee() { 

const emp = { 
name: 'Peter', company: 'United Innovations', 
salary: 1500 }; 

return ( 

&amp;lt;div&amp;gt; 
&amp;lt;p&amp;gt;Emp name: {emp.name}&amp;lt;/p&amp;gt; 
&amp;lt;p&amp;gt;Emp company: {emp.company}&amp;lt;/p&amp;gt; 
&amp;lt;p&amp;gt;Emp salary: {emp.salary}&amp;lt;/p&amp;gt; 
&amp;lt;/div&amp;gt; ); 

} ReactDOM.render( 

&amp;lt;div&amp;gt; 
&amp;lt;h2&amp;gt;Welcome to the revealcoding.com refer to employee details.&amp;lt;/h2&amp;gt; 

&amp;lt;Employee/&amp;gt; 

&amp;lt;/div&amp;gt;, document.getElementById('root')); 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, content is initially is inside html representation. When user enters the url, at server side this code is converted/suggested to the client in the virtual DOM representation in the form of Babel that is when at client side, it calls the Javascript file at that time calling the ReactDOM.render function which would/evaluate the virtual DOM since, it would/evaluate virtual DOM into DOM representation.&lt;/p&gt;

&lt;h1&gt;Updating a virtual DOM&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fid4cmfo4gjdp3xyzwhwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fid4cmfo4gjdp3xyzwhwy.png" alt="Image description" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take the following example, to update the virtual DOM we don’t have to explicitly manipulate it ourselves because react automatically does this for us, react sees how the actual DOM looks now and compares it with a snapshot of the actual DOM that it took just before in the form of virtual DOM, afterward react applies all the necessary changes to the actual DOM to make it look like the virtual DOM, suppose a virtual DOM which is just a pattern of the actual DOM. If there is any changes in state or props, react will rebuild UI, but it does not necessarily mean that it will changes the whole actual DOM, it might only change a small part or add new items to the list. If you to work with virtual DOM, directly in react, then I have realized that one can make use of react-reconciliation, fortunately there is a library for that  that being react-reconciliation (L. Sega et al., 2022).&lt;/p&gt;

&lt;p&gt;React's virtual DOM is a lightweight copy of the actual DOM. To use React, we don’t need to directly manipulate the virtual DOM which is a good thing because, we know that any direct manipulation with real DOM can affect page performance, but sometimes we want our UI to update due to some update in state or props, so to update the UI, we have to update the virtual DOM earlier when react detects, any changes in virtual DOM, it updates the actual DOM accordingly, so in this article we will see, how to update this virtual DOM with the example set below (Bai, 2022).&lt;/p&gt;

&lt;h2&gt;Advanced Techniques for Updating Virtual DOM in JavaScript&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Code Snippets for Updating Virtual DOM&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The below snippet shows the component receiving new messages as props in every subsequent update. These messages are then rendered as a list of components – just like in a real-world chat application. On further mocking a chat application (after certain intervals), the new list of ChatMessage components is created. &lt;strong&gt;Like for instance:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default ChatWindow; 

   const ChatWindow = (props) =&amp;gt; ( 
   &amp;lt;div className="chat-window"&amp;gt; 
   &amp;lt;div className="messages"&amp;gt; 
     {props.messages.map((message, index) =&amp;gt; { 
   return &amp;lt;ChatMessage message={message} 
      key={index} /&amp;gt;; })} 
   &amp;lt;/div&amp;gt; 
   &amp;lt;/div&amp;gt; );

import './ChatWindow.css'; 
import ChatMessage from './ChatMessage';
jsx import React from 'react';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Look at the source code for the 'ChatWindow' component:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the above example, we have a 'ChatWindow' component. The message list of the ChatWindow is immutable which means it cannot be manipulated once created. This is to make sure that the message list cannot be directly mutated; rather, the new message list is created after every update.&lt;/p&gt;

&lt;p&gt;Additionally, for every message list update (every new message display in the chat application), a new ChatWindow component is created to replace the old one.&lt;/p&gt;

&lt;h1&gt;How do I conclude?&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F7x5rjlt6ydytlo8w829v.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F7x5rjlt6ydytlo8w829v.jpg" alt="Image description" width="474" height="94"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well if you have read till this far please leave your like and most importantly your comments on what you think you love about the article or where I can do best to improve. This really matters to me as I am also learning react. Thank you!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>frontend</category>
      <category>react</category>
    </item>
    <item>
      <title>Pre-made 3D illustrations and animated videos?... Another world beyond the ordinare!</title>
      <dc:creator>Thatohatsi Matshidiso Tilodi</dc:creator>
      <pubDate>Wed, 08 May 2024 23:18:06 +0000</pubDate>
      <link>https://dev.to/thatohatsi880/pre-made-3d-illustrations-and-animated-videos-another-world-beyond-the-ordinare-38a</link>
      <guid>https://dev.to/thatohatsi880/pre-made-3d-illustrations-and-animated-videos-another-world-beyond-the-ordinare-38a</guid>
      <description>&lt;p&gt;&lt;a href="https://uigraphic.com" rel="noopener noreferrer"&gt;Official Website&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think we can agree on the fact that more than 80% of people are visual thinkers. We remember 80% of what we see and do, and remember only 15% of what we read. Information in the form of infographics or similar elements is easy to perceive because these elements describe the information graphically. In addition, images are very attractive to viewers and they simply look more appealing. In 2020, the use of illustrations was already at its peak. The quality of illustrations is constantly improving, and the tastes and requirements of the audience are constantly increasing. Users have noticed that most web pages have similar design elements (photos, fonts, style), which resemble the products of many brands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Really the Purpose of the Website&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F6wa75m1m6vx0r0xjgkv9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F6wa75m1m6vx0r0xjgkv9.jpg" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One question that you might be asking yourself  right now is what is really the purpose of uigraphic.com website?... Well, enliven the featured pages by enhancing 1, 2, or even 8 themes per campaign of weekly posts featuring a subject that is a user's complaint. It can be an algorithm to sort lottery numbers, how to create more engaging compositions for photos (while explaining conditionals for dynamic light), or how they could render their own favorite room if the product aesthetics are about home furniture, for example.&lt;/p&gt;

&lt;p&gt;Headlines logically ending up with your projects as the ultimate resource are at the pleasant photo or video confluence. With a brief overview of the headlines, give the user the delimitation of these terms in terms of aesthetics, programming, and creative methodology. The text illustrates the most important idea so as to keep unanswered which would be the path. In the end, if there is something the user will be craving, it is understanding that every picture translation requires specific tech tools under skilled hands' expertise, even additional motion graphics would require a designated video. Only coming from you, and hence Uigraphic.com is there to help offer some of the customized design services to help meet specific requirements of clients.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fyz1tgfpp6obcsu8zxjvy.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fyz1tgfpp6obcsu8zxjvy.jpg" alt="Image description" width="800" height="624"&gt;&lt;/a&gt;&lt;br&gt;
The website basically helps you get the stylized polygonal 3D illustrations and animated videos for web or blog featured articles, newsletters, marketing promotions, or HR multimedia presentations. See, business is not just about inventing a great product or service, but also about creating awareness of it. The aim should be to have your media (web, blog) discovered, visited, and stay for a peek at the content while looking appealing to your company. Visual arts can give a sense of motion to it and integrating them within web, blog, or posts is not an easy task.&lt;/p&gt;

&lt;p&gt;Small themes of a handful of illustrations are given in the app itself. You are advised not to put them all or too many long videos on a single page, otherwise, the load time will become too slow. You have to create buttons or hot areas that load a particular video or paragraph/s. Photos are data saved by the user; videos take server resources on any platform, in addition to load time and advertising; thus, popular plugins will make you pay for heavy audiences by reaching the feature limitations(the harsh facts).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The benefits that come with Pre-made 3D Illustrations and Animated Videos you may ask??&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fgpahdbzddkte7hdhtrfd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fgpahdbzddkte7hdhtrfd.jpg" alt="Image description" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First would be the fact that animation adds colorfulness and softness to a drawing, but animation libraries, unlike 3D pack illustrations, can contain effects that superimpose similar elements, which is immediately noticeable on the site.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data on the market price of 3D pack drawings was taken from two popular sites. Even though many products may seem less expensive due to economic differences, they have proven themselves in the international market and in many countries.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fxa0i2jii5wgwyevhbkp3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fxa0i2jii5wgwyevhbkp3.jpg" alt="Image description" width="352" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To create pre-packaged drawings, templates are often used to purposefully reduce the time and cost of creating a single drawing, and so with uigraphic.com, the work does not suffer in quality, as it continues to be done by the hands of illustrators. Therefore, with pre-packaged drawings provided by Uigrapic.com are the golden mean in terms of purchasing a drawing for an individual task. With the help of these drawings, you can quickly and affordably get a pair of characters, a difficult situation for the page, or a modern solution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fjxyu24qfi91oj5kr6ues.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fjxyu24qfi91oj5kr6ues.jpg" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Handcrafted cliparts from stock sites have come to the rescue, but the increased template-style use of the same drawings in websites significantly decreases the credibility of the business. In the post-coronavirus market, progress in the tools and services of the creative economy has become in demand, forcing illustrators to turn away from unique illustrations in favor of more reusable drawings. This is where uigraphic.com gadges in as they help cultivate the culture that cherishes ongoing creativity and innovation, pushing the limits of artistic expression in each illustration and 3D video crafted by the team itself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Custom illustrations are sometimes prohibitively expensive for startups. The market price in 2021 starts at $1k for one custom illustration and can last for several weeks. The demand for creativity on the part of the customer is increasing, but many businesses cannot afford to wait weeks for the final implementation by the artist. And so with every client uigraphics.com places them at the forefront by comprehending their distinct requirements, delivering tailored solutions and surpassing expectations in providing illustration and 3D video services&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Services Offered?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ever wondered what are some of the services that UIgraphics.com might offer?...Well, you don't need to stress out creating your web presence from scratch or being slow and old-fashioned with your marketing strategies, trying to deliver your message vaguely. &lt;/p&gt;

&lt;p&gt;Using pre-made 3D illustrations by the website itself  is a satisfactory solution for businesses looking to improve their digital strategy and look professional. Creating professional complex 3D illustrations takes a lot of time and skill. This means if you want to look professional with 3D design, you could either spend years practicing and getting familiar with countless resources and complicated software, or hire an expensive designer to do the work for you. With uigraphic.com, you can simply drag and drop their objects and use the hand-made pre-made scenes to improve your marketing materials, your presentations or your website and make it look professional and eye-catching.&lt;/p&gt;

&lt;p&gt;With so many products, services, and companies offering almost the same advantages and drawbacks, it becomes more and more complicated to stand out from the crowd and capture the attention of the right target audience. Marketing specialists across the globe fancy digital pieces of art to promote businesses. Still, good 3D illustrations and animated marketing materials are both costly and time-consuming to develop. Uigraphic.com is dedicated to solving this issue with easy-to-use customizable solutions that people with no graphic design knowledge can manage&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enhanced visual appeal&lt;/strong&gt;&lt;br&gt;
It is unfortunate how small budget websites have a very hard time improving their website branding because they simply cannot afford high tier illustrative illustrators. Furthermore, some do not even have the need for artworks more complex than a simple mouse. &lt;/p&gt;

&lt;p&gt;Uigraphic.com created 3D illustrations are the solution to this problem. Made for the same user that works with rectangular modern web design, by using rectangular 3D models, as a result, the renders of the same assets look good in nearly all designs.&lt;/p&gt;

&lt;p&gt;Our eye loves details. The more visually interesting the object is, the more likely it is that the user engages with it. That is a fact we see every day when we see people not only looking at but browsing and actually interacting with objects of interest to them. The interesting part for 3D illustrations is, they can have the same appeal while looking more simple and are much faster to render and modify than real-life based objects. &lt;/p&gt;

&lt;p&gt;Pre-rendered 3D illustration of Uigraphic.com has the capability to emphasize a website’s UI by simply making clickable objects more interesting to look at. When an object has a serif font title and is of black or some subtle color, the user will understand this is content, but when the content is interesting and not only a black rectangle, the user might subliminally expect some aspect of that label to be interactive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time-saving solution&lt;/strong&gt;&lt;br&gt;
The convenience through using UI: By purchasing a pre-made 3D illustration with Uigraphic.com in isometry, the buyer does not have to think about scenes, characters, thematic banners, and color solutions. The color solutions in all the products of the 3D illustrator are selected according to a single template, which allows them to be successfully combined on the page. Due to the availability of 3D graphics from a designer, who, by creating pages of all possible categories of websites, applications, and presentations, conducted a study that let us know what subjects are most popular with the designers. &lt;/p&gt;

&lt;p&gt;The designer of the 3 Studios, in turn, created thematic packages, each of them special attention to characters, which means that in our studio a storyboard was developed and green circles were recorded in scenes where the author saw a bright presence of a lively character.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fsl02c9mzatzsskcx59ng.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fsl02c9mzatzsskcx59ng.jpg" alt="Image description" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Collection of pre-made 3D illustrations of Uigraphic.com is the most time-saving solution for graphic designers working in 3 Studios or as freelancers. Modern integral illustrations in isometry and axonometry continue to gain popularity in the design of mobile applications and commercial sites. &lt;/p&gt;

&lt;p&gt;The variety of Uigraphic.com in style and implementation is hard to imagine, but the use of 3D illustrations made in similar perspectives drastically simplifies the process of creating pages for a mobile application, since the product makes it possible to quickly combine scenes and characters, and also offers to make ready-made devices. An opportunity to take a header or footer that suits the author in style and subject matter. The products are represented by packages of devices, scenes, and character sets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost-effective option&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Low-cost quality images can also help in the projects. Pre-made 3D graphics in vector format enable graphic designers or entrepreneurs to play with the color, shape, and size of the graphics freely. These vector forms are more advantageous for large size banner prints, hoardings, and LED displays because they are machine independent regarding the generation of large size output. There are many unique and realistic images available. &lt;/p&gt;

&lt;p&gt;There are no two images of the same chair with the same features. Every image is unique and has its style. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tailored Solutions for Web&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As AI solutions anticipate creations more and more of the socio-cultural or simple visual aspects, rather than being ordered a quick injection of the hot topics - such as "Stranger Things illustrations" some of which are created overnight and cover the entire TV season - design teams will be pushed to think outside the box and develop tailored design solutions for future opportunities - such as the redesign of a food industry country leader's employees' feedback one-pager. &lt;/p&gt;

&lt;p&gt;At Uigraphic.com, they are there to make sure that design solutions are not only tailored to the needs of the single clients and design teams community, but also to advise which design elements could be relevant for your business, digital products, and sales and marketing tools. This will also help diminish design costs, shorten delivery times, and enhance products and their interactions, or replace/invigorate processes and activities that either don't bring results or are gamified already by AI solutions.&lt;/p&gt;

&lt;p&gt;Tailored design solutions are the future of the visual design world, not only because there are more and more people who need them - bloggers, influencers, and an endless list of startup businesses - but also because new software capabilities and users' knowledge about its usage are making creative processes easier, faster, and more accessible. This not only assists in the easier creation of commonplace projects - such as illustrations on any subject that are faster to create and possibly more to the client's liking - but it also pushes creative teams to think outside the box and create a path from here to the future that doesn't require so much manual workforce.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Responsive Web Development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fk1ftkeqgb0dz40ep2anr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fk1ftkeqgb0dz40ep2anr.jpg" alt="Image description" width="800" height="432"&gt;&lt;/a&gt;&lt;br&gt;
A visit to this project with the phone or a large tablet of designer owners is provided by compact versions of the Uigraphic.com site, in which keep all necessary to purchase a product and make an application of the components. &lt;/p&gt;

&lt;p&gt;Web development in a market where more than 70% of traffic is from the phone is becoming a high-level goal for the right announced solutions of the web. The project does not provide universal goals of adaptability to any platform for any screen resolution. There is an account for most popular decisions of what are the principles of design in the case of adaptations of design of the web for mobile devices from the computer.&lt;/p&gt;

&lt;p&gt;As the main version of the site is for the mobile screen, we can safely consider the presence of a version of the site for the PC. The full functionality of JavaScript forms on the web project, placing order and registration will not be feasible in the version of the site for the mobile phone. As a result, the output, it is possible, are intrigued about the visitor in order to consider issues of placing information, even in the variant of the site appearing to make a decision about a purchase on a PC.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And How I would conclude?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fhq09r61nxdsp9i9zh6xs.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhq09r61nxdsp9i9zh6xs.jpg" alt="Image description" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Uigraphics.com website features an easy-to-use interface that allows users to find and get familiar with design templates, as well as buy the ones they need just in a few clicks. Throughout its development process, the main idea in mind was to meet the needs of non-tech-savvy users without sacrificing power and flexibility of the website. &lt;/p&gt;

&lt;p&gt;A wide range of tools has been autonomously short-listed for implementation and then integrated in such a way that website visitors can use them intuitively and effortlessly. A definite world where you can unleash top-notch digital products for the finest projects globally. I hope you can consider stepping into Uigraphic.com platform, I can assure you that you will never regret it.   &lt;/p&gt;

</description>
      <category>ui</category>
      <category>webdev</category>
      <category>ux</category>
      <category>discuss</category>
    </item>
    <item>
      <title>The Document Object Model</title>
      <dc:creator>Thatohatsi Matshidiso Tilodi</dc:creator>
      <pubDate>Sun, 05 May 2024 16:31:36 +0000</pubDate>
      <link>https://dev.to/thatohatsi880/the-document-object-model-4dk8</link>
      <guid>https://dev.to/thatohatsi880/the-document-object-model-4dk8</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.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%2F1u3wq1gurvvxkv46azw9.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F1u3wq1gurvvxkv46azw9.gif" alt="Image description" width="500" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From my basic understanding of the Document Object Model also known as the DOM is that it is a type of model that allows program code to access and manipulate(adding, changing, or removing) the structure of the properties of any hosted document. With HTML or DHTML documents, I know one may ask what the "hosted Document" is but that generally means the displayed web page. This configuration is sometimes called a "web context", or "web browser". Client-side JavaScript is noted for its widespread use of the DOM as it is the combination of these three components namely, a browser with functionalities to show a web page, the web page loaded in your browser, and a popular programming language known as the JavaScript. &lt;/p&gt;

&lt;p&gt;An example would be that of functions, both built-in and tamper-resistant using JavaScript extensions, which help provide for direct manipulation of displayed documents. Furthermore, it is also possible to add, remove, or substitute a displayed content element for another. For example, graphical media can be added to then removed from an HTML file at the urging of a user, or an HTML element's spelling or other property can be temporarily replaced yet this substitution can be both temporary and reversible. Throughout this article, I will try elaborate further into it and even conclude with an implementation scenario.&lt;/p&gt;

&lt;p&gt;So in the beginning there was HTML and it was good. HTML stands for HyperText Markup Language, which is a rather a name for simple markup. With HTML, as an author, you can declare text to be a certain way like for instance large, bold, italic or even a different color. You can divide the text into sections, create lists, insert images and links to other pages, and much more. You create your document and put it on an Internet or an intranet server where it can be read by anyone in the world with an Internet connection. However, as good as HTML is at displaying or formatting a page, it does not allow you to manipulate the page. To access and manipulate extended HTML documents after they are delivered to the browser, a new technology was needed and this is where the object model of a document comes in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fbf10wjsm07qnijvusopn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fbf10wjsm07qnijvusopn.jpg" alt="Image description" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Jumping right straight into the structure of the associated document is available on view and makes up the nodes of the logical tree. All meaning that the document is simply the root of the DOM tree. The children of the highest document are always the "HTML" element such as the (Document object) and the DOCTYPE (DocumentType object). All other nodes are accessible by traversing them, or it is possible using "where" methods to refer directly to the elements in the document.&lt;/p&gt;

&lt;p&gt;As I have specified earlier, the DOM is an object-oriented, event-driven interface. Meaning that it is widely accepted that the manipulation of DOM objects is the core of many programs. Most of the lack of browser’s use of another system is a result of the "object model" design because the association from HTML elements to their respective nodes is  stored before anyone knows which element the node corresponds to. The careless treatment associated with such associations, as well as the presence of several different objects on each page can lead to unpredictable results not specified in the language documentations that being W3C or also known as the World Wide Web Consortium. When going through the structure itself I realized that there are actually two forms of DOM - the Level 1 (DOM-1) and Level 2 (DOM-2); a third one, that is the present development of the association.&lt;/p&gt;

&lt;p&gt;The Document Object Model, or DOM, is a programming interface, or platform-specific framework, meaning that it connects web pages to scripts or programming languages. It was introduced by the World Wide Web Consortium (W3C), the Netscape Communications Corporation and enabled by ActiveX Technologies. Like I had specified earlier that the DOM is separated into three different parts, each of which represents a different part of the web page. The DOM was designed to be platform-independent and language-neutral, meaning that it allows programs and scripts to update the content, structure, and the style of documents. It further represents a document with a logical tree.&lt;/p&gt;

&lt;p&gt;Every document in a browser environment has built-in objects based on the information present in the document, and it is always based on a tree structure. The Document Object Model (DOM) represents a document within a browser. DOM has its own way of representing and populating a document tree, which is called the DOM tree. The web document has an XML representation, and the details in the XML are exposed to scripting through an interface in a host language. The DOM tree of the web document, whenever created, is always mutable, which means the content within a node is always allowed to be changed. Each type of node in DOM has properties that are associated with that particular type. Usually, through these properties, the users of web-based information can easily access and manipulate the DOM for the script interaction.&lt;/p&gt;

&lt;p&gt;The DOM provides a variety of properties to access, traverse, and manipulate the structure and content of the document. This further came to my understanding that the properties found in the DOM can be broken up into two main categories namely accessibility properties and language-specific properties. JavaScript has access to property interfaces listed in the DOM via the JavaScript hosting environment. In other words, these host's objects are available to the language via the browser, server, or platforms that host them. Most of the key members of the DOM objects are user agents' properties, both language questioner and user agent's model, which allow for greater access, manipulation, and behavior of the document object model. Moreover, the DOM contains more than a thousand methods, events, and properties. &lt;/p&gt;

&lt;p&gt;In this article I primarily focus on the overview of the following properties of the Document Object Model (DOM) for HTML elements. However, there is also an overview of setting conditional checks on the private property of HTML elements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Properties&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fbzm4iiy9saoanxvqtfxl.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fbzm4iiy9saoanxvqtfxl.gif" alt="Image description" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Elements of a document can be accessed and changed by using the properties of the DOM. By using these properties, the size of the window, the current URL of the page, and its title can be found. These properties are also useful for finding the "href" attribute, the "src" attribute, and the text content of elements in the document. These properties vary in their use and interpretation in different browsers. It is suggested to prefer the official browser for proceeding with the demonstration of the use of these properties. This further came to my understanding that the application of browser features can only run with specific versions and limitations. &lt;/p&gt;

&lt;p&gt;The object's property can be different from one browser to another, so in order to avoid confusion, the following example application has to be performed with browsers like Google Chrome, Firefox, Opera, or Internet Explorer. Amongst many properties used in the DOM, some of the common properties like window, window.navigator, window.screen, window.history, window.location, and window.document are listed below.&lt;/p&gt;

&lt;p&gt;To simply place it in simple term, a document creates a DOM at the time of page loading. This DOM is translated into the live layout of the page. After a document is created in the form of DOM, it can be manipulated by a program or JavaScript. Manipulation of the document to me simply means adding, changing, or removing elements or contents. When a change occurs in the DOM, it reflects in the live layout of the page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fl98udlkwbrxgnfgqautu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fl98udlkwbrxgnfgqautu.jpg" alt="Image description" width="705" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So still have your misunderstandings about the model?...Well on how I would conclude my understanding about the DOM is that I understand that a Web page is a document written in HTML containing various tags. "html" is the root tag of the document and contains two children - "head" and "body". The head section of the document contains information about the document and the body displays it. All contents of the document reside inside these two tags. These tags are also called elements of HTML.&lt;/p&gt;

&lt;p&gt;And so that further applies to the Document Object Model (DOM) as it is a programming interface for web documents. It represents the page so that programs can change the document structure, style, and content. The DOM represents the document as nodes and objects. That way, programming languages can connect with the page.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>learning</category>
      <category>html</category>
    </item>
    <item>
      <title>More About CSS?</title>
      <dc:creator>Thatohatsi Matshidiso Tilodi</dc:creator>
      <pubDate>Tue, 30 Apr 2024 14:52:05 +0000</pubDate>
      <link>https://dev.to/thatohatsi880/more-about-css-4lii</link>
      <guid>https://dev.to/thatohatsi880/more-about-css-4lii</guid>
      <description>&lt;p&gt;At first, modern CSS reset was nothing more than doing a "ctrl+a, ctrl+c" on a browser page, then pasting the copied HTML into a text file in order to save the element structure. Then if you were really, really hardcore, you would have saved each default.css from each browser release and carefully analyzed which settings change and which stayed the same. This would be very inefficient with the release of browser-specific hacks and other methods to try and fix one element's style across all browsers.&lt;/p&gt;

&lt;p&gt;An example of this is the default margin and padding settings that differ between almost every browser on almost all elements. Because of this, a lot of developers threw away the idea of default styling and immediately applied their own custom CSS to all elements. Of course, this also has the effect of choosing a look for your element using your own CSS, and pasting the same element code onto another web page will not yield a consistent look. But I digress.&lt;/p&gt;

&lt;p&gt;CSS, or cascading style sheets on the other hand, is a method of applying specific style changes to web pages. It was introduced in 1997, and it focused upon style and structure. A picture of the modern browser was not in the minds of the creators of CSS, but rather print media. This will have an effect on the work later on because it leads to a lot of browser inconsistencies and unusual default settings for elements.&lt;/p&gt;

&lt;p&gt;So say for instance you’re trying to build a website! You have a great plan and some people from the neighborhood have expressed interest in making use of the internet! But where to start? Well, the best place is with all the hidden default styling provided by the browser itself. But first, a little history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Benefits of Using a CSS Reset&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First and foremost, this is the benefit that is usually stated by reset advocates. The idea is that if you build on top of a reset, you can be sure that your design is consistent across all browsers that you need to support. &lt;/p&gt;

&lt;p&gt;Since your design has a baseline starting point on all browsers, when you're careful to use the same CSS for the same structural purpose throughout the design, you should see a more consistent rendering in terms of spacing, positioning, text size, etc. While this definitely can save some debug time with regards to odd layout and margin issues, it's not necessarily foolproof. It could be quite difficult to get "the same CSS for the same structural purpose" to work cross-browser, and even if you buy into that, it's not to say that your design will look the same on old versions of browsers that you're trying to support—as those old browsers don't necessarily have a correct implementation of CSS. &lt;/p&gt;

&lt;p&gt;However, every bit helps, and this is a valid point with regards to seeking consistency in your designs across the multitude of browsers out there.&lt;/p&gt;

&lt;p&gt;When starting a new CSS-based project, it's often tempting to zero out the browser's default styles, remove some of the common non-semantic styling that most browsers apply, and clean everything up with a fresh and clean design. Not having all the headaches and conflicts, and avoiding the compatibility problems that can occur when building on top of browser defaults is a valid reset advocate's approach.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Advantages of Using a CSS Reset&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages of Using a CSS Reset&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Introduction
The first ever offering of a CSS reset file, to the best of my knowledge, came out of a discussion on the web development forum I once observed. The goal of the file was identical to the reset styles posted above, but it began with the universal selector. After many debates and arguments, it was finally clarified, and this is now the most commonly known form of CSS reset.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The advantage here, rather than using a pre-made CSS reset file, is that you can see specifically which styles are being reset, and you can very easily delete the reset styles if you find that you have problems in the future. This can save loading time if you're wanting a quick solution.&lt;/p&gt;

&lt;p&gt;In its simplest form, a CSS reset is a set of CSS rules that removes all the styling provided by the user agent's default styles. This is often used as a starting point when creating your own CSS. The reset styles given here are intentionally very generic. There isn't any default color or background set for the body tag, which is why it doesn't show up unless you set it. Usually margins are not set on the p and h1 elements in the browser's default stylesheet, so I felt the need to add them in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.1. Overview of CSS Reset&lt;/strong&gt;&lt;br&gt;
The reason they look like that is because the default stylesheet that the browser applies has certain rendering rules for HTML elements. These default styles are quite different from how most web developers want their site to look. IE 7 is quite close to how most developers want it, so only one or two CSS hacks are needed to help fall in line with how the W3C wants the standards to be. So, mostly, the CSS Reset is for people who want to make their sites look the same in all browsers to save debugging time tweaking the site.&lt;/p&gt;

&lt;p&gt;Every web designer's goal is to avoid the problems related to inconsistent appearance between web browsers. The aim of using a CSS Reset (or CSS Normalization) is to reduce inconsistencies across browsers. By including a CSS Reset in your CSS style sheet, you can have more consistency in the default style rendering of current browsers. Things like IE 7 have some weird margins and misalignment of the text and form elements, as well as the much-dreaded large padding on the ul. For example, if you create a simple CSS-only menu without any margins and padding, and test it in each browser, you will see that they all look slightly different.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.2. Purpose of CSS Reset&lt;/strong&gt;&lt;br&gt;
Resetting an element's CSS to a clean slate is a more solid approach. By utilizing a CSS Reset, designers can start afresh and avoid accidentally incorporating browser inconsistencies into their designs.&lt;/p&gt;

&lt;p&gt;Many web developers appreciate the simplicity of using default browser styles as a solid foundation to build their unique designs on. This allows for a platform where designers know how different elements will render. However, this approach is riddled with well-documented browser inconsistencies and this is something that creates a lot of avoidable work for no added value.&lt;/p&gt;

&lt;p&gt;Normalize.css is a customizable CSS file that makes browsers render all elements more consistently and in line with modern standards. We researched the differences between Normalize and CSS resets and detailed our findings in a succinct blog post.&lt;/p&gt;

&lt;p&gt;A CSS Reset (or "Reset CSS") is a short, often compressed (minified) set of CSS rules that resets the styling of all HTML elements to a consistent baseline. In essence, it's like a 'nuclear' option, it erases all styling and reverts the elements to a consistent base state. This is useful because while it is often only a few lines of code, it saves a lot of time in the long run and ensures you improve cross-browser consistency.&lt;/p&gt;

&lt;p&gt;Erasing properties and default browser styles is a crucial aspect of making elements appear the same cross-browser. There are a variety of ways to do this, some serve to reduce browser anomalies and improve consistency, others require more work but are ultimately more thorough.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/* Box sizing rules */&lt;br&gt;
*,&lt;br&gt;
*::before,&lt;br&gt;
*::after {&lt;br&gt;
  box-sizing: border-box;&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
The meaning of this rule is quite obvious, so I will explain it briefly: I am making all elements and pseudo-elements use border-box for sizing instead of the default content-box. Since we are now more concerned with giving browsers the ability to handle flexible layouts that involve fluid type and space, this no longer holds as much value as it used to. However, there are few projects that don’t have any explicit sizing somewhere; therefore, it remains relevant in resets.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;html{&lt;br&gt;
  -moz-text-size-adjust: none;&lt;br&gt;
  -webkit-text-size-adjust: none;&lt;br&gt;
  text-size-adjust: none;&lt;br&gt;
  }&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The reason for that is, Mobile Safari bumps up the default font-size when you move a website from portrait to landscape. This only happens on phones — it does not do it on iPad. Safari has done this for a long time as a way to make non-mobile optimized websites more readable. While undoubtedly useful during a time when literally zero websites were optimized for mobile devices, it’s far less helpful now.&lt;/p&gt;

&lt;p&gt;You can control this font-size inflation with the -webkit-text-size-adjust property. You can set this property to a percentage of your choice (the maximum text size increase), ‘auto’ (default behavior which enlarges the text) or none (which prevents text from zooming in). Setting it to 100% will be equivalent to ‘none’.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/* Remove default margin in favour of better control in authored CSS */&lt;br&gt;
body, h1, h2, h3, h4, p,&lt;br&gt;
figure, blockquote, dl, dd {&lt;br&gt;
  margin-block-end: 0;&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Above I am removing all the margins instead of sides in the older reset&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */&lt;br&gt;
ul[role='list'],&lt;br&gt;
ol[role='list'] {&lt;br&gt;
  list-style: none;&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The above is basically a feature where when you remove a list styling, the semantics for voiceover will also be removed. Removing the list styling default will need to removed as it serves as a little reward&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/* Set core body defaults */&lt;br&gt;
body {&lt;br&gt;
  min-height: 100vh;&lt;br&gt;
  line-height: 1.5;&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The above is a line height that gets inherited. A min height like a 100vh helps alot especially when you going to set a decorative element. Also, svh unit is said to be much better than dvh, but vh actually takes the cup&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/* Set shorter line heights on headings and interactive elements */&lt;br&gt;
h1, h2, h3, h4,&lt;br&gt;
button, input, label {&lt;br&gt;
  line-height: 1.1;&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Definitely comes in handy when using the line-height, as it is equally handy to have a shorter line-height for both buttons and heading. also helps fonts not clash.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;* Balance text wrapping on headings */&lt;br&gt;
h1, h2,&lt;br&gt;
h3, h4 {&lt;br&gt;
  text-wrap: balance;&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
The text wraps on heading helps give a good look to the headings&lt;/p&gt;

&lt;p&gt;`&lt;br&gt;
/* A elements that don't have a class get default styles */&lt;br&gt;
a:not([class]) {&lt;br&gt;
  text-decoration-skip-ink: auto;&lt;br&gt;
  color: currentColor;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;`&lt;br&gt;
The rule above is to help the text decoration not interfere with ascenders and descenders. From the currentColor, helps text inherit color too.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/* Make sure textareas without a rows attribute are not tiny */&lt;br&gt;
textarea:not([rows]) {&lt;br&gt;
  min-height: 10em&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If the textarea is used the rule that becomes a lot handy,  elements are used for multiple lines of texts&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/* Anything that has been anchored to should have extra scroll margin */&lt;br&gt;
:target {&lt;br&gt;
  scroll-margin-block: 5ex;&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;scroll-margin actually adds a space above an element after it has been anchored&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>CSS SPECIFICITY?</title>
      <dc:creator>Thatohatsi Matshidiso Tilodi</dc:creator>
      <pubDate>Wed, 17 Apr 2024 10:53:50 +0000</pubDate>
      <link>https://dev.to/thatohatsi880/css-specificity-32em</link>
      <guid>https://dev.to/thatohatsi880/css-specificity-32em</guid>
      <description>&lt;p&gt;&lt;a href="https://acrobat.adobe.com/id/urn:aaid:sc:EU:e1ba4583-4ade-46ab-9e74-dc629ba19e00" rel="noopener noreferrer"&gt;Original Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have always wondered where CSS specificity comes in but after today’s lesson, it came to my understanding on how the conflicting information is resolved as it is not possible to reliably style any kind of HTML document.&lt;/p&gt;

&lt;p&gt;Many developers new to web design like a learner myself are often confused by this issue. As I would do to compile a style sheet with set font and colour information and then apply it to the document, only to find that it looks nothing like what I intended. This is usually due to the conflicting style information from the site's existing styles as I explained above. One would wonder how this happens?&lt;/p&gt;

&lt;p&gt;Well I learned that when a document has a style sheet, the information in it can be conflicting. If the style information on a certain element conflicts with a style on a document-wide level, how do you know which style will be used?...this is where the CSS (Cascading Style Sheets) comes in as it is a language used for describing the look and formatting of a document created in HTML. This includes defining the colours, font types and sizes, positioning, borders, and so forth. Although HTML is concerned with defining the structure of a document, CSS is the means by which you can create the look.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is CSS specificity?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the things I have also picked up in today’s lesson was the importance of the advantage of using CSS in the separation of content from presentation. In other words, I understand that it helps separate the structure of a document from the styling of the document. Now, when an HTML document is provided, the browser translates the content of the document to the structure by using the mark-up, and then it tries to represent that structure to what everyone can see visually. The advantage of separating content from style starts being lost when an HTML element can be styled in multiple ways and the styling can contradict itself. This is where CSS specificity comes in as it provides a solution for this problem.&lt;/p&gt;

&lt;p&gt;CSS specificity is the set of rules that decide the level of importance of a specific style to be applied to an element. Specificity is also said to be calculated on the matching of a selector against the content of an HTML element. As quite confused as I was before the lesson had started I further learned that specificity is not based on the declaration of styles in a style sheet (like for instance internal or external), but it is based on the selectors and declaration of styles. In other words, CSS specificity helps in deciding which rule to apply for a certain element.&lt;/p&gt;

&lt;p&gt;For example, a rule that contains a single ID selector is more specific than one with 1000 element selectors. Consider the following list from most specific to least:&lt;br&gt;
What color will the text be? Having decided that the text should be green, testing in the different mainstream browsers will yield different results. This is because the p element in the second rule has more specificity than the #page which just has one ID attribute. Specificity is a weight that is applied to a given rule, determined by the number of each type of selector. A CSS rule is considered more specific the more information it has defining it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why is CSS specificity important?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I mean one of the things I have never learned ever since I started my journey in web development was the importance of specificity. Well CSS specificity can help prevent this 'style leakage' (eww), by ensuring that the more specific a selector is, the more precedence it will have over another less specific selector. This is why it is important to keep your styles in a document as organised as possible. By being more selective with the selectors you choose (pardon my pun) you can write less lines of CSS and achieve style results that are expected and easier to maintain. &lt;/p&gt;

&lt;p&gt;So why is it important? Doesn't it just overcomplicate things, and cause frustration when your styles aren't behaving as expected? Well, in answer to the latter, to me, it certainly causes frustration, but the reason it's important is because it helps keep the styles in your stylesheet as organised and clean as possible, whilst minimizing the amount of overriding that occurs in your styles. When first writing a stylesheet, it's easy to just slap some styles in for a particular class(.) or ID(#) at the end of the sheet, just to make sure its styled as you'd like. However, when writing styles further for the same element, let's say for another ID that the element may have, or for a special case of the element using a class, these initial styles can get overridden or 'leaked' onto other elements that you didn't initially want them to.&lt;/p&gt;

&lt;p&gt;Imagine you're working on your site's CSS and you've finally corrected that bug that's been driving you crazy for weeks. You refresh your site and... the bug's still there! After a few minutes muttering to yourself, you realise that the bug doesn't lie with the CSS you just edited, but with some other CSS elsewhere in the code. Maybe further down the page, or perhaps the style is being overridden by the style of an external PDF, or heaven forbid, an !important declaration! If you've experienced this, which I can attest that I have experienced that plenty of times then you know that you've experienced the pain of CSS specificity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does CSS specificity work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How we were taught in today’s lesson was to work from right to left in the selector and create a 3-digit number by adding:&lt;br&gt;
**- 100 if the statement is in the form of #id&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;10 if the statement is in the form of an element (e.g. div, h1, a, etc.)&lt;/li&gt;
&lt;li&gt;1 if the statement is in the form of .class
... unfortunately no other possibilities exist for CSS specificity.**&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So what I understand from the above is that each selector has its own specificity value. A CSS statement may conflict with another CSS statement that is declaring the same thing. More specific behavior always wins. To figure out which CSS statement is more specific than the other, you will have to look at the formula that calculates the specificity. This is a little more complex, but I was also assured at the beginning of the class that it's very simple once you get the hang of it.  One should add a 1 if the declaration:&lt;br&gt;
**- Is in an internal style element&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is in an external style sheet&lt;/li&gt;
&lt;li&gt;Is in an external style sheet but has been referenced from the attribute of an HTML tag
...otherwise add a 0.**&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now to the scary sounding stuff… Think of every selector expression as a math formula. It will produce a value (the way the elements will look). Think of all the different selectors as different formulas or equations. When the browser is reading your style sheet, it looks at each selector and then puts the value (result of the formula) in a bucket with the name of that selector. At the end, the browser looks in all its buckets, finds all the buckets with that name on them, adds up all the results, and then the value with the most specificity is the one that takes effect and styles the element.&lt;/p&gt;

&lt;p&gt;This brings me to the end of today’s lesson but ever wondered that if specificity makes your work easy to manuveur what  is the use of a beginner’s progress in web development  if they don’t know much about its importance ?!.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>css</category>
      <category>learning</category>
    </item>
    <item>
      <title>This and That About HTML</title>
      <dc:creator>Thatohatsi Matshidiso Tilodi</dc:creator>
      <pubDate>Fri, 12 Apr 2024 17:15:15 +0000</pubDate>
      <link>https://dev.to/thatohatsi880/this-and-that-about-html-3h3</link>
      <guid>https://dev.to/thatohatsi880/this-and-that-about-html-3h3</guid>
      <description>&lt;p&gt;&lt;a href="https://acrobat.adobe.com/id/urn:aaid:sc:EU:cb919422-f990-432a-bf6c-3e848578a46e" rel="noopener noreferrer"&gt;Original article&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTML ELEMENTS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I think a year back I would have been very much convinced that I knew a lot about HTML and coming to my knowledge I realized that what I knew was just the tip of the iceberg. Its elements, structures, tables and semantics were kind of blur in today’s class  but here is what I missed about the bits and pieces of the basics to what the big boys actually  talk about in their more advanced spaces.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Element Content&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We all know that the content is added to a web page using HTML (HyperText Markup Language), which we know tells the web browsers how to organize this content. Some of these contents include the element content  which is known to be the text that appears in between an element's beginning and end tags.  The easiest demonstration would be that of the Hello World set as the first heading&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1&amp;gt;Hello World!&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;List Item Element (li/)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another type of container that I am aware of is the List Item Element(li) and these are known to create or rather list certain elements and fall under ordered list (ol) or unordered lists(ul).  A typical example would be that of random list of peoples names that falls under (ul) and the grocery list that would fall under (ol):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ol&amp;gt;

  &amp;lt;li&amp;gt;Spinach&amp;lt;/li&amp;gt;

  &amp;lt;li&amp;gt;Salt&amp;lt;/li&amp;gt;

  &amp;lt;li&amp;gt;Meat&amp;lt;/li&amp;gt;

  &amp;lt;li&amp;gt;Carrots&amp;lt;/li&amp;gt;

&amp;lt;/ol&amp;gt;

&amp;lt;ul&amp;gt;

  &amp;lt;li&amp;gt;Thatohatsi&amp;lt;/li&amp;gt;

  &amp;lt;li&amp;gt;Coltrane&amp;lt;/li&amp;gt;

   &amp;lt;li&amp;gt;Matshidiso&amp;lt;/li&amp;gt;

&amp;lt;/ul&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Video Element (video)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I honestly never knew that there was html element for managing your video url but today I also learned that it is actually possible that a media player for playing videos can be embedded within this very element. The video's URL can be found in the src (also known as the source) attribute. The media player will show video controls if the controls attribute is added like below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;video src="test-video.mp4" controls&amp;gt;

  Video supported

&amp;lt;/video&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Emphasis Element (em)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Emphasis element was another one that I came across todays lecture as we all know that the text that is emphasized with the element (em) is often italicized by default in browsers and p being the paragraph. Like the instance created below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;p&amp;gt;I am&amp;lt;em&amp;gt;hungry&amp;lt;/em&amp;gt; today.&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Div Element &amp;amp; Span Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Funny that what I could not really differentiate a year back were the two elements being the Span and Div elements but the clarity I got in today’s class was that div is an element which stands for "division," being the  container that separates a document made up of HTML into sections.  These elements are capable of holding flow content, including paragraphs, headings, links, and images. Meanwhilst span on the other hand  enables text to be grouped for style purposes using the element, which is an inline text container. Nevertheless, if a more meaningful element is available, should not be used as it is a general container to split text fragments from a bigger body of text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Div:
&amp;lt;div&amp;gt;

  &amp;lt;h1&amp;gt;The story behind Betty’s hat&amp;lt;/h1&amp;gt;

  &amp;lt;p&amp;gt;Well it was stolen and nobody till this day knows about it &amp;lt;/p&amp;gt;

&amp;lt;/div&amp;gt;

&amp;lt;div&amp;gt;

  &amp;lt;h1&amp;gt;We are groomed to be at our best state&amp;lt;/h1&amp;gt;

  &amp;lt;p&amp;gt;A little to know about us, we stil are to come&amp;lt;/p&amp;gt;

&amp;lt;/div&amp;gt;

Span:
&amp;lt;p&amp;gt;&amp;lt;span&amp;gt;We are never&amp;lt;/span&amp;gt; forgotten because we live amongst strangers&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Image Element (img)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Like I had touched upon some of the facts that I never really knew that a video can be embedded using html elements all I knew to it was that one could support HTML image using (img) elements and  embed these images in documents. The src attribute contains the image URL and is mandatory. (img)  on the other hand is an empty element meaning it should not have a closing tag. Like for instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;img src="image.png"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Strong and Bold Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One would also wonder on how they can actually use the the bold and strong elements and although they seem to give the same outputs they also play two different roles. Where (b/)just makes the text bold whilst on the other hand important, serious, or urgent material is highlighted with the element (strong) by default, browsers display this highlighted text in (bold).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Strong:
&amp;lt;p&amp;gt;This is &amp;lt;strong&amp;gt;important&amp;lt;/strong&amp;gt; text!&amp;lt;/p&amp;gt;

Bold:
&amp;lt;p&amp;gt;This is &amp;lt;b&amp;gt;important&amp;lt;/b&amp;gt;text!&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Line Break Element (Br)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When a text split is needed for instance, such as in a postal address, the line break element can be used to produce a line break in the text. I further learned that the line break element doesn't need a closing tag, it just needs a starting tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;6 Olivard Street.&amp;lt;br&amp;gt;
Wright Park, Spring.&amp;lt;br&amp;gt;
Oh what a clean place indeed!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Unique ID Attributes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The last one on elements would definitely be Unique ID attributes.  HTML elements can be distinguished from one another by assigning unique and particular id properties to them. &lt;/p&gt;

&lt;p&gt;When necessary, JavaScript and CSS can use the (id) value to edit, format, and apply particular instructions to that element alone. A letter must be the first character in any valid ID property, and the only characters allowed are letters (a-Z), numerals (0-9) hyphens (-), underscores (_), and periods (.).&lt;br&gt;
For example: AI is the Unique ID attributes in the instance set below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1 id="A1"&amp;gt;Hello World&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;HTML SEMANTICS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Semantic HTML gives the code that we write a purpose. The elements of HTML has no meaning other than what they did or might include before Semantic HTML. A general-purpose element like was used to generate headers, footers, and articles, among other things. We were given two elements with Semantic HTML that specify to browsers and to developers what content belongs in it and how it should be used.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;!--Non Semantic HTML--&amp;gt;

&amp;lt;div id="footer"&amp;gt;

 &amp;lt;p&amp;gt;this is a footer&amp;lt;/p&amp;gt;

&amp;lt;/div&amp;gt;

&amp;lt;!--Semantic HTML--&amp;gt;

&amp;lt;footer&amp;gt;

 &amp;lt;p&amp;gt;this is a footer&amp;lt;/p&amp;gt;

&amp;lt;/footer&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Element Placement&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The other one will be element placement where with the help of elements introduced by Semantic HTML, us including the big boys also known as senior developers can now determine an element's specific function or placement simply by looking at its name. The header, nav, main, and footer. header is a few of these elements.  This provides an overview of the information found at the top of page body. It could have a search bar, navigational links, or a logo. The navigational links on the page are contained in nav . It frequently appears in the header or footer. Between the footer and header/navigation sections of a page, contains the primary content. At the bottom of the footer is where the page's footer content is contained in body. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Embedding media&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Beside the image convention, I never knew much about the others like the video element but having to embed media we are introduced to  (video), (audio) and (embed) , and through semantic HTML our website can now have videos thanks to the elements themselves (video) element. We can incorporate sound into our website thanks to (audio) element. Any kind of media can be implemented with (embed) element . These elements are all the same in that they connect to the content's source using the src property. Although is a self-closed tag, and need a closing tag. Below is a demonstration where all is shown about the above, an example caption I got from Code Academy website:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!--Video Tag--&amp;gt;
&amp;lt;video src="4kvideo.mp4"&amp;gt;video not supported&amp;lt;/video&amp;gt;

&amp;lt;!--Audio Tag--&amp;gt;
&amp;lt;audio src="koreanhiphop.mp3"&amp;gt;&amp;lt;/audio&amp;gt;

&amp;lt;!--Embed tag--&amp;gt;
&amp;lt;embed src="babyyoda.gif"/&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;section and article elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The last one I learned about under HTML’s semantics was about section and article elements. A document's chapters, headings, and additional sections with a common theme are defined using the term section. On the  other hand  article contains blog posts, articles, and comments that make sense on their own. Developers  typically use section to specify the webpage's theme and to create separate material for it. This doesn't mean that article and section must be used together.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;section&amp;gt;

  &amp;lt;!--defines theme--&amp;gt;

  &amp;lt;h2&amp;gt;Politics are being questioned by the future&amp;lt;/h2&amp;gt;

&amp;lt;!--writes independent content relating to that theme--&amp;gt;

  &amp;lt;article&amp;gt;

    &amp;lt;p&amp;gt;We nearing towards the end of conviction.&amp;lt;/p&amp;gt;

  &amp;lt;/article&amp;gt;

&amp;lt;/section&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;HTML STRUCTURE&lt;/strong&gt;&lt;br&gt;
Another one that displays a vital part is its structure which is arranged like a family tree. HTML components are capable of having siblings, parents, grandparents, kids, grandkids, and so on because of the structure at hand.  How it can be drawn is the exact same example as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;body&amp;gt;

  &amp;lt;div&amp;gt;

    &amp;lt;h1&amp;gt;We all choices and priorities at the end of the day&amp;lt;/h1&amp;gt;

    &amp;lt;h2&amp;gt;We are forever young&amp;lt;/h2&amp;gt;

  &amp;lt;/div&amp;gt;

&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Anchor Element (a)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In an HTML document, hyperlinks are created using the anchor element (a). Using a hyperlink's reference attribute, href, the hyperlinks can point to any other URL as well as additional web pages, documents on the same server, and locations inside the same page. The anchor element's pointer is shown by the href.&lt;/p&gt;

&lt;p&gt;An example that was set in class was one of the other demonstrations simplified in even more easier for me:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;!-- Creating text links --&amp;gt;

&amp;lt;a href="http://www.SheCodesAfrica.com"&amp;gt;Visit this site&amp;lt;/a&amp;gt;

&amp;lt;!-- Creating image links --&amp;gt;

&amp;lt;a href="http://www.SheCodesAfrica.com"&amp;gt;

    &amp;lt;img src="logo.jpg"&amp;gt;Click this image
&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Head Element(head)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The head element was another one that revived my knowledge about the structure as a whole as well known that the element itself generalizes on data regarding a page in HTML that isn't shown on the document itself becomes contained in the element. What I understood was  that  data, which is referred to as metadata, contains connections to stylesheets(CSS) and the HTML document's title.&lt;/p&gt;

&lt;p&gt;Like for instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;

&amp;lt;html&amp;gt;

  &amp;lt;head&amp;gt;

    &amp;lt;!-- Metadata is contained in this element--&amp;gt;

  &amp;lt;/head&amp;gt;
&amp;lt;/html&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Target Attribute(target)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Target attribute was well explained on the anchor section where the target simply indicates where the hyperlink should be opened. In current browsers, a target value of "_blank" instructs the web browser to display the hyperlink in a new tab; in earlier versions, or if the browser's settings have been modified to load hyperlinks in a new window, it will open the url in a new window:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;a 

href="https://www.SheCodesAfrica" 

target="_blank"&amp;gt;This anchor element

 links to she Codes Africa platform

and will open in a new tab or window.

&amp;lt;/a&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Link to a Different Part of the Page #&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Further linking to a different page was another attribute I was not quite sure about, especially that I was quite fluent with only linking to a website. Like for instance when a target value of "_blank" is specified, the browser is instructed to open hyperlinks in a new tab in current browsers, a new window in older browsers, or a new window if the browser's settings have been modified to open hyperlinks in a new window.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div&amp;gt;

  &amp;lt;p id="id-of-element-to-link-to"&amp;gt;What leads you to the 
different part  of the page!&amp;lt;/p&amp;gt;

&amp;lt;/div&amp;gt;

&amp;lt;a href="#id-of-element-to-link-to"&amp;gt;which will direct you to a different part of the page
&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;File Path&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Under the very same topic, a files path was also spoken about. What came to my understanding was that in HTML, URL routes may include absolute paths, such as the complete URL: Relative file paths, such as./style.css, link to local files stored in the same folder or on the same server as https:/SheCodes Africa.org/en-US/docs/Learn. The path that leads to the local file is preceded by./ in relative file paths, which instruct the browser to seek for the file's path in the current folder.&lt;/p&gt;

&lt;p&gt;Like for instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;a href="https://SheCodes Africa/en-US/docs/Web"&amp;gt;The URL for this anchor element is an absolute file path.&amp;lt;/a&amp;gt;

&amp;lt;a href="./about.html"&amp;gt;The URL for this anchor element is a file path that is relative to it.&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;HTML Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another element that one would see on the structure and quite take it for granted is that of the HTML element where the !DOCTYPE declaration needs to come before the element, which is the root of an HTML document. An HTML document's beginning and closing tags are said to contain all of its information and structure. The one I highlighted next to doctype is the html I am referring to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;

&amp;lt;html&amp;gt;

  &amp;lt;!-- comment --&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Whitespace&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Adding whitespace on the other hand, like line breaks, between block-level components in an HTML document doesn't increase the spacing on the generated HTML page( of which I thought it did), instead, it is typically thrown off by the browser. Instead, whitespace is inserted to the HTML content to improve structure and readability.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;p&amp;gt;Test paragraph&amp;lt;/p&amp;gt;

&amp;lt;!-- The whitespace created by this line, and above/below this line is ignored by the browser itself--&amp;gt;

&amp;lt;p&amp;gt;a new paragraph, this will sit right under the first paragraph and there won’t be any extra space added between.&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Head Element &lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Headline title Section, being the HTML document’s title is the one defined by the text inside the title element. The HTML page is seen in the browser’s title bar or tab, where the title appears. Only the head element of a document may contain the title element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;

&amp;lt;html&amp;gt;

  &amp;lt;head&amp;gt;

    &amp;lt;title&amp;gt;The headlines await&amp;lt;/title&amp;gt;

  &amp;lt;/head&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I am still journeying along learning more about other features under the HTML, but so far this is slowly but surely drawing me closer to knowing more about its advancements in the web development sector.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
      <category>learning</category>
    </item>
    <item>
      <title>Shying around between the takes of writting my First Tech Article as a She Code Africa Scholar...</title>
      <dc:creator>Thatohatsi Matshidiso Tilodi</dc:creator>
      <pubDate>Fri, 05 Apr 2024 16:41:11 +0000</pubDate>
      <link>https://dev.to/thatohatsi880/as-i-shy-around-between-the-takes-of-writting-my-first-tech-article-as-a-she-code-africa-scholar-3d58</link>
      <guid>https://dev.to/thatohatsi880/as-i-shy-around-between-the-takes-of-writting-my-first-tech-article-as-a-she-code-africa-scholar-3d58</guid>
      <description>&lt;p&gt;&lt;a href="https://acrobat.adobe.com/id/urn:aaid:sc:EU:dfc39a82-8b3a-4c40-b698-68979f80c0da" rel="noopener noreferrer"&gt;Original article&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;               **THE RAPID GROWTH OF THE NET*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F95gsj1qc4gyluqj72rkw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F95gsj1qc4gyluqj72rkw.jpg" alt="Image description" width="800" height="586"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The creation and interconnection of computer networks by scientists and engineers is where the Internet got its start. Its history, domain name system, meaning, functions, network packets, FTP, HTTP, and HTTPS requests are some of the features we get to look at. It originated from development and research in the United States that involved international cooperation.&lt;/p&gt;

&lt;p&gt;A bit on my understanding about the net is that I am very much aware that it serves as a platform for cooperation and communication between people and computers, as well as a worldwide broadcasting capacity and information distribution method. It further serves as a successful illustration of the advantages of consistent funding and dedication to information infrastructure research and development. As I browsed through cloudfare, I ran across the four main focuses of the Internet's history which are technological advancement, administration and operations, social elements, and commercialization. &lt;/p&gt;

&lt;p&gt;Early studies on packet switching and the ARPANET marked the beginning of technological progress, and ongoing research is extending the capabilities of infrastructure in areas like scalability, performance, and higher-level functionality as Tekmart further stated. A vast and complicated operational infrastructure is required for operations and administration, and a large community of Internet users where they collaborate to develop and advance the technology as a consequence of social factors. The efficient transfer of research findings into a widely accessible and widely deployed information infrastructure is known as commercialization. Many today still refer to the Internet as the first prototype of the National Information Infrastructure, but it is really a widely used information infrastructure today. Technology, organization, and community are just a few of the numerous facets that make up its complicated past. &lt;/p&gt;

&lt;p&gt;Since we use online technologies more and more on a daily for electronic commerce, information gathering, and community activities, its impact is seen not only in the technical domains of computer communications but also in general culture.&lt;br&gt;
Tracking back to the history of the internet I further discovered that writing about the "Galactic Network" concept by MIT's J.C.R. Licklider provided the first documented account of social interactions made possible by networking in the year 1962. His vision was of a network of globally connected computers, similar to the Internet of today(IOT), that would provide instant access to information and applications from any location. Licklider served as the first director of DARPA's computer research program and persuaded Ivan Sutherland, Bob Taylor, and Lawrence G. Roberts, among others, of the value of this networking strategy.&lt;/p&gt;

&lt;p&gt;I further discovered that the first packet switching theory paper was published in 1961 by MIT's Leonard Kleinrock, and the first packet switching theory book was released during the year 1964. A significant step toward computer networking was taken at a time when Kleinrock persuaded Roberts that communications using  packets rather than wires may theoretically be possible. Roberts established the first wide-area computer network which was ever constructed in the year 1965 when he used a low-speed dial-up telephone connection to link the Q-32 in California and the TX-2 computer in Massachusetts as stated by cloudfare. As a matter of fact, it became clear that time-shared computers might function well together, with the remote computer running applications and getting data as needed.&lt;/p&gt;

&lt;p&gt;Lastly was the internet’s discovery during the year 1969 by BBN, being the first node of the ARPANET which was located at UCLA's Kleinrock Network Measurement Center. This was when a second node was further established at Stanford Research Institute (SRI) and an Elizabeth Feinler-led Network Information Center were linked to the first host computer, which was connected to the first IMP at UCLA. The Internet was just being started, with four host computers linked to the ARPANET by the end of 1969. &lt;/p&gt;

&lt;p&gt;Using the network and its underlying structure were the main topics of network research. In December of 1970, the Network Control Protocol  also known as the (NCP), the original ARPANET Host-to-Host protocol, was said to be finished. Electronic mail was then launched as the first "hot" technology at the International Computer Communication Conference (ICCC) in 1972 as was also stated by Techtarget, when the ARPANET was first shown off in public. This further marked off the growing of what is known as "people-to-people traffic" on the internet today.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHAT IS A DOMAIN NETWORK SYSTEM(DNS) AND WHAT ARE SOME OF ITS FEATURES&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fooid680cgrig6q484bru.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fooid680cgrig6q484bru.png" alt="Image description" width="601" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is well known that from servers the host content for large retail websites to your smartphone or laptop, every computer on the Internet uses numbers to locate and connect with one another. We call these figures IP addresses. This further comes to my understanding that when login to the internet DNS allows you to visit a website without having to memorize and input a lengthy number when one launches or works with a web browser. You can still get to the correct location by using a web address like example.com instead.&lt;/p&gt;

&lt;p&gt;DNS services, like Amazon Route 53 for instance, are geographically wide services that convert human-readable domain names, such &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt;, to the numerical IP addresses which computers use to communicate with one another. The DNS system on the Internet controls the mapping between IP addresses, much like a telephone directory. When a user types a domain name into their web browser, DNS servers convert those requests for names into IP addresses, thereby managing which server the user will access. Queries are what we call these requests.&lt;/p&gt;

&lt;p&gt;The Domain Name System is divided into two parts namely Authoritative DNS and Recursive DNS. When it comes to Authoritatve DNS I further understand that this is where developers can control their public DNS names by updating mechanism offered by an authoritative DNS provider. After then, it further responds to DNS queries, converting domain names into IP addresses so that devices can communicate to one another. Recursive DNS servers rely on authoritative DNS to respond with the IP address information since it holds the highest authority over a domain. A DNS system with authority is for instance in this case an Amazon Route 53.&lt;/p&gt;

&lt;p&gt;Recursive DNS on the other hand is usually where clients don't query authoritative DNS services directly. As an alternative, they often try to find a connection with a resolver, also referred to as a recursive DNS service. Recursive DNS services function similarly to a hotel keeper as stated by the Amazon sample in that they act as a go-between who can get these DNS records even though they don't control any of them, and also the brief of what sets the two apart.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F69gg69q607rcdpvg42je.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F69gg69q607rcdpvg42je.png" alt="Image description" width="582" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above image is a demonstration by Amazon that illustrates what is the process by which DNS Routes Requests to Your Website and on how Domain Name System works in particular:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;•   The first part of the demonstration shows when a web browser starts, this is where the user types &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; into the address bar and presses Enter.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;• Secondly, is where the user accesses a web browser, the user types &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; into the address bar and presses the Enter key. *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;• An Internet service provider (ISP), such as a cable Internet provider, DSL broadband provider, or business network, is usually in charge of managing the DNS resolver that receives the request for &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt;. *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;• &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; requests are forwarded to a DNS root name server by the Internet Service Provider's DNS resolver.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;** • An additional TLD name server for.com domains receives the request for &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; from the ISP's DNS resolver. The four Amazon Route 53 name servers linked to the example.com domain are named by the name server for.com domains in response to the request.**&lt;/p&gt;

&lt;p&gt;** • The Amazon Route 53 name server is selected by the ISP's DNS resolver, which then routes the request for &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; to it.** &lt;/p&gt;

&lt;p&gt;** • The IP address of a web server, 192.0.2.44, is one example of the value that the Amazon Route 53 name server retrieves when it searches the example.com hosted zone for the &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; record. It then sends the IP address back to the DNS resolver**&lt;/p&gt;

&lt;p&gt;** • TheIP address that the user requires is finally available through the ISP's DNS resolver. The web browser receives that value back from the resolver. Additionally, the DNS resolver caches or stores example.com's IP address for a duration that you designate, enabling it to react faster when someone visits example.com later.**&lt;/p&gt;

&lt;p&gt;** • The web browser uses the IP address it obtained from the DNS resolver to send a request for &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt;. Here's where your material resides, like on an instance of Amazon EC2 hosting a web server or a bucket on Amazon S3 set up as an endpoint for a website.**&lt;/p&gt;

&lt;p&gt;** • Lastly is when the internet browser displays the webpage for &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; after receiving it from the web server or another resource at an IP address 192.0.2.44.**&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;         **WHAT IS A NETWORK PACKET AND ITS WORKS**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F1515k87eq9dfnjihuoxv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F1515k87eq9dfnjihuoxv.png" alt="Image description" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A packet is a brief section of a bigger communication in networking. Packets are used to separate data being delivered via computer networks, like in this case, the Internet. The machine or device that receives these packets then reorganizes them. &lt;/p&gt;

&lt;p&gt;Let's say for instance writer A is writing a letter to receiver B, but receiver B can only fit envelopes that are the dimensions of a small index card through their mail slot. Writer breaks up their message into much smaller chunks, each only a few phrases long, and writes these portions out on index cards rather than putting it on regular paper and then attempting to fit it through the postal slot. Receiver B then gets the stack of cards from the writer, and arranges them so they can read the entire message.&lt;/p&gt;

&lt;p&gt;This is comparable to the operation of Internet packets. Let's say a user has a picture to load right?, well in this instance the picture file will not be transferred in its whole form from the internet server to the consumer's machine. Rather, it will be divided into data packets which will be transmitted across the Internet's lines, cables, and radio waves, and then pieced back together into the original image by the user's computer.&lt;/p&gt;

&lt;p&gt;A collection of at least two computers that are connected is known as a network. The worldwide web is a network of networks, made up of numerous global networks that are linked to each other.&lt;/p&gt;

&lt;p&gt;Some of the questions that might pop up next in mind is how we can use these network packets. It might be applicable, in theory, to transfer files and data across the Internet without breaking them up into discrete information packets. A lengthy uninterrupted line of bits, or discrete information units sent as electrical pulses that computers can understand, could be sent from one computer to another. &lt;/p&gt;

&lt;p&gt;However, if a number of computers are involved, this strategy quickly becomes inapplicable. No third computer could utilize the same connections to convey data while the lengthy line of bits travelled between the two computers, it has to wait its turn.&lt;/p&gt;

&lt;p&gt;The Internet operates as a "packet shifting" network compared to this methodology. The ability of network equipment to handle packets independently of one another is known as packet switching. Additionally, it implies that packets can go via several network paths to reach the same location as long as they all get there. (In certain protocols, even if each packet travelled a different path to get there, they still must land at the end point in the correct sequence.) &lt;/p&gt;

&lt;p&gt;According to TechTarget it is well stated that packets from different computers can flow across the same lines in virtually any order thanks to packet switching. This makes it possible for several connections to occur simultaneously over the exact same network device and briefly becomes responsive in that manner. Hence billions of devices today are able to share data across the Internet at the same pace.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  **ROLE PLAYED BY PROTOCOLS IN DATA TRANSMISSION**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;An effective, safe, and precise interaction between electronic devices is ensured by protocols, which are said by google to be important guidelines and practices for data transfer in networks. Error checking during transmission, security, and data integrity are their main responsibilities. By including a checksum, they guarantee that the data delivered and received by the source and destination devices are same. In the event that the checksums do not match, information is retransmitted and is deemed intact.&lt;/p&gt;

&lt;p&gt;According to Tutorchase, I understand that with protocols like Secure Sockets Layer (SSL) and Transport Layer Security (TLS) data encryption happens before transmission and decoding it upon receipt, security is yet another essential component of data transmission. In addition, they control the speed and size of data transferred, dividing big files into manageable packets for simpler transfer and re-organizing them when they get to their destination. In order to avoid information overload at the receiving device, they are also known to regulate the data transfer rate.  Data packets' travel from origin to destination is determined by protocols, especially across large networks with numerous alternative routes. In current digital age, protocols are essential for communication and data transmission. &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  **MORE ABOUT FTP, HTTP &amp;amp; HTTPS REQUEST PROTOCOLS**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;There are 12 common network protocols and amongst the 12 appears three that caught my attention,  namely FTP also known as File Transfer Protocol, HTTPS also known as Hypertext Transfer Protocol and lastly is HTTPS which is also the same as HTTP but is more secured especially when it comes to cyberattacks.&lt;/p&gt;

&lt;p&gt;When we look into File Transfer Protocol also known as FTP, we see that this is where a client sends a request for a file, and in return the server responds. FTP uses a data channel and a command channel to exchange files and communicate. It operates over the TCP/IP suite of communications protocols. Through the data channel, clients can download, modify, and copy files in addition to performing other operations. Through the command channel, clients can request files.&lt;/p&gt;

&lt;p&gt;Since the majority of computers started using HTTP for file sharing, according to Tekmark it is said that FTP has become less common. Nonetheless, FTP is a widely used network protocol for sharing files in a more confidential setting, like banking.&lt;/p&gt;

&lt;p&gt;As we move to HTTP , similar to FTP, I understand that HTTP is a TCP/IP-based file transfer protocol that is mainly used by internet browsers and is widely known by consumers. HTTP allows access when a user types in an internet domain and wants to visit it. The HTML code that organizes and presents the page's design is requested by HTTP when it establishes a connection with the domain's server. &lt;/p&gt;

&lt;p&gt;HTTPS, or HTTP over Secure Sockets Layer, is an additional variation of HTTP. Users' webpages and HTTP queries can be encrypted with HTTPS. According to Tekmark, it we recognize that users will feel more protected as a result, and common cybersecurity risks like man-in-the-middle attacks may be avoided.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          **THE FOURTH INDUSTRIAL REVOLUTION:**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F3dcg9b1wrkz2nmks980i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F3dcg9b1wrkz2nmks980i.png" alt="Image description" width="474" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we continue journeying along some of the updated features, the above are what made and still make the internet to be what it is today and these keep on getting better secured as technology  grows over the 4th industrial revolution.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>learning</category>
      <category>writing</category>
    </item>
  </channel>
</rss>
