<?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 Matilda Awuor on Medium]]></title>
        <description><![CDATA[Stories by Matilda Awuor on Medium]]></description>
        <link>https://medium.com/@awuormatilda85?source=rss-8530cc79f209------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1qoHzQ0xEAUhjYQY</url>
            <title>Stories by Matilda Awuor on Medium</title>
            <link>https://medium.com/@awuormatilda85?source=rss-8530cc79f209------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 10:27:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@awuormatilda85/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[Data Engineering: Data warehouse tech stack with MySQL, DBT, Airflow]]></title>
            <link>https://medium.com/@awuormatilda85/data-engineering-data-warehouse-tech-stack-with-mysql-dbt-airflow-fb11a7bf2561?source=rss-8530cc79f209------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb11a7bf2561</guid>
            <dc:creator><![CDATA[Matilda Awuor]]></dc:creator>
            <pubDate>Sun, 24 Jul 2022 20:17:57 GMT</pubDate>
            <atom:updated>2022-08-04T08:25:57.027Z</atom:updated>
            <content:encoded><![CDATA[<h4>Business Objective</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9tw2PEcfLHYwGI5O" /></figure><p>A city traffic department wants to collect traffic data using swarm UAVs (drones) from a number of locations in the city and use the data collected for improving traffic flow in the city and for a number of other undisclosed projects.</p><p>The aim for this project is creating a scalable data warehouse that will host the vehicle trajectory data extracted by analysing footage taken by swarm drones and static roadside cameras.</p><p>In this project we are making an ELT data pipeline. But before we start, let’s define the abbreviations;</p><ol><li><strong>E</strong>: Extract, refers to the process of getting data from the source.</li><li><strong>L</strong>: Load, refers to the process of loading the data into a table to be used.</li><li><strong>T</strong>: Transform, refers to the process of transforming the raw data from the source (eg: joins with other tables, group by, column mapping, denormalizing, lookups on external database, machine learning modeling, etc).</li></ol><p>ELT is mostly used when we don’t really know the type of transformation needed for the data.</p><h4>Data</h4><p>In <a href="https://open-traffic.epfl.ch/index.php/downloads/#1599047632450-ebe509c8-1330">Downloads — pNEUMA | open-traffic (epfl.ch)</a> you can find a pNEUMA data: pNEUMA is an open large-scale dataset of naturalistic trajectories of half a million vehicles that have been collected by a one-of-a-kind experiment by a swarm of drones in the congested downtown area of Athens, Greece. Each file for a single (area, date, time) is ~87MB data.</p><h4>Definitions</h4><p>Before we get our hands dirty, let us get some definitions cleared up on the kind of tools I used for this project and a bit on how they work;</p><ol><li>For data engineering pipelines, <strong>Apache Airflow</strong> is a free and open-source workflow management system.</li><li>The basic idea of Airflow is a <strong>DAG </strong>(Directed Acyclic Graph), which groups tasks and organizes them with dependencies and linkages to specify how they should operate.</li><li>Data engineers and analysts may transform, test, and record data in the cloud data warehouse using <strong>dbt</strong>, a tool for data transformation.</li><li>A <strong>data warehouse (DWH)</strong> is a system for gathering and controlling data from many sources to produce valuable business insights.</li><li><strong>Redash </strong>is a free and open-source web application. It is utilized to clear databases and display the outcomes.</li><li><strong>Docker</strong> is a collection of platform-as-a-service tools that distribute software in packages known as containers using OS-level virtualization.</li></ol><h4>Architecture</h4><p>The architecture I used for this project is as shown below. The precise descriptions on how I did the implementation follows thereafter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N3U5K5FlrE7W-EvQ" /></figure><p><strong>Step 1</strong></p><p>The first thing I did was to download the <a href="https://open-traffic.epfl.ch/index.php/downloads/#1599047632450-ebe509c8-1330">data</a> locally to my PC. The data came in form of a csv file (75mbs).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m9te2e0j8FUkcsSnBKniJA.png" /><figcaption>Download page</figcaption></figure><p>To download the data, you should select a location, date, and time. You also need to agree to the terms and conditions to activate the download button.</p><p><strong>Step 2</strong></p><p>The next step I took was to set up a new <a href="https://github.com/Tilda98/Data_Warehouse_ELT">repo</a> with the default files. I then proceeded to setting up the environments for the project on my local text editor (VS Code). This is how I did that;</p><ul><li>I first downloaded the Apache Airflow on Docker (since I wanted to Dockerize everything) via my terminal and made sure that it was running.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K0CltN7o4M9_twn9mr9Mcw.png" /></figure><ul><li>Next, I created a dag file and went ahead to configure it so as to load my data into the warehouse.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*psn-9wWrAxzI07lhvnMneA.png" /><figcaption>Dag graph showing success in loading data</figcaption></figure><ul><li>Once I ensured that everything was running in my airflow dag, I went ahead and setup my Data Build Tool(DBT).</li><li>Because I was experiencing trouble downloading directly from the terminal, I had to create a virtual environment to install it using the pip install command to install DBT,</li></ul><p><strong>Step 3</strong></p><p>Connect the warehouse to Redash and start creating tables for visualizations!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mnsk5a2UdGm6aWKL7SxMVQ.png" /><figcaption>Redash query page</figcaption></figure><h4>Conclusion</h4><p>I successfully managed to set my Airflow and load my data. I also set up DBT and wrote a dag to transform the data but unfortunately the dag task failed to run as shown below.</p><h4>Future Plans</h4><p>Highlighted below are my future plans for this project,</p><ol><li>Work on the dag file and ensure that the workflow runs successfully</li><li>Automate the dbt to Airflow connection by automatically creating DAGS out of dbt metadata</li></ol><h4>Resources</h4><ul><li><a href="https://www.getdbt.com/">Deliver trusted data with dbt | dbt Labs</a></li><li><a href="https://docs.getdbt.com/dbt-cli/installation/#pip">How to install dbt | dbt Docs</a></li><li><a href="https://livebook.manning.com/book/data-pipelines-with-apache-airflow/chapter-1/v-6">1 Meet Apache Airflow · Data Pipelines with Apache Airflow</a></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FfqMOX6JJhGo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfqMOX6JJhGo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FfqMOX6JJhGo%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c7e327130c0181957b21e7782f1ac500/href">https://medium.com/media/c7e327130c0181957b21e7782f1ac500/href</a></iframe><ul><li><a href="https://panoply.io/data-warehouse-guide/data-warehouse-testing-101/">Data Warehouse Testing 101</a></li><li><a href="https://github.com/dwyl/learn-redash">GitHub - dwyl/learn-redash: Learn how to use Redash to query and display your database data</a></li><li><a href="https://fitdevops.in/how-to-setup-redash-dashboard-on-ubuntu">How to Setup Redash Dashboard on Ubuntu | Fit-DevOps</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb11a7bf2561" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Refund by Location Smart Contract]]></title>
            <link>https://medium.com/@awuormatilda85/refund-by-location-smart-contract-aaf771ccdfed?source=rss-8530cc79f209------2</link>
            <guid isPermaLink="false">https://medium.com/p/aaf771ccdfed</guid>
            <dc:creator><![CDATA[Matilda Awuor]]></dc:creator>
            <pubDate>Sat, 16 Jul 2022 20:30:10 GMT</pubDate>
            <atom:updated>2022-07-16T20:30:10.071Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/848/0*mtAkYASko46unEV9.jpg" /></figure><h4>Business Overview</h4><p>The refund by location smart contract is intended to be used in situations where one party, like as an employer, agrees to pay another party, such as an employee, for their presence in a specific location for a specific amount of time. At predetermined intervals, the employee’s phone updates a smart contract with its GPS location. When all predetermined conditions are satisfied, a cryptocurrency payment is carried out based on the pre-agreed contract that is recorded in an Ethereum smart contract.</p><p>If, at any point, the GPS sensor indicates that an employee is outside the range of the agreed GPS area, the contract state will be updated to indicate that it is out of compliance.</p><h4>Objective</h4><p>The goal of this project is to create an Ethereum-based decentralized application (dApp) with a smart contract that has been tested and deployed in a testnet and a front end that will enable status monitoring.</p><h4>Technologies Used</h4><p>Hardhat — I used hardhat Ethereum smart contract development environment.</p><p>Solidity — I used Solidity programming for implementing the smart contract on Ethereum blockchain.</p><p>Reactjs — I used React for my frontend development.</p><p>Before we dive into the workflow, I will explain a few terms to help us understand Ethereum better.</p><ol><li><strong>Ethereum </strong>is a public database that records digital transactions indefinitely. Importantly, this database doesn’t require any central authority to maintain and secure it. Instead it operates as a “trustless” transactional system — a framework in which individuals can make peer-to-peer transactions without needing to trust a third party OR one another.</li></ol><p>The main components that the Ethereum system is comprised of:</p><ul><li><strong>Accounts </strong>— many small objects (“accounts”) that are able to interact with one another through a message-passing framework.</li><li><strong>state</strong></li><li><strong>gas and fees</strong> — Every computation that occurs as a result of a transaction on the Ethereum network incurs a fee. The fees necessary for a specific computation are measured in gas. The price of gas is expressed in “gwei,” which is the amount of ether you are willing to pay for each unit of gas. The smallest unit of Ether is “Wei,” where 1018 Wei equal one Ether. 1,000,000,000 Wei make up one gwei.</li><li><strong>Transactions </strong>— A transaction is an instruction created by an externally owned account, serialized, and added to the blockchain. It is cryptographically signed. Transactions come in two forms: message calls and contract creations.</li><li><strong>Blocks </strong>— Blocks are collective groups of transactions. A chained together collection of similar blocks is called a blockchain.</li></ul><p>A block in Ethereum consists of:</p><p>a. the block header</p><p>b. details on the group of transactions that make up that block</p><p>c. a group of additional block headers for the ommers of the present block. An ommer is a block whose parent is the same as the parent of the present block.</p><ul><li><strong>transaction execution</strong> — A transaction must meet an initial set of requirements in order to be executed i.e.. to transition the state of Ethereum to include your transaction. The Ethereum Virtual Machine(EVM), which is a component of the protocol that really handles processing transactions, was created by Ethereum.</li><li><strong>Mining</strong> — Using random slices of the information, miners can create a “mixHash” by combining their hashes using a mathematical function. The output of a miner will be continuously generated until it falls below the intended target nonce.</li><li><strong>proof of work</strong> — The algorithm that gives meaning to block difficulty is called Proof of Work (PoW). Ethereum’s proof-of-work algorithm is called “<a href="https://github.com/ethereum/wiki/wiki/Ethash">Ethash</a>” (previously known as Dagger-Hashimoto).</li></ul><p>2. <strong>Smart contract</strong> — A smart contract is a computer program or transaction protocol designed to automatically carry out, manage, or record legally significant events and activities in accordance with the conditions of a contract or agreement.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aaf771ccdfed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Speech-to-text data collection with Kafka, Airflow, and Spark]]></title>
            <link>https://medium.com/@awuormatilda85/speech-to-text-data-collection-with-kafka-airflow-and-spark-88c5943b23ce?source=rss-8530cc79f209------2</link>
            <guid isPermaLink="false">https://medium.com/p/88c5943b23ce</guid>
            <dc:creator><![CDATA[Matilda Awuor]]></dc:creator>
            <pubDate>Sat, 09 Jul 2022 20:49:03 GMT</pubDate>
            <atom:updated>2022-07-12T06:52:19.714Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SdvNtxYt5Bzr-yp5.jpeg" /></figure><p><strong>Business Objective</strong></p><p>Understanding the importance of huge data sets for speech-to-text applications, the chance presented by the availability of several bilingual text corpora, and the relevance of complicated data engineering abilities to your profile.</p><p>The aim of this project is to build a data capturing pipeline that allows recording millions of Amharic and Swahili speakers reading digital texts on in-app and web platforms.</p><p>To create a Kafka cluster that is reliable, big-scale, fault-tolerant, and highly available so that it can be used to post sentences and receive audio files. 10 Academy is the client.</p><p><strong>Workflow</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6Dr8UdZ7mGpafxe9.jpg" /><figcaption>The workflow we used for this project</figcaption></figure><p><strong>Data</strong></p><p>For this project, the Amharic news text classification <a href="https://github.com/IsraelAbebe/An-Amharic-News-Text-classification-Dataset">dataset</a> with a baseline performance dataset is used. The aim of this project is to produce a tool that can be deployed to process posting and receiving text and audio files from and into a data lake.</p><p>You can read a brief description of the data <a href="https://arxiv.org/pdf/2103.05639.pdf">here</a>.</p><p><strong>Alternative data</strong></p><p>Ready-made Amharic data collected from different sources <a href="https://drive.google.com/file/d/1_YLX27TdACjIF1iu8e3t-kkTb1qBlLkO/view?usp=sharing">here</a></p><h3><strong>Technologies Used</strong></h3><ol><li><strong>Kafka</strong> :- Apache Kafka is a distributed data store optimized for ingesting and processing streaming data in real-time. Streaming data is data that is continuously generated by thousands of data sources, which typically send the data records in simultaneously.</li><li><strong>Airflow</strong> :- Apache Airflow is an open-source platform for authoring, scheduling and monitoring data and computing workflows. Airflow uses Python to create workflows that can be easily scheduled and monitored. We are using airflow because we can schedule a task as soon as an event is triggered which the Kafka system is based on. Also we can easily use it and integrate with our other tools</li><li><strong>Spark</strong> :- Spark is a general-purpose distributed data processing engine that is suitable for use in a wide range of circumstances. It is suitable for this project because we can process and clean big data(audios) from our users with ease. It will helps to process, clean and store our data in a S3 bucket</li></ol><h3><strong>Methodologies Used</strong></h3><p><strong>Methodology-1</strong></p><p>There are 3 main components to the pipeline. Starting from managing the user interaction beginning with the application portion. The user can use the program to send their dictation and request texts to be dictated (as an audio recording of the text).</p><p><strong>Methodology-2</strong></p><p>Then spark will pick up the data from the cluster and do the necessary preprocessing steps and load it to the s3 bucket the s3 bucket will be used to store the data that is continuously read from the ‘Text-Audio-Input’ topic by a consumer that the Airflow component schedules every two minutes.</p><p><strong>Methodology-3</strong></p><p>The audio files will be retrieved by the spark component, which if extra necessary preprocessing needed will be applied. and After applying a model to validate the audio with the predetermined text, the audio is saved on the “Processed S3 Bucket” if the validation similarity metric is met.</p><h4><strong>Exploratory Data Analysis</strong></h4><p>The first thing we did was to perform an exploratory analysis on the data so as to get a better understanding of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lcU27qvoSuqNAPZTLMNDkQ.png" /><figcaption>This shows the length of data collected over 6189 days of news</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LAPcx5DbKRFBrOhBC8Uosg.png" /><figcaption>Initial dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*DsZcmUENf5GPIW-XMtf1DQ.png" /><figcaption>Categories of the data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LcfxXFLa39EKF3OcjMgb3A.png" /><figcaption>Audio array</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*oAx25jJQ6_-Emww0lWTWxQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*G48cfpbG-MWD7xXk9yvcMQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*3hqWahL2sFlpW4k1dX8fXA.png" /><figcaption>Spectoral Centroid, rolloff and bandwidth</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*L3q0vlfUlQUPeOQ-QByw2g.png" /><figcaption>Data Augmentation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JfF1e0r1v8Yx9BJgJrNXNg.png" /><figcaption>Mel-Frequency Cepstral Coefficients(MFCCs)</figcaption></figure><h4>Implementation</h4><p>We used a Javascript tag for the user interface that was connected to Kafka using their Javascript API called Kafkajs. Users may view a text from the CSV file we utilized, which was compiled from news stations all around Ethiopia, on the interface.</p><p>Following that, the user is prompted to translate the text that was displayed. The audio file containing the following transcript will be published to the Kafka cluster once the user recorded their voice and clicked the save button.</p><p>We will utilize the PySpark API to communicate with Spark once the data has been placed on Kafka. Spark will be a subscriber to the Kafka cluster and will receive the following metadata, preprocess it, and then store it on an S3 bucket.</p><p>The data pipeline workflow process is scheduled in this process using airflow. The next phase is ensured to proceed as soon as an event is triggered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WqCQv_9QydewNerKESxxWw.png" /><figcaption>Front page of our Netlify app</figcaption></figure><h4>Lessons learned</h4><p>In order to build out the pipeline and finally deploy the tools that would allow recording millions of Amharic and Swahili speakers reading digital texts on app and online platforms, we had the opportunity to work with Kafka, Airflow, Spark, and S3 bucket.</p><p>We also learnt about the value of working in teams.</p><p><strong>Future plans</strong></p><p>Implementing the use of Word Error Rate (WER) to check the accuracy of our models.</p><h4>References</h4><ul><li><a href="https://dev.to/florimondmanca/breaking-news-everything-is-an-event-streams-kafka-and-you-2n9j">https://dev.to/florimondmanca/breaking-news-everything-is-an-event-streams-kafka-and-you-2n9j</a></li><li><a href="https://www.kai-waehner.de/blog/2020/08/07/apache-kafka-handling-large-messages-and-files-for-image-video-audio-processing/">https://www.kai-waehner.de/blog/2020/08/07/apache-kafka-handling-large-messages-and-files-for-image-video-audio-processing/</a></li><li><a href="https://towardsdatascience.com/why-apache-airflow-is-a-great-choice-for-managing-data-pipelines-48effcce3e41">https://towardsdatascience.com/why-apache-airflow-is-a-great-choice-for-managing-data-pipelines-48effcce3e41</a></li><li><a href="https://acloudguru.com/hands-on-labs/installing-a-kafka-cluster-and-creating-a-topic">https://acloudguru.com/hands-on-labs/installing-a-kafka-cluster-and-creating-a-topic</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88c5943b23ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AgriTech — USGS LIDAR]]></title>
            <link>https://medium.com/@awuormatilda85/agritech-usgs-lidar-2af4c3037743?source=rss-8530cc79f209------2</link>
            <guid isPermaLink="false">https://medium.com/p/2af4c3037743</guid>
            <dc:creator><![CDATA[Matilda Awuor]]></dc:creator>
            <pubDate>Sat, 25 Jun 2022 20:57:20 GMT</pubDate>
            <atom:updated>2022-06-25T21:19:09.973Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>AgriTech — USGS LIDAR</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8RtlHDcWLtCVSE59" /></figure><p><strong>Business Understanding</strong></p><p>AgriTech, is particularly curious with the way water moves across a field of maize. They can refine their studies on novel agricultural goods being tried on farms with the aid of this information.</p><blockquote>Agri-tech is the application of technology to agriculture that is created to increase productivity and profitability.</blockquote><p>A field’s yield of maize varies greatly depending on its location. Even though agricultural techniques, seeds, and fertilizer are applied uniformly across a field by technology, there may be a great harvest in one area and a little harvest in another.</p><p><strong>Aim</strong></p><p>For the health and growth of crops, water is crucial. If we have a better understanding of how water moves through a field and whether areas are more likely to be flooded or too dry, we can forecast maize harvest more accurately. Measuring the height of the field at various points is a crucial step in comprehending how water flows through a field.</p><p>The aim of this project is to gain a better understanding of how water flows through a field so as to get better predictions of maize harvest.</p><p><strong>Data</strong></p><p><strong>LIDAR high definition elevation data — </strong><a href="https://www.usgs.gov/core-science-systems/ngp/3dep"><strong>USGS 3DEP</strong></a><strong> </strong>— The <a href="https://www.usgs.gov/news/usgs-3dep-lidar-point-cloud-now-available-amazon-public-dataset">USGS recently released high resolution elevation data as a lidar point cloud</a> in a <a href="https://registry.opendata.aws/usgs-lidar/">public dataset on Amazon</a>.</p><p>Since the data is very huge, I decided to use one state data for this project and the steps I took are highlighted below.</p><p>Step 1: Create a pipeline</p><p>First thing I did was to create a pipeline that would be executed for any data given one specifies the boundaries and provides the link to the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*lxTzTUYeZqL7vMkXLCscJg.png" /></figure><p>Step 2: Data fetching Notebook</p><p>First step on the notebook is to import the required libraries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*3YtLfkCvI0yFQ2xVGs-7sQ.png" /></figure><p>Next I loaded the pipeline json file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*TMO_eEq6H-E0DGg7J3BEPQ.png" /></figure><p>This code changes the data into the needed CRS format for better visualization</p><blockquote>Coordinate Reference System (CRS) provides a standardized way of describing locations.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*R7ImEQO_HHZPUuRLAmYwcA.png" /></figure><p>This code converts file to a list and then generates a polygon given a coordinate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*vUXtBPXkqzzoBY9imAxWbg.png" /></figure><p>This cell creates a geo-pandas data frame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*DsuPa1D2Xw1Tu2H2G_4q4A.png" /></figure><p>The first code cell in this image specifies the coordinates for the polygon and the next one displays the polygon on a map.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VCQtaD4DblGzP-nDZN4taw.png" /></figure><p>Map showing the polygon location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*epuxTZdrqKQL_mQZSPR74Q.png" /></figure><p>Code to modify the pipeline so as to fetch the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/1*-4pIeTB0Jsr_A4SPy_rHtA.png" /></figure><p>Executing the pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*1XzMdcUi0LdDqGX0id2wZg.png" /></figure><p>This code cell plots the elevation graph for visualization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*wPFCUAp_OewMlZBFDZE5hw.png" /><figcaption>Elevation graph showing polygon</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*HLysHbLJ_RnSQiwzIfPrOw.png" /><figcaption>Elevation heatmap</figcaption></figure><p><strong>Future works</strong></p><p>In future, I will;</p><ul><li>visualize the data in details for a better understanding of it</li><li>get the Topographic wetness index (TWI) as an additional column returned with geo-pandas data frame</li><li>standardize the grid — A python code that takes elevation points output from the USGS LIDAR tool and interpolates them to a grid.</li></ul><p><strong>References</strong></p><ul><li><a href="https://medium.com/@jasonmcvay09/batch-lidar-processing-made-easy-with-python-pdal-entwine-aws-3a49cb8c26af"><strong>https://medium.com/@jasonmcvay09/batch-lidar-processing-made-easy-with-python-pdal-entwine-aws-3a49cb8c26af</strong></a></li><li><a href="http://pdal.io/tutorial/iowa-entwine.html">http://pdal.io/tutorial/iowa-entwine.html</a></li><li><a href="https://towardsdatascience.com/how-to-automate-lidar-point-cloud-processing-with-python-a027454a536c">https://towardsdatascience.com/how-to-automate-lidar-point-cloud-processing-with-python-a027454a536c</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2af4c3037743" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[End-to-End Web3 dApps]]></title>
            <link>https://medium.com/@awuormatilda85/end-to-end-web3-dapps-74255e1842c2?source=rss-8530cc79f209------2</link>
            <guid isPermaLink="false">https://medium.com/p/74255e1842c2</guid>
            <dc:creator><![CDATA[Matilda Awuor]]></dc:creator>
            <pubDate>Sat, 18 Jun 2022 20:35:14 GMT</pubDate>
            <atom:updated>2022-06-19T07:14:47.834Z</atom:updated>
            <content:encoded><![CDATA[<p>Certificate generation, distribution, and value transfer with Algorand NFTs and smart contracts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*3Xe0Xu6Xy8unefLI.jpg" /></figure><p><strong>Business Objective</strong></p><p>This project uses Web3 Technology to create Non-Fungible Tokens(NFTs) for trainees at 10 Academy instead of the PDF certificates they have been issuing in the past. The purpose of this is in order to ensure authenticity of the certificates.</p><p>Before we dive into the project details, let us first see what Web3 means and how different it is from Web1 and Web2:</p><blockquote>Inherently, Web3 technology is about a user-controlled internet. A increasing stack of decentralized technologies, such as blockchains, smart contracts, oracles, crypto wallets, storage networks, and more, are helping to realize this goal.</blockquote><p>Highlighted in the figure below are brief descriptions showing the differences between the three.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hjbOFYJ5JfP8zCtN" /><figcaption>internet evolution</figcaption></figure><p>Algorand Blockchain as the foundational element of the NFT. The Blockchain that will help 10 Academy generate and distribute Non-Fungible Tokens (NFTs) as certificates that will represent the successful completion of a weekly challenge to trainees, and allow trainees with NFTs to interact with a smart contract to perform pre-defined actions.</p><blockquote>A <strong>non-fungible token</strong> is a financial security made up of digital data kept in a distributed ledger called a blockchain. The blockchain records the ownership of an NFT, which can be transferred by the owner, allowing NFTs to be sold and exchanged.</blockquote><p><strong>Business Understanding</strong></p><p>Creator — 10 Academy team(creators of the NFTs)</p><p>Owner — 10 Academy team (the original owners of the NFTs)</p><p>Manager — 10 Academy team (they manage the NFTs)</p><p>Once the trainee has successfully completed the week’s course, they log into the system and are requested for their public key(pk) which will direct them to their NFT. They can then claim their certificate by signing using their private key/ secret key(sk).</p><p>Once the NFT has been claimed, the ownership is transferred to the trainee. The manager has the ability to freeze the NFT to prevent it from being shared.</p><p>All these are referred to as transactions. For every transaction an amount of Algos are deducted to fund it. Algorand Blockchain’s system has been curated to seek for permission from the original manager. So the manager will have to sign using their secret key before they transfer the ownership to the new manager. The trainee cannot mint their NFT without the manager’s signature.</p><h3><strong>Steps to build the Web3 dApp</strong></h3><p>Step 1: Clone and initiate the Algorand Sandbox</p><p>Step 2: Interact with the Sandbox</p><p>Step 3: Create a token, asset on testnet</p><p>Step 4: Built frontend and backend</p><p>I used React and Flask for frontend and backend respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bNkjgD4O9cHARJF6GlywMg.png" /><figcaption>login page</figcaption></figure><p><strong>References</strong></p><ul><li><a href="https://www.google.com/search?q=nft&amp;oq=nft&amp;aqs=chrome.0.69i59j0i67i433l3j46i175i199i512j69i60l3.18972j0j7&amp;sourceid=chrome&amp;ie=UTF-8">https://www.google.com/search?q=nft&amp;oq=nft&amp;aqs=chrome.0.69i59j0i67i433l3j46i175i199i512j69i60l3.18972j0j7&amp;sourceid=chrome&amp;ie=UTF-8</a></li><li><a href="https://www.youtube.com/watch?v=7LNl2JlZKHA">https://www.youtube.com/watch?v=7LNl2JlZKHA</a></li><li><a href="https://www.youtube.com/watch?v=1i5wOpAg-lc">https://www.youtube.com/watch?v=1i5wOpAg-lc</a></li><li><a href="https://www.youtube.com/watch?v=yubzJw0uiE4">https://www.youtube.com/watch?v=yubzJw0uiE4</a></li><li><a href="https://www.youtube.com/watch?v=d8IBpfs9bf4">https://www.youtube.com/watch?v=d8IBpfs9bf4</a></li><li><a href="https://www.youtube.com/watch?v=ryk-tKyZUpk">https://www.youtube.com/watch?v=ryk-tKyZUpk</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74255e1842c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[African language Speech Recognition (Amharic language)]]></title>
            <link>https://medium.com/@awuormatilda85/african-language-speech-recognition-amharic-language-6a536833bc3?source=rss-8530cc79f209------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a536833bc3</guid>
            <dc:creator><![CDATA[Matilda Awuor]]></dc:creator>
            <pubDate>Thu, 09 Jun 2022 20:36:45 GMT</pubDate>
            <atom:updated>2022-06-09T21:25:22.564Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Speech-to-Text</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fZ7AYX6wsyq14XYw.png" /></figure><p><strong>Abstract</strong></p><p>The goal of this project is to convert Amharic spoken sounds into a written format. This report will help us understand the methods used to design a deep learning model. Following the model’s creation, we will build example transcriptions using a training set of audio recordings.</p><p><strong>Introduction</strong></p><p>The World Food Program plans to use an intelligent form to collect nutritional information on food purchased and sold in three African markets.</p><p>This intelligent form’s design requires selected users to download an app to their phone, then use their voice to activate the app to register the list of things they just purchased in their own language whenever they buy food. The app’s cognitive technologies are expected to convert Amharic speech to Amharic text and organize the data in an easy-to-process structure.</p><p>My friends and I built an accurate and resistant to noise deep learning model that attempts to convert speech to text. More about how the model works is explained in this post.</p><h3><strong>Motivation</strong></h3><p>Automatic Speech Recognition systems(ASRs) are useful in a wide range of scenarios. Ideally, ASRs are used for any work involving computer interaction.</p><p>The following are some of the most common applications of speech recognition technology:</p><ul><li>Dictation systems include medical transcriptionists,</li><li>Legal and business dictation,</li><li>Conventional word processing.</li></ul><p>Recording audio voice is easier than typing on a keyboard. This will be the primary incentive for this project. Non-technical WFP (World Food Program) employees make up the majority of those working on this project. As a result, recording cooking products and products utilizing audio / voice of the individual is the simplest and most straightforward method.</p><h3>Data and preprocessing</h3><p>Data</p><ul><li>Amharic: <a href="https://github.com/getalp/ALFFA_PUBLIC">Speech Recognition ASR format (~20hr training and ~2hrs test)</a></li><li>Swahili: <a href="https://github.com/getalp/ALFFA_PUBLIC">Speech Recognition ASR format (~10hr training and ~1.8hrs test)</a></li></ul><p>Before using the data for our model we had to clean and preprocess the provided audio files. This step helps us to get clean data that can be used and can easily be processed by the model resulting in more accurate prediction.</p><p>Here are some of the steps we used at preprocessing stage:</p><ul><li>Preparing meta data</li><li>Spectrogram generation</li><li>Standardizing the sample rate</li><li>Audio resizing</li><li>Converting mono to stereo</li><li>Data augmentation</li></ul><h4>Preparing metadata</h4><p>Metadata is information that is used to link an audio file to its transcribed counterpart. A Meta data file named ‘trsTrain.txt’ with a white space separated audio id and transcription is extracted in our dataset. Here’s how it looks after the Meta data has been generated and converted to a csv file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/0*fURb7jnj8n65jeec" /></figure><h4>Spectrogram Generation</h4><p>The next step was to create a spectrogram after we had the metadata and audio files. It is a visual depiction of an audio with the x-axis representing time, the y-axis representing frequency, and the image’s blackness describing the audio’s intensity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/0*vZ18H3xIfZvD-hkf" /><figcaption>Spectrogram</figcaption></figure><h4>Sample Rate Standardization</h4><p>Most sounds in the train folder had different sampling rates. For our model to be fair and free from bias we standardized to make our sampling rate constant for all the audios. We made the sampling rate 44 KHz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/0*tAjklzLWTcgwURZr" /><figcaption>Standardizing Sample Rate</figcaption></figure><p><strong>Audio Resizing</strong></p><p>During this stage we found out that most of the audios were more than 5 seconds and having also more than half silent sound in them. So we truncated each audio to be less than 5 seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/0*tMHxbIAvHsiI0LWr" /><figcaption>Resizing Audio</figcaption></figure><h4>Converting mono to stereo</h4><p>Monaural or monophonic sound reproduction is intended to be heard as if it were a single channel of sound perceived as coming from one position. Stereophonic sound or, more commonly, stereo, is a method of sound reproduction that creates an illusion of multi-directional audible perspective.</p><p>So we changed all the audios to common stereo audio format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/0*N9LHyajDwM40VX73" /><figcaption>mono to stereo</figcaption></figure><h4>Data Augmentation</h4><p>The last step we did on our preprocessing was to augment our audios. This step will help us to have a model that is robust and resistant to noises. Among different data augmentation techniques we use time shift for our data augmentation phase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*_PKTsGmYVyoW5CIyLE3upg.png" /><figcaption>time shift</figcaption></figure><h3>Review of previous work</h3><p>Despite the fact that ASR research for technologically favored languages has been ongoing for more than 50 years, Amharic speech recognition research has only recently begun. Speech recognition for Ethiopic languages has been the subject of a number of studies.</p><p>Some of the works are:</p><p>- Zegaye S. (2003) HMM based large vocabulary, Speaker Independent, Continuous Amharic Speech Recognizer, M.Sc. Thesis, Addis Ababa University, Addis Ababa</p><p>- Bereket K. (2008): developing a speech synthesizer for Amharic language using Hidden Markov Model, M.Sc. Thesis, Addis Ababa University, Addis Ababa</p><p>- Solomon B. (2001): Isolated Amharic Consonant-Vowel (CV) syllable Recognition: an experiment using the Hidden Markov Model, M.Sc. Thesis, Addis Ababa University, Addis Ababa</p><p>- Kinfe T. (2002) : sub-word based Amharic word recognition : an experiment using Hidden Markov Model, M.Sc. Thesis, Addis Ababa University, Addis Ababa</p><h3>Deep learning architecture</h3><p>The deep learning architecture we used is a combination of a 2D CNN, RNN and a Connectionist Temporal Classification (CTC) loss to build an ASR.</p><blockquote>CNNs excel at extracting unlabeled features from hierarchical or geographical data. Images or written characters could be used. CNNs work with inputs of a fixed size and produce outputs of the same size.</blockquote><blockquote>RNNs excel at processing data that is either temporal or otherwise sequential. Letters or words in a body of literature, stock market data, or speech recognition are all possibilities. RNNs can take in and output data of any length. LSTMs are a type of RNN that allows you to decide how much of your previous training data is remembered, or better yet, forgotten.</blockquote><p>Convolutional methods can be grouped into 1-dimensional and 2-dimensional networks, respectively.</p><p>2D-CNNs construct 2D feature maps from the acoustic signal. Similar to images, they organize acoustic features i.e., MFCC features, in a 2-dimensional feature map, where one axis represents the frequency domain and the other represents the time domain. In contrast, 1D-CNNs accept acoustic features directly as input.</p><blockquote>CTC is a deep neural network training approach for voice, handwriting, and other sequence problems. When the alignment of the input and output is unknown, CTC is employed.</blockquote><p>The model’s quality was then assessed using the Word Error Rate (WER).</p><blockquote>WER is calculated by adding up all of the substitutions, insertions, and deletions in a set of recognized words. Divide that number by the total number of words spoken at the time. The WER is the end result.</blockquote><p><strong>Hyperparameters :</strong></p><p>These are various settings that are used to control the learning process. CNNs use more hyperparameters than standard multilayer perceptions. Some of these are Kernel size, padding , stride…etc</p><h3>Model Results</h3><p>We trained the model multiple times in an attempt to obtain a better version of our model and our results were as shown in the figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bYBIuJzWPoElzo5cjxSWZg.png" /><figcaption>Model Inference</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*da0Gq4q7-DviNyLJ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*SSe1K6t2_4nKDe6y.png" /><figcaption>Training on AWS</figcaption></figure><h3>Bias, Fairness</h3><p>Because the data used to train the ASR model in this study is highly political, validation is essential. While this does not fully invalidate our model, it may not be appropriate to use it in other domains without adequate testing and validation because it may have solely learned political terms and may be biased when recommending terms.</p><h3>Future Work</h3><p>To highlight the upcoming study in the speech-related sector, the following recommendations are made and presented based on the experience and numerous obstacles raised in this experiment. Because this research only looks at native and non-native Amharic speakers, it ignores linguistic variations among non-native Amharic speakers. As a result, greater research into dialectical differences among non-native speakers of the language is required.</p><p>Given the constraints, the results are encouraging and demonstrate that a general speech recognition technique capable of translating Amharic SPEECH-TO-TEXT might be built.</p><h3>Reference</h3><p>● <a href="https://machinelearningmastery.com/how-to-choose-loss-functions-when-training-deep-learning-neural-networks/">111 Responses to How to Choose Loss Functions When Training Deep Learning Neural Networks</a></p><p>● <a href="https://algorithmia.com/blog/introduction-to-loss-functions">Introduction to Loss Functions</a></p><p>● <a href="https://www.kdnuggets.com/2021/06/ethics-fairness-ai.html">Ethics, Fairness, and Bias in AI</a></p><p>● <a href="https://www.datarobot.com/trusted-ai-101/ethics/bias-and-fairness/">Bias and Fairness as Dimensions of Trusted AI</a></p><p>● <a href="https://towardsdatascience.com/audio-deep-learning-made-simple-automatic-speech-recognition-asr-how-it-works-716cfce4c706">Audio Deep Learning Made Simple: Automatic Speech Recognition (ASR), How it Works</a></p><p>● <a href="https://paperswithcode.com/task/speech-recognition">Speech Recognition</a></p><p>● <a href="https://github.com/tilayealemu/MelaNet/blob/master/vizualize.ipynb">Tilayealemu melaNet visualization using acoustic model</a></p><p>● <a href="https://www.researchgate.net/publication/329316345_Speech_Recognition_using_Recurrent_Neural_Networks">(PDF) Speech Recognition using Recurrent Neural Networks</a></p><p>● <a href="https://direct.mit.edu/neco/article/12/10/2451/6415/Learning-to-Forget-Continual-Prediction-with-LSTM">Learning to Forget: Continual Prediction with LSTM | Neural Computation | MIT Press</a></p><p>● <a href="https://towardsdatascience.com/audio-deep-learning-made-simple-sound-classification-step-by-step-cebc936bbe5">Audio Deep Learning Made Simple: Sound Classification, step-by-step</a></p><p>● <a href="https://towardsdatascience.com/audio-deep-learning-made-simple-automatic-speech-recognition-asr-how-it-works-716cfce4c706">https://towardsdatascience.com/audio-deep-learning-made-simple-automa tic-speech-recognition-asr-how-it-works-716cfce4c706</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a536833bc3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rossmann Pharmaceutical Sales prediction]]></title>
            <link>https://medium.com/@awuormatilda85/rossmann-pharmaceutical-sales-prediction-85ac44be2a94?source=rss-8530cc79f209------2</link>
            <guid isPermaLink="false">https://medium.com/p/85ac44be2a94</guid>
            <dc:creator><![CDATA[Matilda Awuor]]></dc:creator>
            <pubDate>Sun, 29 May 2022 06:57:54 GMT</pubDate>
            <atom:updated>2022-05-29T06:57:54.376Z</atom:updated>
            <content:encoded><![CDATA[<p>Time Series Analysis of the Pharmaceutical data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ebqynZR9AUv5p9Wq.jpeg" /></figure><p><strong>Business Overview</strong></p><p>The finance team of Rossmann Pharmaceutical wants to forecast sales in all their stores across several cities six weeks ahead of time. Managers in individual stores rely on their years of experience as well as their personal judgment to forecast sales.</p><p><strong>Aim</strong></p><p>The aim of this analysis is to build and serve an end-to-end product that delivers this prediction to analysts in the finance team.</p><p>Before I dive into the analysis, here’s a brief explanation of what time series analysis means.</p><blockquote>A <strong>time series analysis</strong> is a method of studying a collection of data points over a period of time. Instead of capturing data points intermittently or arbitrarily, time series analyzers record data points at constant intervals over a predetermined length of time. This form of analysis, on the other hand, is more than just gathering data over time.</blockquote><p><strong>Data and Features</strong></p><p>The data I used for this analysis was in form of csv files and I got it from Kaggle. It spans from 2013–2015.</p><p>The data team identified factors such as promotions, competition, school and state holidays, seasonality, and locality as necessary for predicting the sales across the various stores. More features are described below. I did a quick pass on the data and I have summarized the insights I got in tables and plots as you will see in this report.</p><p><strong>Id</strong> — an Id that represents a (Store, Date) duple within the test set</p><p><strong>Store</strong> — a unique Id for each store</p><p><strong>Sales</strong> — the turnover for any given day (this is what you are predicting)</p><p><strong>Customers</strong> — the number of customers on a given day</p><p><strong>Open</strong> — an indicator for whether the store was open: 0 = closed, 1 = open</p><p><strong>StateHoliday</strong> — indicates a state holiday. Normally all stores, with few exceptions, are closed on state holidays. Note that all schools are closed on public holidays and weekends. a = public holiday, b = Easter holiday, c = Christmas, 0 = None</p><p><strong>SchoolHoliday</strong> — indicates if the (Store, Date) was affected by the closure of public schools</p><p><strong>StoreType</strong> — differentiates between 4 different store models: a, b, c, d</p><p><strong>Assortment</strong> — describes an assortment level: a = basic, b = extra, c = extended. Read more about assortment <a href="https://en.wikipedia.org/wiki/Retail_assortment_strategies">here</a></p><p><strong>CompetitionDistance</strong> — distance in meters to the nearest competitor store</p><p><strong>CompetitionOpenSince[Month/Year]</strong> — gives the approximate year and month of the time the nearest competitor was opened</p><p><strong>Promo</strong> — indicates whether a store is running a promo on that day</p><p><strong>Promo2</strong> — Promo2 is a continuing and consecutive promotion for some stores: 0 = store is not participating, 1 = store is participating</p><p><strong>Promo2Since[Year/Week] </strong>— describes the year and calendar week when the store started participating in Promo2</p><p><strong>PromoInterval</strong> — describes the consecutive intervals Promo2 is started, naming the months the promotion is started anew. E.g. “Feb,May,Aug,Nov” means each round starts in February, May, August, November of any given year for that store</p><p>For this analysis I used three datasets; store data, test data, and train data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V6Da-Gc9Ipn6NWe1a9wBjQ.png" /><figcaption>Store data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*49P0o9lYpT7wbBJI4yVznA.png" /><figcaption>Test data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*IzI9fp01qNl-72NUp86SeQ.png" /><figcaption>Train data</figcaption></figure><p>The store data is exclusive to stores and train/test data is exclusive to the sales. What we aim to do is to add the store data to the sales data that’s why I merged both train and test data with our store data. This merging is done on one common field (that is store ID). <br>The merged train data will then be used to train your model and the test data for prediction/forecasting.</p><p>I did an analysis to check how the features relate and just to get a clear picture of the data (EDA). The plots below show my findings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*IC_r4vEljq_3LhqvylJpWA.png" /><figcaption>From these plots we see that the sales increased when there was no holiday and, there was a higher record of sales on the public holiday as compared to the Easter and Christmas holidays.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*IsLkBYa0HZBNX0ly6rs8aQ.png" /><figcaption>This graph shows that the sales are higher on ordinary days as compared to the holidays.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*ckPEGPq9PtxBwSB4ZSavpA.png" /><figcaption>The correlation between sales and customers is considered to be high as the plot shows.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FqkSpbc-VGetjDQ04urufA.png" /><figcaption>From this plot we can tell that the magnitude at which the promotion2 affects the sales is small and in just a few stores. In the second plot it is clear that the promotions do not affect the sales as much.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*yGH536BUczXypWuUj-7Q_A.png" /><figcaption>This plot show how opening all weekdays can affect sales in the weekend</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*Ao0KDSzblbsrFEKWwdEReQ.png" /><figcaption>Pot shows the relation between sales and the distance between each store. The further the distance between each store the lower the sales.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*4FZQyXtBYsXZGzaErG-Z9w.png" /><figcaption>A correlation heatmap showing the relation between each feature</figcaption></figure><p>I cleaned the data and then proceeded to pre-processing and then modeling using the Random Forest Regressor Model.</p><p><strong>Feature importance</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/0*9WQma05DSiy35t7o.png" /><figcaption>This plot shows the feature importance</figcaption></figure><p><strong>Conclusion</strong></p><ol><li>When opposed to state holidays, there are more stores open during school holidays.</li><li>The number of customers has a substantial impact on sales.</li><li>Stores that are open during the school vacations produce higher sales than those that are open on other days.</li><li>For all stores, promotions result in a rise in both sales and customers.</li></ol><p><strong>References</strong></p><ol><li><a href="https://www.machinelearningplus.com/time-series/time-series-analysis-python/">https://www.machinelearningplus.com/time-series/time-series-analysis-python/</a></li><li><a href="https://realpython.com/python-logging/">https://realpython.com/python-logging/</a></li><li><a href="https://openclassrooms.com/en/courses/6389626-train-a-supervised-machine-learning-model/6398776-create-new-features-from-existing-features">https://openclassrooms.com/en/courses/6389626-train-a-supervised-machine-learning-model/6398776-create-new-features-from-existing-features</a></li><li><a href="https://www.tableau.com/learn/articles/time-series-analysis">https://www.tableau.com/learn/articles/time-series-analysis</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85ac44be2a94" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Applying machine learning for A/B hypothesis testing SmartAd performance data]]></title>
            <link>https://medium.com/@awuormatilda85/applying-machine-learning-for-a-b-hypothesis-testing-smartad-performance-data-e2b294997387?source=rss-8530cc79f209------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2b294997387</guid>
            <dc:creator><![CDATA[Matilda Awuor]]></dc:creator>
            <pubDate>Sat, 21 May 2022 20:59:29 GMT</pubDate>
            <atom:updated>2022-05-21T21:39:00.298Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Business Objective</strong></p><p>SmartAd places a heavy emphasis on mobile advertising. It provides its clients with interactive ads. SmartAd uses artificial intelligence and human ingenuity to make advertising more efficient. Brand Effect Optimizer (BIO), a short survey given alongside each campaign, is used to analyze creative advertising’s effect on upper funnel key performance indicators (KPIs), including memorability and brand sentiment.</p><p><strong>Objective of the test</strong></p><p>The objective of this test was to determine whether the recent campaign had a substantial impact on brand awareness by developing a hypothesis-testing methodology for BIO system.</p><p><strong>A/B Testing</strong></p><p>A/B testing compares two versions of a product to see which one is more successful. It is based on a hypothesis test and follows a conventional approach to statistical inference. There are two test groups in this study:</p><p><strong><em>Control</em></strong>: users who have been shown a dummy ad</p><p><strong><em>Exposed:</em></strong> users who have been shown a creative (ad) that was designed by SmartAd for the client.</p><p><strong>Data Used</strong></p><p>The BIO data for this project is a “Yes” and “No” response of online users to the following question</p><p><strong><em>Q: Do you know the brand Lux?</em></strong></p><p>O Yes</p><p>O No</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*J3sODQ6OsyGFIBt8.png" /><figcaption>Sample of dataset used</figcaption></figure><p>The original data as was in the csv file had 8077 rows and 9 columns as shown in the following image.</p><p><strong>Data Set features</strong></p><ul><li><strong>auction_id: </strong>the unique id of the online user who has been presented the BIO. In standard terminologies, this is called an impression id. The user may see the BIO questionnaire but choose not to respond. In that case, both the <strong>yes</strong> and <strong>no</strong> columns are zero.</li><li><strong>experiment</strong>: which group the user belongs to — control or exposed.</li><li><strong>date</strong>: the date in YYYY-MM-DD format</li><li><strong>hour</strong>: the hour of the day in HH format.</li><li><strong>device_make</strong>: the name of the type of device the user has e.g. Samsung</li><li><strong>platform_os: </strong>the id of the OS the user has.</li><li><strong>browser</strong>: the name of the browser the user uses to see the BIO questionnaire.</li><li><strong>yes</strong>: 1 if the user chooses the “Yes” radio button for the BIO questionnaire.</li><li><strong>no</strong>: 1 if the user chooses the “No” radio button for the BIO questionnaire.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*nnqJKjG6vAQCrU3h.png" /><figcaption>Understanding of the data used</figcaption></figure><p><strong>Exploratory Data Analysis (EDA)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*Am3HFAE7klyPDJUfERfB-g.png" /><figcaption>Usable values</figcaption></figure><p>The figure above gives a brief description of the usable values in the data. Out of the total 8077, only 1243 (sum of totals) were able to make a choice with 586 comprising of the control group and 657 being the exposed group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/0*M23rH1TsnK8-izUX.png" /><figcaption>Summary of experiment column after eliminating users that did not respond</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*79IPbmXYUZ649wouVv96rA.png" /><figcaption>Control vs Exposed groups</figcaption></figure><p><strong>Hypothesis Testing</strong></p><ol><li>Classical A/B Testing</li></ol><p>In classical A/B testing, traffic is divided between two versions of the same piece of content. In the case of one, the original content and design are found in the so-called “control.” As a new variant of the controlled variation, the other serves as the ‘exposed’ group.</p><p>A p-value is used to validate a hypothesis against observed data.</p><p>P-values are calculated from the deviation between the observed value and a<br>chosen reference value, given the probability distribution of the statistic, with a greater difference between the two values corresponding to a lower p-value.</p><p>The classical A/B test has the drawback of taking a long time to provide results, making it uneconomical to use. Another negative is the cost of data collecting and the time it takes for the trial to complete.</p><p>2. Sequential A/B Testing</p><p>Sequential A/B testing has the advantage of allowing users to complete trials more quickly without raising the risk of incorrect findings.</p><p>Sequential A/B testing allows one to stop trials early if the treatment appears to be the winner, hence addressing the ‘ peeking’ problem</p><p>Once the sample size has been determined, the process of sequential sampling begins in the same way as classical A/B testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*MaWF3CFPd-63bZQMYcxKSQ.png" /><figcaption>Sequential A/B testing for the AdSmart Data</figcaption></figure><p>3. A/B Testing with Machine Learning</p><p>We can model complicated systems that encompass all of the current events, user attributes and more using Machine Learning techniques, unlike statistical inference. Algorithms come in many shapes and sizes, and each has its own advantages and disadvantages.</p><p>Complex systems may be modelled using machine learning techniques that encompass all of the current events, user variables and attributes. There are a variety of algorithms for doing A/B testing, but each has its own advantages and disadvantages.</p><p>We split it into clean data by splitting it by browser and platform_os. In doing so we created separated data sets as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*wXkEoHR9c9k0aYXt.png" /><figcaption>Split by browser</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*xjYK4jb3oIBsNUcW.png" /><figcaption>Split by platform_os</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*rmligd-SDoGSBA4L.png" /><figcaption>Final versions</figcaption></figure><p><strong>Data Training</strong></p><p>This is how we divided up each version of the data: 70% training 20% validation and 10% test set.</p><p><strong>Models for machine learning used</strong></p><ol><li><strong>The LogisticRegression():</strong> function was used to build a linear regression model. We next used all of our data to train the linear regression model. To avoid over-fitting, the model’s parameters were set using a 5-fold cross validation procedure. After that, we ran our model through a series of tests.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*xH-I3O7c2PPG6O_Z1TY1ZA.png" /><figcaption>Browser data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*LJ4OAV1B3-C3nFfAXc9BQw.png" /><figcaption>Platform data</figcaption></figure><p><strong>2. RandomForestClassifier:</strong> Similar to Logical regression, we followed the same processes. Our data was trained using the ReandomforstClassifier model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*_2v8vDfAkUkEQiUvzBLs8g.png" /><figcaption>Browser data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*8wweRscLLXFu95Gh3vDEVA.png" /><figcaption>Platform data</figcaption></figure><p><strong>3. XGboost: </strong>Regression predictive modeling may be done using an efficient implementation of gradient boosting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*dEpWnHwvBq8ebKz4pLkDnA.png" /><figcaption>Browser data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*7fS4khHuiBWyN8JNzO4AcA.png" /><figcaption>Platform data</figcaption></figure><p><strong>Model rankings</strong></p><p>1.Logistic Regression</p><p>2.XGBoost</p><p>3.Random Forest</p><h3>Advantages of using MLFlow and DVC in ML experimentation</h3><ol><li>Real-time tracking — “Real-time” refers to the fact that you can monitor the code’s performance in real time. To monitor the loss and, if necessary, take a break in the midst of your training if it is not converging.</li><li>Simple and open-source — Open-source tools delivers a free solution, community support, and maximum flexibility.</li><li>It has a large community — The fact that MLflow will be developed and utilized for many years to come gives users peace of mind.</li></ol><p><strong>References</strong></p><ul><li><a href="https://splitmetrics.com/blog/sequential-a-b-testing/">Classic and Sequential A/B Testing Comparison: Parameters and Workflow</a></li><li><a href="https://support.crazyegg.com/hc/en-us/articles/360056296034-What-is-A-B-Testing-">What is A/B Testing?</a></li><li><a href="https://www.dynamicyield.com/lesson/introduction-to-ab-testing/">A/B testing guide by CRO experts, with examples</a></li></ul><p><a href="https://towardsdatascience.com/use-mlflow-and-dvc-for-open-source-reproducible-machine-learning-2ab8c0678a94#:~:text=DVC%20excels%20at%20data%20versioning,source%20project%20that%20uses%20them">https://towardsdatascience.com/use-mlflow-and-dvc-for-open-source-reproducible-machine-learning-2ab8c0678a94#:~:text=DVC%20excels%20at%20data%20versioning,source%20project%20that%20uses%20them</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2b294997387" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>