<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by GrayHat - Harun Mwenda on Medium]]></title>
        <description><![CDATA[Stories by GrayHat - Harun Mwenda on Medium]]></description>
        <link>https://medium.com/@mwendahmbaabu?source=rss-ee91ffa4ec7b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*D_OkrGCao0TA5O9dCK3hSw.jpeg</url>
            <title>Stories by GrayHat - Harun Mwenda on Medium</title>
            <link>https://medium.com/@mwendahmbaabu?source=rss-ee91ffa4ec7b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:12:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mwendahmbaabu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What is Blockchain?]]></title>
            <link>https://mwendahmbaabu.medium.com/what-is-blockchain-f9fb6ef6e632?source=rss-ee91ffa4ec7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9fb6ef6e632</guid>
            <dc:creator><![CDATA[GrayHat - Harun Mwenda]]></dc:creator>
            <pubDate>Wed, 20 Aug 2025 17:21:16 GMT</pubDate>
            <atom:updated>2025-08-20T17:34:23.098Z</atom:updated>
            <content:encoded><![CDATA[<p>Blockchain is like a <strong>digital notebook</strong> (or ledger) that is shared among many computers across the world.</p><ul><li>Every time a new record is added (like a payment, contract, or transaction), it is copied to <strong>all the notebooks</strong>.</li><li>Once written, the record <strong>cannot be secretly changed or erased</strong>.</li><li>Everyone can view the entries, which makes the system <strong>transparent and trustworthy</strong> without needing a middleman such as a bank.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e0YIS4UgAUxBtxUL" /></figure><h3>Example in Daily Life (Kenya)</h3><p>Think of <em>chamas</em> (merry-go-round savings groups):</p><ul><li>Normally, members must <strong>trust the treasurer</strong> to record contributions and payouts.</li><li>With blockchain, the records are <strong>shared among all members</strong>.</li><li><strong>No single person can alter the records</strong>, so transparency and trust are guaranteed.</li></ul><h3>Key Features of Blockchain</h3><ol><li><strong>Decentralized</strong> — No single bank, company, or person controls it.</li><li><strong>Transparent</strong> — Everyone on the network can view transactions.</li><li><strong>Immutable</strong> — Once recorded, data cannot be tampered with.</li><li><strong>Secure</strong> — Protected using cryptography (complex math that makes hacking very difficult).</li></ol><h3>Why Blockchain Matters</h3><ul><li><strong>Money Transfers</strong>: Works like sending M-Pesa, but without needing Safaricom as a middleman.</li><li><strong>Land Records</strong>: Land titles on blockchain cannot be forged or manipulated.</li><li><strong>Supply Chains</strong>: Buyers can confirm that produce (like maize or coffee) really came from trusted farmers.</li></ul><h3>Blockchain + AI in Kenya</h3><p>When combined with <strong>Artificial Intelligence (AI)</strong>, blockchain becomes even more powerful:</p><ul><li><strong>AI + Finance</strong>: Smarter credit scoring for small businesses using mobile money history.</li><li><strong>AI + Agriculture</strong>: Detect crop diseases with a phone camera while blockchain secures farm-to-market records.</li><li><strong>AI + Health</strong>: AI offers basic medical diagnosis while blockchain safely stores patient records.</li></ul><p>👉 <strong>In short</strong>: Blockchain is a <strong>shared, secure, and unchangeable digital record system</strong> that builds trust. Paired with AI, it can solve real problems in Kenya — from farming and healthcare to banking and land management.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9fb6ef6e632" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an ETL Pipeline with Apache Spark for CSV to MySQL Data Integration]]></title>
            <link>https://mwendahmbaabu.medium.com/building-an-etl-pipeline-with-apache-spark-for-csv-to-mysql-data-integration-d6c89605d65b?source=rss-ee91ffa4ec7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6c89605d65b</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[GrayHat - Harun Mwenda]]></dc:creator>
            <pubDate>Thu, 13 Jul 2023 11:51:41 GMT</pubDate>
            <atom:updated>2023-07-13T11:51:41.012Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/834/0*bgh2hHeERwzTR3gY.png" /></figure><p>In the world of data engineering, Extract, Transform, Load (ETL) pipelines play a crucial role in moving and transforming data from various sources into a desired destination. Apache Spark, a powerful distributed computing framework, provides excellent capabilities for processing large datasets and building scalable ETL pipelines. In this article, we will explore how to use Apache Spark to read data from a CSV file, perform transformations, and load it into a MySQL database.</p><p><strong>Prerequisites</strong></p><p>Before we dive into the ETL pipeline implementation, make sure you have the following components set up:</p><ol><li>Apache Spark: Install and configure Apache Spark on your machine or cluster.</li><li><strong>MySQL:</strong> Set up a MySQL database with appropriate credentials and access rights.</li><li><strong>MySQL JDBC driver:</strong> Download the MySQL JDBC driver and include it in your Spark environment.</li></ol><p><strong>Step 1:</strong> Setting up the SparkSession The first step is to create a SparkSession, the entry point for working with Spark APIs. We configure the SparkSession with the desired settings and create an instance to work with.</p><p><strong>Step 2:</strong> Reading the CSV Data Using the SparkSession, we can read the CSV data into a DataFrame. Specify the path to the CSV file, and if the file has a header row, set the header parameter to True. Spark will infer the schema and load the data into a DataFrame.</p><p><strong>Step 3:</strong> Data Transformation Once the CSV data is loaded, we can apply any necessary transformations to prepare it for the MySQL database. Spark provides a rich set of functions to manipulate and transform data. Use the DataFrame’s select method to select the desired columns and apply any required transformations, such as renaming columns or changing data types.</p><p><strong>Step 4: </strong>Configuring MySQL Connection To establish a connection to the MySQL database, we need to provide the connection details, including the host, port, database name, username, and password. Make sure to replace the placeholders in the code with your MySQL configuration. Additionally, ensure that the MySQL JDBC driver is available in the classpath.</p><p><strong>Step 5:</strong> Writing Data to MySQL Using the DataFrame’s write method, we can save the transformed data directly to the MySQL database. Specify the JDBC format, along with the connection details and table name. Additionally, set the mode parameter to determine how to handle existing data in the MySQL table (e.g., overwrite, append, or ignore).</p><p><strong>Step 6:</strong> Stopping the SparkSession After the data is successfully written to MySQL, it’s essential to stop the SparkSession to release the allocated resources.</p><pre>from pyspark.sql import SparkSession<br>from pyspark.sql.functions import col<br>from getpass import getpass<br><br># Set up SparkSession<br>spark = SparkSession.builder \<br>    .appName(&quot;CSV to MySQL ETL Pipeline&quot;) \<br>    .getOrCreate()<br><br># Read CSV file<br>csv_path = &quot;data/file.csv&quot;<br>df = spark.read.csv(csv_path, header=True)<br><br># Perform transformations<br>transformed_df = df.select(<br>    col(&quot;column1&quot;).alias(&quot;new_column1&quot;),<br>    col(&quot;column2&quot;).alias(&quot;new_column2&quot;)<br>    # Add more transformations as needed<br>)<br><br># Configure MySQL connection<br>mysql_host = &quot;********&quot;<br>mysql_port = &quot;****&quot;<br>mysql_database = &quot;***&quot;<br>mysql_table = &quot;****&quot;<br>mysql_user = &quot;****&quot;<br>mysql_password = getpass(&quot;Enter MySQL password: &quot;)<br><br># Write data to MySQL<br>transformed_df.write.format(&quot;jdbc&quot;).options(<br>    url=f&quot;jdbc:mysql://{mysql_host}:{mysql_port}/{mysql_database}&quot;,<br>    driver=&quot;com.mysql.jdbc.Driver&quot;,<br>    dbtable=mysql_table,<br>    user=mysql_user,<br>    password=mysql_password<br>).mode(&quot;overwrite&quot;).save()<br><br># Stop SparkSession<br>spark.stop()</pre><p><strong>Conclusion</strong></p><p>By leveraging Apache Spark’s capabilities, we can build robust and scalable ETL pipelines to handle large volumes of data efficiently. In this article, we walked through the process of reading data from a CSV file, applying transformations, and loading it into a MySQL database. With Spark’s extensive functionalities and flexibility, you can customize the pipeline to suit your specific data integration requirements. ETL pipelines are vital components in modern data architectures, empowering organizations to extract insights from diverse data sources and drive data-driven decision-making processes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6c89605d65b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Lux Tech Academy Virtual classes]]></title>
            <link>https://medium.com/lux-tech-academy/introducing-lux-tech-academy-virtual-classes-6c7a344d7e79?source=rss-ee91ffa4ec7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c7a344d7e79</guid>
            <dc:creator><![CDATA[GrayHat - Harun Mwenda]]></dc:creator>
            <pubDate>Fri, 02 Apr 2021 07:55:58 GMT</pubDate>
            <atom:updated>2021-04-02T11:47:02.270Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introducing Lux Tech Academy Online classes</strong></h3><blockquote>At Lux Tech Academy we are trying to build an online coding school that’s as good as MIT but as cheap as a gym membership.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*phNjM6GwrxubTYguikFs1Q.jpeg" /></figure><p>We are happy to announce that we will be conducting two virtual classes from May 2021.</p><ul><li><strong>FullStack Software Development Track -</strong> 5 months</li><li><strong>FrontEnd Software Development Track - </strong>3 months</li></ul><blockquote>Everything will be taught step by step from scratch, you don’t need prior knowledge in programming, all you need is a working PC, reliable internet and enthusiasm and self-drive.</blockquote><ol><li><strong>FullStack Software Development Track</strong></li></ol><h4>Technologies and Languages:</h4><ul><li>Git and GitHub</li><li>HTML5</li><li>CSS3</li><li>JavaScript</li><li>python</li><li>React.js</li><li>Flask</li><li>FastAPI</li><li>MySQL</li><li>Postgres</li></ul><p><strong>Mode of Learning</strong></p><p>This will involve 2 hrs virtual classes everyday Monday to Friday and anyone who misses two classes in a week without a valid reason will be discontinued and refunded 1/3 of that months fee.</p><p><strong>Project &amp; Assessment</strong></p><p>All learners will be required to complete a project and write a technical article every week.</p><blockquote>This is mandatory</blockquote><p><strong>Cost</strong></p><p>The classes will cost 5000 Ksh per Month, a <strong>Maximum of 15 Learners </strong>per class</p><p><strong>Certification</strong></p><p>All finalist will earn a verified soft copy and hard copy of signed and stamped certificate and Lux Tech Academy T-shirt</p><p>Application Link: <a href="https://forms.gle/w89USzGhXd2HFkef8">https://forms.gle/w89USzGhXd2HFkef8</a></p><p><strong>2. FrontEnd Software Development Track</strong></p><h4>Technologies and Languages:</h4><ul><li>HTML5</li><li>CSS3</li><li>Git and GitHub</li><li>Figma</li><li>JavaScript</li><li>React</li><li>Angular</li></ul><p><strong>Mode of Learning</strong></p><p>This will involve 2 hrs virtual classes everyday Monday to Friday and anyone who misses two classes in a week without a valid reason will be discontinued and refunded 1/3 of that months fee.</p><p><strong>Project and assessment</strong></p><p>All learners will be required to complete a project and write a technical article every week.</p><blockquote>This is mandatory</blockquote><p><strong>Cost</strong></p><p>The classes will cost 5000 Ksh per Month</p><p><strong>Certification</strong></p><p>All finalist will earn a verified soft copy and hard copy of signed and stamped certificate and Lux Tech Academy T-shirt</p><p>Application Link: <a href="https://forms.gle/w89USzGhXd2HFkef8">https://forms.gle/w89USzGhXd2HFkef8</a></p><p>In case of any question kindly contact us @luxtinc@gmail.com or vial WhatsApp +254798166628</p><p>Thank you</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c7a344d7e79" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lux-tech-academy/introducing-lux-tech-academy-virtual-classes-6c7a344d7e79">Introducing Lux Tech Academy Virtual classes</a> was originally published in <a href="https://medium.com/lux-tech-academy">Lux Tech Academy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript For Machine Learning]]></title>
            <link>https://medium.com/lux-tech-academy/javascript-for-machine-learning-837b10095d26?source=rss-ee91ffa4ec7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/837b10095d26</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[tensorflowjs]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[GrayHat - Harun Mwenda]]></dc:creator>
            <pubDate>Wed, 10 Feb 2021 09:48:35 GMT</pubDate>
            <atom:updated>2021-02-10T09:48:35.480Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oj-9SDgE04RffcM5zCpaPw.png" /></figure><h3>From Simple Scripts to Machine Learning</h3><p>JavaScript hails from humble beginnings. It entered the scene in 1995 as part of Netscape’s Navigator web browser. Its purpose? To make the web more dynamic. The programming language’s creators designed it to be easy to implement, powerful, and functional.</p><p>It was precisely what an emerging internet needed. And the creator’s succeeded in their cause. But it wasn’t long before the next milestone arrived with a standardization process that started in November 1996 (ECMA International named the standard ECMA-262).</p><p>By this time, JavaScript had established itself as a notable player in web development. In a Netscape press release, the company confirmed almost 300,000 JavaScript-enabled pages across the nascent worldwide web.</p><blockquote>“JavaScript and Java are cornerstone technologies of the Netscape ONE platform for developing Internet and Intranet applications.</blockquote><blockquote>In the short time since their introduction last year, the new languages have seen rapid developer acceptance with more than 175,000 Java applets and more than 300,000 JavaScript-enabled pages on the Internet today according to <a href="http://www.hotbot.com/">www.hotbot.com</a>.”</blockquote><p>Standardization played a pivotal role in JavaScript’s growing profile since it enabled developers to use it, alongside giving them a voice in the evolution of the language itself.</p><p>Moreover, standardized usage ensured consistency in implementation, stopping developers from deviating too far from specifications, which could have caused fragmentation, undermining JavaScript’s scalability.</p><p>That said, some feared Microsoft might intentionally pursue such a strategy to gain a competitive advantage in the early days. But thankfully, those predictions never came to pass.</p><p>Despite the language’s growing profile, the ECMA committee couldn’t use ‘JavaScript’ as the name for their standard because of <a href="https://en.wikipedia.org/wiki/JavaScript#Trademark">trademark issues</a>. All the while, the committee couldn’t find a name that developers and implementers would accept either, so they settled on ‘ECMAScript.’</p><p>But JavaScript is only the commercial name for it. And with every new release — spanning ES2 in 1998, ES3 in 1999, ES5 in 2009, and ES6 in 2015 — the language has gained more and more traction.</p><p>ES5 was the release that introduced many features that dramatically increased ease-of-use, angling JavaScript towards becoming a general-purpose language. And the release of Node.js confirmed just that.</p><p>Following the ES6 release, no doubts remained about the ambition behind the language as the world gained access to the following features:</p><ul><li>Default Parameters</li><li>Template Literals</li><li>Multi-line Strings</li><li>Destructuring Assignment</li><li>Enhanced Object Literals</li><li>Arrow Functions</li><li>Promises</li><li>Block-Scoped Constructs Let and Const</li><li>Classes</li><li>Modules</li></ul><p>At this point, it was clear JavaScript wanted to dominate the market, alongside appealing to developer groups using other languages. With its increasing functionality, its popularity only grew.</p><p>Then Node.js arrived in 2009, allowing JavaScript to finally escape the browser and find use in servers before it eventually found its place in machine learning — largely thanks to the increasing computational power of end-user devices.</p><h3>JavaScript for Machine Learning</h3><p>For many years, JavaScript has been popular both among developers and in business.</p><p>Check resources like <a href="https://www.tiobe.com/tiobe-index/javascript/">Tiobe</a>, <a href="https://insights.stackoverflow.com/survey/2020#most-popular-technologies">Stack Overflow</a>, <a href="https://octoverse.github.com/">Github</a>, and <a href="https://research.hackerrank.com/developer-skills/2020">HackerRank</a>, and you’ll find JavaScript in the leading position for the most-used, popular or in-demand language. According to HackerRank, it’s also the most sought-after programming language by employers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*svQxmfBacVggLNiugBacYQ.png" /></figure><p>Whatever the source, you’ll find <a href="https://becominghuman.ai/best-languages-for-machine-learning-in-2020-6034732dd242">JavaScript mentioned in the lead for machine learning</a>, in the company of mainstream languages like Python, Java, or Go.</p><p>In reality, Python is the unquestionable leader in ready-to-use dependencies for almost any case, including machine learning. But JavaScript isn’t far behind, thanks to its maturing range of packages coupled with comprehensive developer and business support.</p><p>Here are the five most popular JavaScript libraries around today:</p><ul><li><a href="https://github.com/tensorflow/tfjs">Tensorflow.js</a></li><li><a href="https://github.com/BrainJS/brain.js">Brain.js</a></li><li><a href="https://github.com/ml5js/ml5-library">ML5.js</a></li><li><a href="https://github.com/karpathy/convnetjs">ConvNetJS</a></li><li><a href="https://github.com/cazala/synaptic">Synaptic</a></li></ul><p>Despite its growing use, you might still ask yourself, <em>“Is JavaScript for machine learning really a thing?” </em>In short, yes: the reason being that it is already a prevalent language and one with a relatively low entry threshold.</p><p>Plus, there’s an abundance of specialist developers who already use it. Not to mention the possible cost-reductions in using an AI infrastructure, given that execution happens in the user’s browser.</p><p>Ease-of-deployment is another selling point, as is the ability to gather and combine data from many sources. So yes, absolutely, JavaScript for machine learning really is ‘<em>a thing</em>’ — and it’s little wonder the language is growing more popular by the day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*iy4ECcCL0KefP5NrrCfhDw.png" /></figure><h3>Development of Popular JavaScript Libraries</h3><p>Let’s take a moment to consider how the most popular frameworks grew in 2020:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*O1vwuWjEMlAYACnKC3tSRQ.png" /></figure><p>In many ways, each library’s growth is down to the growth of the AI market itself.</p><p>According to <a href="https://www.idc.com/getdoc.jsp?containerId=prUS46757920">IDC</a>, the global AI market was worth $156.5 billion in 2020: an increase of 12.3% from 2019. And with JavaScript being the most popular programming language worldwide — with both browser and server environments at its fingertips — it’s unlikely to fall by the wayside.</p><p><strong>Case in point:</strong> Tensorflow was popular among Python users, and it rocketed to fame the second it was released for JavaScript. Many libraries are following suit. But there’s one exception.</p><p>Synaptic is less popular, but that’s mainly down to its age.</p><p>Development started in 2014. Still, over the years, it has proved a reliable library for building neural networks. And while development isn’t overly active, Synaptic often features as a recommended library.</p><h3>Shortcoming of JavaScript in Machine Learning</h3><p>The main shortcomings of using JavaScript for machine learning are:</p><ol><li><strong>Online-only:</strong> The model won’t work offline (unless you configure the web app to work offline, which is rare).</li><li><strong>Reliability:</strong> Performance relies on the end user’s device.</li><li><strong>Public:</strong> Your code and model are publicly visible.</li></ol><p>Interestingly, my observations on this topic overlapped with the findings presented at this year’s <a href="https://www.w3.org/2020/06/machine-learning-workshop/report.html">W3C Machine Learning Workshop</a>. And there’s still a need to standardize how we use ML models on the front-end.</p><p>Doing so would reduce computational issues (for example, a lack of float16 reduces hardware acceleration) and privacy issues (for example, the privacy of models and processes around user data collection).</p><p>W3C is considering standardizing the Neural Network Web API — which would, in turn, make machine learning accessible to a broader user base and resolve the three issues.</p><h3>Where JavaScript Outperforms The Competition</h3><p>Despite its shortcomings and ongoing lack of standardization, JavaScript still has several advantages, including:</p><ul><li><strong>Deployment:</strong> It’s easy, you can even use a static website with Javascript added.</li><li><strong>Ubiquitous:</strong> You can gather and connect data from multiple sources (like social media).</li><li><strong>Reach:</strong> You can access end-users via a pop-up, no need to install anything else.</li><li><strong>Mobile:</strong> You can port to mobile using React Native.</li><li><strong>Availability:</strong> JavaScript works offline with the right configuration.</li><li><strong>Lightweight:</strong> JavaScript is lightweight.</li></ul><h3>What Can You Expect for JavaScript in 2021?</h3><p>We expect its usage to explode in 2021, including more comprehensive integrations of JavaScript-based solutions, with not only the internet benefiting from improvements in the programming language.</p><p>But mobile platforms (through React Native), server apps (through Node), and desktop (through ElectronJS) as well. On the global stage, <a href="https://www.statista.com/statistics/325706/global-internet-user-penetration/">Statista</a> predicts JavaScript penetration will hit 53.7% as it reaches new frontiers.</p><p>And one application to note is how SpaceX’s very own <a href="https://www.infoq.com/news/2020/06/javascript-spacex-dragon/">Dragon Capsule</a> uses Chromium and JavaScript to drive the UI of the vehicle’s controls. We don’t expect SpaceX to be JavaScript’s final frontier. Quite the opposite.</p><p>It’s just another round of rocket fuel for this hugely popular programming language.</p><p>I hope you enjoyed 🥳 follow for more similar articles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=837b10095d26" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lux-tech-academy/javascript-for-machine-learning-837b10095d26">JavaScript For Machine Learning</a> was originally published in <a href="https://medium.com/lux-tech-academy">Lux Tech Academy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Asteroids Classification: Classifying Whether an Asteroid is Hazardous.]]></title>
            <link>https://medium.com/data-science-east-africa/asteroids-classification-classifying-whether-an-asteroid-is-hazardous-c20f3c15ff1e?source=rss-ee91ffa4ec7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c20f3c15ff1e</guid>
            <dc:creator><![CDATA[GrayHat - Harun Mwenda]]></dc:creator>
            <pubDate>Fri, 22 Jan 2021 13:22:33 GMT</pubDate>
            <atom:updated>2021-01-28T08:43:01.657Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U4loix8Xo7FSWiDJTdbvDQ.jpeg" /></figure><h4><strong>Asteroids</strong></h4><p><strong>Asteroids</strong> are small, rocky objects that orbit the Sun. Although <strong>asteroids</strong> orbit the Sun like planets, they are much smaller than planets. <strong>Asteroids</strong> are small, rocky objects that orbit the sun. Although <strong>asteroids</strong> orbit the sun like planets, they are much smaller than planets.</p><p>Larger <strong>asteroids</strong> have also been called planetoids. There exist millions of asteroids and the vast majority of known asteroids orbit within the central asteroid belt located between the orbits of Mars and Jupiter, or are co-orbital with Jupiter (the <strong>Jupiter Trojans</strong>).</p><p>The study of asteroids is also crucial as historical events prove some of them being hazardous. Remember <strong>Chicxulub</strong> crater? — The crater formed by an asteroid that <em>probably </em>snuffed out all the dinosaurs, 65 million years ago.</p><p>Being a data science enthusiast, I thought of using machine learning to predict whether an asteroid could be hazardous or not.<br>Searching on Kaggle, I found NASA’s dataset about some of the asteroids discovered so far. The dataset contains various information about the asteroids and labels each asteroid as hazardous or non-hazardous.<br>You can find the dataset <a href="https://www.kaggle.com/shrutimehta/nasa-asteroids-classification"><strong>here</strong></a>.</p><h3>ASTEROID DATASET</h3><p>The data is about Asteroids and is provided by NEOWS(Near-Earth Object Web Service)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*iR4m8sP-jsMwzbWJEBSROg.png" /></figure><p>The dataset consists of <strong>4687 data instances(rows)</strong> and <strong>40 features(columns)</strong>. Also, there are no null values in the dataset.</p><p>Some of the features’ description is given below;</p><ol><li><em>‘Neo Reference ID’: </em>This feature denotes the reference ID assigned to an asteroid.</li><li><em>‘Name’: </em>This feature denotes the name given to an asteroid.</li><li><em>‘Absolute Magnitude’: </em>This feature denotes the <strong>absolute magnitude</strong> of an asteroid. An <strong>asteroid’s absolute magnitude</strong> is the visual <strong>magnitude</strong> an observer would record if the <strong>asteroid</strong> were placed 1 Astronomical Unit (AU) away, and 1 AU from the Sun and at a zero phase angle.</li><li><em>‘Est Dia in KM(min)’: </em>This feature denotes the estimated diameter of the asteroid in kilometres (KM).</li><li><em>‘Est Dia in M(min)’: </em>This feature denotes the estimated diameter of the asteroid in meters(M).</li><li><em>‘Relative Velocity km per sec’: </em>This feature denotes the relative velocity of the asteroid in kilometre per second.</li><li><em>‘Relative Velocity km per hr’: </em>This feature denotes the relative velocity of the asteroid in kilometre per hour.</li><li><em>‘Orbiting Body’: </em>This feature denotes the planet around which the asteroid is revolving.</li><li><em>‘Jupiter Tisserand Invariant’: </em>This feature denotes the Tisserand’s parameter for the asteroid. <strong>Tisserand’s parameter</strong> (or <strong>Tisserand’s invariant</strong>) is a value calculated from several orbital elements(semi-major axis, orbital eccentricity, and inclination) of a relatively small object and a more substantial‘ perturbing body’. It is used to distinguish different kinds of orbits.</li><li><em>‘Eccentricity’: </em>This feature denotes the value of eccentricity of the asteroid’s orbit. Just like many other bodies in the solar system, the realms made by <strong>asteroids</strong> are not perfect circles, but ellipses. The axis marked <strong>eccentricity</strong> is a measure of how far from circular each orbit is: the smaller the <strong>eccentricity</strong> number, the more circular the realm.</li><li><em>‘Semi Major Axis’: </em>This feature denotes the value of the <strong>Semi Major Axis </strong>of the asteroid’s orbit. As discussed above, the realm of an asteroid is elliptical rather than circular. Hence, the Semi Major Axis exists.</li><li><em>‘Orbital Period’: </em>This feature denotes the value of the orbital period of the asteroid. <strong>Orbital period </strong>refers to the time taken by the asteroid to make one full revolution around its orbiting body.</li><li><em>‘Perihelion Distance’: </em>This feature denotes the value of the Perihelion distance of the asteroid. For a body orbiting the Sun, the point of least distance is the <strong>perihelion.</strong></li><li><em>‘Aphelion Dist’: </em>This feature denotes the value of Aphelion distance of the asteroid. For a body orbiting the Sun, the point of greatest distance is the <strong>aphelion.</strong></li><li><em>‘Hazardous’: </em>This feature denotes whether the asteroid is hazardous or not.</li></ol><p>To sum up, the features present in the dataset covers not only the information about the geometry of the asteroid but also its path and speed.</p><h3>THE APPROACH</h3><p>It is worth noting the fact that the asteroids, generally, more prominent in size are hazardous than those which are comparatively smaller.<br>If we consider the mean of the diameter of the asteroids that are labelled as hazardous in this dataset, then it turns out to be <strong>0.70 KM. </strong>In contrast, the mean of the diameter of the non-hazardous asteroids turns out to be <strong>0.40 KM.<br></strong>Hence, we conclude that the dataset supports the general theory.</p><p>Let us begin.</p><h3>Feature Engineering</h3><p>As one can see, there are several unnecessary features present in the dataset which hardly contribute towards classification.<br>The features ‘<em>Name</em>’ and ‘<em>Neo Reference ID</em>’ denote the identification number given to an asteroid. These features are not useful for the machine learning model since the name of the asteroid does not contribute to the fact that it is hazardous. Also, both features contain the same values.<br>Thus, we can delete both features.</p><p>The feature <em>‘Close Approach Date’ </em>is also unnecessary since it gives the date of when the asteroid will be near Earth. The time at which the asteroid was closest to Earth does not contribute to the fact ‘<strong>whether</strong>’ that asteroid will be hazardous or not. Instead it tells ‘<strong>when</strong>’. Thus, we are deleting this feature as well.<br>For a similar reason, we will also delete the <em>‘Orbit Determination Date’ </em>feature<em>.</em></p><p>Now, let us look at the <em>‘Orbiting Body’</em> feature. It only contains one value “Earth”. Hence, deleting this feature also(since a feature with just one value does not contribute to the machine learning technique).<br>Also, the feature <em>‘Equinox’ </em>contains only one value ‘J2000’, thus, deleting this feature too.</p><p>Consider the features:</p><p><em>‘Est Dia in KM(min)’, ‘Est Dia in KM(max)’,<br>‘Est Dia in M(min)’, ‘Est Dia in M(max)’,<br>‘Est Dia in Miles(min)’, ‘Est Dia in Miles(max)’,<br>‘Est Dia in Feet(min)’, ‘Est Dia in Feet(max)’</em></p><p>All these features represent the estimated diameter of the asteroid in different units, KM = kilometre, M = meter, etc. This is an excellent example of redundant data since it is the same value represented differently. Such redundancy should be removed. The beauty of statistical analysis is that it identifies such errors in the dataset, even if a data scientist misses them. Let us not remove these features now, but have them identified statistically.</p><p>The removal of the above features so far was intuition-based. Now let us look at the statistical analysis and find out which features are statistically relevant.</p><h3>Statistical Analysis</h3><p>Before, proceeding let us look at the <em>‘hazardous’ </em>feature. The values are ‘TRUE’ or ‘FALSE’, encoding these to 1 and 0, respectively.</p><p>Now, let us form the correlation matrix of the dataset.</p><p>Incomplete Story Keep Checking for Updated Sections.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c20f3c15ff1e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science-east-africa/asteroids-classification-classifying-whether-an-asteroid-is-hazardous-c20f3c15ff1e">Asteroids Classification: Classifying Whether an Asteroid is Hazardous.</a> was originally published in <a href="https://medium.com/data-science-east-africa">Data Science East Africa</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Science Beginner’s Guide.]]></title>
            <link>https://mwendahmbaabu.medium.com/data-science-beginners-guide-d884e713c56b?source=rss-ee91ffa4ec7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d884e713c56b</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[GrayHat - Harun Mwenda]]></dc:creator>
            <pubDate>Thu, 21 Jan 2021 11:41:35 GMT</pubDate>
            <atom:updated>2021-01-21T11:46:11.648Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*HAVTMoQ0xlNh3bFaynkYPw.jpeg" /></figure><p><strong>Data Science</strong> is the area of study which involves extracting insights from vast amounts of data by the use of various scientific methods, algorithms, and processes. It helps you to discover hidden patterns from the raw data. The term Data Science has emerged because of the evolution of mathematical statistics, data analysis, and big data.</p><p>Data Science is an interdisciplinary field that allows you to extract knowledge from structured or unstructured data. Data science enables you to translate a business problem into a research project and then translate it back into a practical solution.</p><h3>Components of Data Science.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*ceT7MxcW6ZXS-knh8WzTYQ.png" /></figure><h3>1). Statistics:</h3><p>Statistics is the most critical unit of Data Science basics. It is the method or science of collecting and analyzing numerical data in large quantities to get useful insights.</p><h3>2). Visualization:</h3><p>Visualization technique helps you to access huge amounts</p><p>of data in easy to understand and digestible visuals.</p><h3>3). Machine Learning:</h3><p>Machine Learning explores the building and study of algorithms which learn to make predictions about unforeseen/future data.</p><h3>4). Deep Learning:</h3><p>Deep Learning method is new machine learning research where the algorithm selects the analysis model to follow.</p><h3>Data Science Process</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*K7023sNgvovv9jx0h7vw4A.png" /></figure><h3>1. Discovery:</h3><p>Discovery step involves acquiring data from all the identified internal &amp; external sources which helps you to answer the business question.</p><p>The data can be:</p><ul><li>Logs from webservers</li><li>Data gathered from social media</li><li>Census datasets</li><li>Data streamed from online sources using APIs</li></ul><h3>2. Preparation:</h3><p>Data can have lots of inconsistencies like missing value, blank columns, incorrect data format which needs to be cleaned. You need to process, explore, and condition data before modeling. The cleaner your data, the better are your predictions.</p><h3>3. Model Planning:</h3><p>In this stage, you need to determine the method and technique to draw the relation between input variables. Planning for a model is performed by using different statistical formulas and visualization tools. SQL analysis services, R, and Python are some of the tools used for this purpose.</p><h3>4. Model Building:</h3><p>In this step, the actual model building process starts. Here, Data scientist distributes datasets for training and testing. Techniques like association, classification, and clustering are applied to the training data set. The model once prepared is tested against the “testing” dataset.</p><h3>5. Operationalize:</h3><p>In this stage, you deliver the final baselined model with reports, code, and technical documents. Model is deployed into a real-time production environment after thorough testing.</p><h3>6. Communicate Results</h3><p>In this stage, the key findings are communicated to all stakeholders. This helps you to decide if the results of the project are a success or a failure based on the inputs from the model.</p><p>Data science has numerous job roles and opportunity, below is a list of common data science job roles:</p><ul><li>Data Scientist</li><li>Data Engineer</li><li>Data Analyst</li><li>Statistician</li><li>Data Architect</li><li>Data Admin</li><li>Business Analyst</li><li>Data/Analytics Manager</li></ul><p>Thank you for Reading, if this was helpful remember to check data science east Africa on twitter and LinkedIn for updates and more insight sand free boot camp opportunities</p><h4>Data Science East Africa : https://twitter.com/DataScience_Ea</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d884e713c56b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>