<?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 Yohannes Gutema on Medium]]></title>
        <description><![CDATA[Stories by Yohannes Gutema on Medium]]></description>
        <link>https://medium.com/@yohgut?source=rss-a0fe65873fbf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*yVRQUICQxULETjDq</url>
            <title>Stories by Yohannes Gutema on Medium</title>
            <link>https://medium.com/@yohgut?source=rss-a0fe65873fbf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 19:35:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yohgut/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[Portfolio Project Blog post]]></title>
            <link>https://medium.com/@yohgut/portfolio-project-blog-post-5b7da9baf349?source=rss-a0fe65873fbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b7da9baf349</guid>
            <dc:creator><![CDATA[Yohannes Gutema]]></dc:creator>
            <pubDate>Sun, 04 Dec 2022 10:32:38 GMT</pubDate>
            <atom:updated>2022-12-04T10:32:38.351Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introduction</h4><p>I spend 9 months in Alx where Iwent throw many up’s and downs and many experiences and opportunities that made in impact in my life . During this journey in this school, my experience was one of the most important experience of my life that made me self learner. In this final project I try to develop e-commerce website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZcCi1jNeOFwMeZ7SJMxucA.png" /></figure><p>I choose this idea because nowadays the internet dominate on multiple sectors such as commercial transactions and e-commerce websites offer many services that facilitate buying and selling services and goods in safe and secure method that s why we would like to make our e-commerce website.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b7da9baf349" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Computer Vision for Creative Optimization: KPI Maximization through image analysis]]></title>
            <link>https://medium.com/@yohgut/computer-vision-for-creative-optimization-kpi-maximization-through-image-analysis-f72baf7aca3a?source=rss-a0fe65873fbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/f72baf7aca3a</guid>
            <dc:creator><![CDATA[Yohannes Gutema]]></dc:creator>
            <pubDate>Sat, 05 Nov 2022 18:14:26 GMT</pubDate>
            <atom:updated>2022-11-09T10:20:36.113Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/656/0*vCbR8eZGKJ_-Gl3f.png" /></figure><h3>Project objectives</h3><p>The main objective of this challenge is to apply deep learning-based computer vision techniques for creative optimization in mobile advertising. Computer vision technology has transformed the world by enabling machines to achieve human understanding of images and video. The success of computer vision based on deep learning has led to a number of new applications such as autonomous driving for cars, tumor detection from x-rays, detection of agricultural weeds and the yield prediction from satellite and drone images, visual try-on features for e-commerce clothing and jewelry, and many more. Our client in this challenge is Ad tech Company, an online mobile advertising company. Ad tech Company ran a lot of ads and each ad has its own creation. These creations were made based on the experience of the designers and the needs of the company. Therefore Ad tech Company needs a deep learning based computer vision algorithm that segments objects from creative assets and relates them to KPI parameters of the corresponding campaigns.</p><h4><strong>Overview Of Dynamic Creative Optimization(</strong>DCO)</h4><p>DCO stands for dynamic creative optimization. In advertising, DCO technology rapidly builds multiple iterations of an ad using the same base creative, while tailoring parts of the ad based on audiences, context, and past performance. This helps the ad resonate with consumers.</p><p>In today’s world, consumers can see thousands of ads a day. Therefore, it’s more important than ever for brands to engage customers with messaging and creative that resonates. DCO helps advertisers and agencies deliver more relevant, informative, and impactful ad experiences. In addition, DCO helps advertisers improve scale and efficiency. Rather than creating multiple versions of the same ad for different locales and audiences, DCO does it for them.</p><h4>Creating a DCO campaign</h4><p>Each day, consumers engage with brands on numerous channels. Each touchpoint is an opportunity for brands to deepen their relationship with customers. A successful DCO strategy will seek to do exactly that by meeting customers where they are with relevant content.</p><p>When creating a DCO campaign, think about ways to connect with your audiences, with the right message, in the right context, at the right phase of their journey.Here’s how to get started.</p><ul><li>Define your scope</li><li>Align with your partners</li><li>Understand your audience</li><li>Build your template</li><li>Examine your performance</li></ul><p>Though historically advertisers have used DCO primarily as a direct response tool — for instance, to remarket to retail audiences with a product they’ve previously viewed — savvy advertisers are increasingly using DCO to employ relevant messaging across the marketing funnel. Branding and awareness tactics can benefit from insight-driven creative — for instance, by using shopping or streaming signals to provide different imagery or product features. A sophisticated DCO strategy considers how creative can adapt dynamically at every touchpoint with audiences.</p><h4>Deep Learning-Based Image Segmentation</h4><p>Image segmentation is a method of dividing a digital image into subgroups called image segments, reducing the complexity of the image and enabling further processing or analysis of each image segment. Technically, segmentation is the assignment of labels to pixels to identify objects, people, or other important elements in the image.</p><p>Deep-learning algorithms enable precise image recognition based on high-dimensional hierarchical image features. The recent advances in deep-learning technologies based on neural networks have led to the emergence of high-performance algorithms for interpreting images, such as object detection, semantic segmentation, instance segmentation, and image generation. Deep-learning algorithms for interpreting images are grouped into two categories. Fully convolutional approaches employ an encoder–decoder architecture, such as SegNet, U-Net, and SharpMask. In contrast,<br>region-based approaches employ feature extraction by a stack of convolutional neural networks (CNNs), such as Mask-RCNN, PSP Net, and DeepLab. In general, the region-based approaches outperform the fully convolutional approaches for most image segmentation tasks when the networks are trained on a sufficiently large number of annotated datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7amfYOSoQXBf_NgtvLW_vQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SaCjccr89XogW1czZcuRRw.png" /><figcaption>segmented gray scale image</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*676_KlmkYqs4PgjK5fFl0g.png" /><figcaption>segmented Image</figcaption></figure><h4><strong>Deep Learning for Feature Extraction</strong></h4><p>Feature extraction refers to the process of transforming raw data into numerical features that can be processed while preserving the information in the original data set. It yields better results than applying machine learning directly to the raw data. For a human, it’s relatively easy to understand what’s in an image ,it’s simple to find an object, like a car or a face; to classify a structure as damaged or undamaged; or to visually identify different land cover types.<em> </em>In simpler terms, for an image, each pixel is a piece of data and what image processing does is extract only useful information from the image, hence reducing the amount of data but retaining the pixels that describe the image characteristics.</p><h4>Color Extraction</h4><p>Using OpenCV, we can convert the color space of an image to one of several options offered like HSV, LAB, Grayscale, YCrCb, CMYK etc. A simple breakdown of each color space</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c18a8bafec5108f3acde56f2b7c987b/href">https://medium.com/media/7c18a8bafec5108f3acde56f2b7c987b/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/0*npJyxMlxcWshZjQq.png" /><figcaption>RGB vs LAB color space</figcaption></figure><p><a href="https://medium.com/mlearning-ai/color-shape-and-texture-feature-extraction-using-opencv-cb1feb2dbd73">Color, Shape and Texture: Feature Extraction using OpenCV</a></p><h4>Texture Extraction</h4><p>Extracting text from images is a very popular task in the operations units of the business (extracting information from invoices and receipts) as well as in other areas.</p><p>OCR (Optical Character Recognition) is an electronic computer-based approach to convert images of text into machine-encoded text, which can then be extracted and used in text format.</p><p><a href="https://pypi.org/project/pytesseract/">pytesseract</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*UzeZGqcl8dTlI-gHBGDbgQ.png" /><figcaption>image</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*_t9Ql7he_soYsxhNGImJCg.png" /></figure><h4>Object Detection</h4><p>Object extraction process is a closely related issue with image segmentation process. we use Yolo v7</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5cb18a42b7366abd36eff856321dc6ed/href">https://medium.com/media/5cb18a42b7366abd36eff856321dc6ed/href</a></iframe><p><a href="https://www.v7labs.com/blog/yolo-object-detection">YOLO Algorithm for Object Detection Explained [+Examples]</a></p><h4>Machine learning models</h4><p>Once our data are prepared and saved in csv files, it’s time to develop the model. Model preparation is at the core of the machine learning life cycle. And we Used Random forest for prediction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*ltAa9DK1GSyrxSBrpSVDsw.png" /></figure><h4>Results</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*Oygsgejuv4GAsG3y27hZbw.png" /><figcaption>estimators</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*IlyJYwc0MLd-BYG-_8kHxQ.png" /></figure><h4>Lesson Learned</h4><ul><li>We learned how to work with CV tools like OpenCV, tesseract, etc.</li><li>Dynamic Creative Optimization</li><li>Image segmentation</li><li>Feature extraction from images and videos</li><li>Using object detection for creative optimization</li></ul><h4>Conclusion</h4><p>Though it may look like deep learning techniques for feature extraction and Image segmentation are more robust to scale, occlusion, deformation, rotation, etc and have pushed the limits of what was possible using traditional computer vision techniques doesn’t mean the computer vision techniques are obsolete.</p><h4>Future work</h4><ul><li>Extract more feature</li><li>Build a model with different deep-learning techniques using state of the art</li><li>Build Dashboard</li></ul><h4>Reference</h4><p>1. <a href="https://doc.arcgis.com/en/imagery/workflows/resources/using-deep-learning-for-feature-extraction.htm">https://doc.arcgis.com/en/imagery/workflows/resources/using-deep-learning-for-feature-extraction.htm</a></p><p><a href="https://datagen.tech/guides/image-annotation/image-segmentation/">2. https://datagen.tech/guides/image-annotation/image-segmentation/</a><br>3. <a href="https://www.ibm.com/topics/computer-vision">https://www.ibm.com/topics/computer-vision</a><br>4. <a href="https://doc.arcgis.com/en/imagery/workflows/resources/using-deep-learning-for-feature-extraction.htm">https://doc.arcgis.com/en/imagery/workflows/resources/using-deep-learning-for-feature-extraction.htm</a><br>5. <a href="https://www.analyticsvidhya.com/blog/2019/04/introduction-image-segmentation-techn">https://www.analyticsvidhya.com/blog/2019/04/introduction-image-segmentation-techn</a>iques-python/</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f72baf7aca3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Refund by Location Smart Contract]]></title>
            <link>https://medium.com/@yohgut/refund-by-location-smart-contract-1418171befed?source=rss-a0fe65873fbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/1418171befed</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum-blockchain]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <dc:creator><![CDATA[Yohannes Gutema]]></dc:creator>
            <pubDate>Fri, 28 Oct 2022 22:02:15 GMT</pubDate>
            <atom:updated>2022-11-01T23:02:19.866Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*CS6hbK7s8cs_FIUN.jpg" /></figure><p>Building Refund Mobile and Web Dapps by Location Smart Contract</p><h3><strong>Project Description</strong></h3><p>The refund by location smart contract is aimed to be used when an employer agrees to pay an employee for being present in a certain geographic area for a certain duration. The employee’s phone sends its GPS location to a smart contract at a certain interval. Based on the pre-agreed contract codified in an Ethereum smart contract, a cryptocurrency payment is executed when all the agreed conditions are met. 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.Before starting our implementation let us see the concepts related to our projects.</p><h3>Overview of the Ethereum blockchain and its components</h3><p>Ethereum is a global decentralized transaction-based state machine based on blockchain technology. It is best known for its native cryptocurrency, ether, or just ETH. Anyone can use it to create any secure digital technology. It has a token designed for use in the blockchain network, but it can also be used by participants to pay for blockchain work. Ethereum was created with the goal of being scalable, programmable, secure, and decentralized. It is used to build decentralized applications, a.k.a. DAPPs. These applications exist through small programs that live on the Blockchain, called smart contracts. It is the blockchain of choice for developers and businesses developing technology based on it to change the way many industries operate and how we live our lives.<br>Ethereum can power a number of applications offering a wide range of functions such as:</p><ul><li>Currency — to sell and buy goods and services</li><li>Smart contracts — a permission-less app that automatically executes when the contract’s conditions have been met</li><li>dApps (Decentralized apps) — allow users to play games, to send money, to follow social media and more,</li><li>NFT’s (Non-fungible tokens) — allow artists or others to sell art or other items directly to buyers using smart contracts.</li><li>DeFi (Decentralized Finance) — helps to avoid centralized (government) control over the movement of money or other assets.</li></ul><p><strong>Some of the important Ethereum components are described below:-</strong></p><ul><li><strong>Ether:- </strong>is the Ethereum blockchain’s native coin. ETH has several uses in the Ethereum ecosystem, such as fee payment for activities on the Ethereum blockchain.Sending ETH from one person to another, for instance, requires the sender to spend an amount of ETH on sending the transaction through on the blockchain — essentially a payment to those putting resources toward running the blockchain.</li><li><strong>Gas, fees and transactions:-</strong>Is the Ethereum blockchain free? Not really. Gas is what makes the Ethereum world go round. In short, gas is the term used to describe the cost in ETH that it takes to send any given transaction on the Ethereum blockchain. On the Ethereum network, gas is a unit of measurement for the computing power used to execute a smart contract or a transaction.</li><li><strong>Nodes:-</strong>Blockchain nodes, in general, serve as interactive information storage points on any given blockchain. Blockchain technology depends on numerous participants across the globe, keeping each other accountable for transaction and network consensus.</li><li><strong>Accounts</strong> :- on the Ethereum blockchain serve many purposes and come in two forms. The first is called an externally-owned account (EOA). This type of account is a point on the Ethereum blockchain that anyone can create for free to store, receive and send ETH or tokens built on the Ethereum blockchain, such as ERC-20 tokens. Sending or receiving assets via EOAs requires action from an outside source.The second type of account on the Ethereum blockchain is known as a contract account. Contract accounts are coded setups on the Ethereum blockchain that complete actions if certain conditions are met.</li><li><strong>Ethereum Virtual Machine (EVM):-</strong>is a computation engine that functions as a decentralized computer with millions of applications that can be executed. The EVM is the core framework of the Ethereum blockchain</li><li><strong>Smart contracts:</strong>- Smart contracts are distinct blockchain addresses on compatible networks that are accompanied by specific codes. Developers construct these coded addresses to complete a function of the developer’s choosing, pending an external transaction triggers the smart contract. Smart contracts are processed on the EVM in the case of the Ethereum blockchain</li><li><strong>Ethereum mining, blocks and consensus:</strong>-Ethereum is a blockchain running according to a proof-of-work (PoW) consensus algorithm. Numerous pieces of computer hardware dedicated to mining Ethereum run continuously all over the world, helping to run and secure the Ethereum blockchain. Each computer hardware setup is called a miner.</li></ul><h4><strong>Ethereum Networks</strong></h4><p>Ethereum networks are environments that can be accessed for development, testing, or production use cases. There are a number of public testnets used by protocol developers or smart contract developers to test both protocol upgrades as well as potential smart contracts in a production-like environment before deployment to Mainnet.</p><p><strong>Common Ethereum testnet:</strong></p><ul><li><strong>Rinkebey </strong>— is a Proof-of-Authority testnet for Ethereum, originally started by the Geth team. To acquire ETH on Rinkeby, one can request it from a faucet. It is a proof-of-authority testnet for those running old versions of the Geth client, and is deprecated.</li><li><strong>Ropsten </strong>— is an Ethereum test network and is a Proof-of-Work testnet for Ethereum. To acquire ETH on Ropsten, one can mine on the network.</li><li><strong>Sepolia </strong>— is a proof-of-work testnet which is the best like-for-like representation of Ethereum.</li><li><strong>Goerli </strong>— is a proof-of-authority testnet that works across clients and is considered as an ideal testnet for application developers. Goerli will be the final testnet merged to proof-of-stake before Ethereum Mainnet is merged.</li><li><strong>Kovan </strong>— is a Proof-of-Authority testnet for Ethereum, originally started by the Parity team. It is a very old proof-of-authority testnet for those still running OpenEthereum clients. By now it is deprecated and will no longer receive protocol upgrades.</li></ul><p><strong>Ethereum smart contract code execution</strong></p><p>Smart Contracts are the business logic or a protocol according to which all the transactions on a Blockchain happen. The smart contract’s general objective is to satisfy common contractual conditions like creating its own token on ethereum. We need to develop smart contracts according to which all the calculations on our token would happen.<br>It is a stand-alone script written in Solidity and compiled into JSON and deployed to a particular address on the blockchain. Solidity compiler converts code into EVM bytecode which is sent to the Ethereum network as a deployment transaction. Here’s a step-by-step guide to creating and deploying Ethereum Smart Contracts with Solidity</p><ul><li>Create a wallet at meta-mask</li><li>Select any one test network</li><li>Add some dummy Ethers to your wallet</li><li>Use editor remix to write the smart contract in Solidity</li><li>Create a .sol extension file</li><li>A sample smart contract code to create ERC20 tokens</li><li>Deploy your contract</li></ul><p><strong>Smart Contract Security</strong><br>Security is one of the most important considerations when writing smart contracts. In the field of smart contract programming, mistakes are costly and easily exploited. As with other programs, a smart contract will execute exactly what is written, which is not always what the programmer intended. Furthermore, all smart contracts are public, and any user<br>can interact with them simply by creating a transaction. Any vulnerability can be exploited, and losses are almost always impossible to recover. It is therefore critical to follow best practices and use well-tested design patterns.This includes make the smart contract code simpler by removing complexity, reusing the code rather than reinvent the wheel, making your code clear and easy to comprehend, testing everything to allow<br>execution of the code to continue, and by getting familiarized with the security risks and antipatterns (i.e., reentrancy, vulnerability, preventive techniques, and the like).</p><h3>Tools And Technology Used in Project</h3><h4>Flutter for mobile Application</h4><p>FlutterFlow is a low-code builder for developing native mobile applications. You can use our simple drag and drop interface to build your app 10x faster than traditional development.</p><p><a href="https://docs.flutter.dev/">Flutter documentation</a></p><h4><strong>React JS for Web-Application</strong></h4><p>Currently, ReactJS is one of the most popular JavaScript front-end libraries which has a strong foundation and a large community. ReactJS is to develop User Interfaces (UI) that improves the speed of the apps. It uses virtual DOM (JavaScript object), which improves the performance of the app. The JavaScript virtual DOM is faster than the regular DOM. We can use ReactJS on the client and server-side as well as with other frameworks. It uses component and data patterns that improve readability and helps to maintain larger apps.</p><h4>MetaMask</h4><p>MetaMask is a software cryptocurrency wallet used to interact with the Ethereum blockchain. It allows users to access their Ethereum wallet through a browser extension or mobile app, which can then be used to interact with decentralized applications.</p><p><a href="https://metamask.io/">The Ultimate Crypto Wallet for DeFi, Web3 Apps, and NFTs | MetaMask</a></p><h4>Solidity</h4><p>Solidity is an object-oriented programming language for implementing smart contracts on various blockchain platforms, most notably, Ethereum. It was developed by Christian Reitwiessner, Alex Beregszaszi, and several former Ethereum core contributors. Programs in Solidity run on Ethereum Virtual Machine.</p><p><a href="https://docs.soliditylang.org/en/v0.8.17/">Solidity - Solidity 0.8.17 documentation</a></p><h4><strong>Result and Discussions</strong></h4><p>Under this subsection we try to discuss the implementation parts of the project with the materials and tools used</p><p><strong>Smart contract writing</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c4d5d9d76c440ca413ce109a005f519b/href">https://medium.com/media/c4d5d9d76c440ca413ce109a005f519b/href</a></iframe><p>The solution is basically constitute three components; the Employer web dApp, the smart contract, and the Employee mobile dApp. All necessary information will be sent to the smart contract through the Employer web dApp (backend). The list of employees’ names and public addresses, the geographic area, and the payment information are all included. The backend smart contract will receive a package containing all of this information. On the other hand, after tracking is enabled utilizing the device’s gps location service, the mobile dApp installed on the employee’s smart phone will communicate the employee’s current location together with their external address at random intervals. After that, the predefined, codified agreement between the two parties will be taken into account when the smart contract handles the logic processing. It will review the terms and approve compliance with either making the full payment, a partial payment, or making no payment at all.</p><h4>Challenges</h4><p>I faced many technical challenge during this challenges such as</p><ul><li>New to the development environments</li><li>installing those tools was time consuming and challenging</li><li>Even understanding each and every problem raised on the challenges was difficult</li></ul><h4><strong>Lesson Learned</strong></h4><p>From the challenges I learned the following things:-</p><ul><li>writing smart contract using solidarity</li><li>Testing and debugging smart contract</li><li>Interacting with the Ethereum blockchain using meta-mask</li><li>some how using flutter and React native to develop mobile app.</li></ul><h4>Future plan</h4><ul><li>I plan to deeply work on web3 special mobile app</li><li>implement fund transfer</li><li>working on the whole process of smart contract</li></ul><p>==========================//===================</p><p><strong>Reference</strong><br>● https://hedera.com/learning/smart-contracts/smart-contract-security<br>● https://corporatefinanceinstitute.com/resources/knowledge/deals/smart-contract/<br>● https://www.geeksforgeeks.org/what-is-ethereum-virtual-machine-and-how-it-works/</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1418171befed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Logistic-optimization-Causal-Inference]]></title>
            <link>https://medium.com/@yohgut/logistic-optimization-causal-inference-36e1414cd5d9?source=rss-a0fe65873fbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/36e1414cd5d9</guid>
            <dc:creator><![CDATA[Yohannes Gutema]]></dc:creator>
            <pubDate>Sun, 23 Oct 2022 18:26:01 GMT</pubDate>
            <atom:updated>2022-11-12T17:08:36.472Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/467/0*Y6dt02kuAoUOG9s9" /></figure><h4><strong>Overview of Causal Inference</strong></h4><p>Everyone else on this planet is able to understand cause-and-effect relationships, an ability that is still largely lacking in machines. And before we can think about creating a system that can generally understand cause-and-effect, we should look at cause-and-effect from a statistics perspective: causal calculus and causal inference. Statistics is where causality was born from, and in order to create a high-level causal system, we must return to the fundamentals. <strong>Causal Inference </strong>is the process where <em>causes </em>are <em>inferred </em>from data. Any kind of data, as long as they have enough of it, even observational data. It sounds pretty simple, but it can get complicated. We, as humans, do this everyday, and we navigate the world with the knowledge we learn from causal inference. And not only do we use causal inference to navigate the world, we use causal inference to solve problems.</p><p><strong>Objective Of Project</strong></p><p>Our client is Gokada. Gokada is the largest last mile delivery service in Nigeria. Its works are partnered with motorbike owners and drivers to deliver parcels across Lagos, Nigeria. The main objectives of the project is that Gokada wants to work on its data to help it understand the primary causes of unfulfilled requests as well as come up with solutions that recommend drivers locations that increase the fraction of complete orders. Since drivers are paid based on the number of requests they accept, your solution will help Gokada business grow both in terms of client satisfaction and increased business.</p><p><strong>Data understanding</strong></p><p>There are two datasets available for this project.The first one contains information about the completed orders and the second tables shows delivery requests by clients (completed and unfulfilled).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/0*K-8RGL9f4CaPxDkZ" /><figcaption>Table 1 completed orders</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/0*sDnMlwrTMKcJjgvp" /><figcaption>Table2 delivery requests</figcaption></figure><p><strong>Techniques used to perform causal inference</strong></p><p>There are three ways of establishing a causal relationship: randomized controlled trials (RCT, aka. A/B testing), quasi-experimental designs, and observational designs.</p><p><strong>Randomized Controlled Trials</strong></p><p>As the common statement goes, A/B testing is the gold standard of causal inference. This is so because we have complete information about the Data Generation Process (DGP). In the Online Experimentation settings, Data Scientists have strict control over the treatment assignment process that facilitates causal attribution. In addition, the ability to collect millions of users at ease renders the favorable statistical properties of our estimators.</p><p><strong>Quasi-experimental designs</strong></p><p>The word — “quasi” — means that it only contains partial information but not full control over the DGP. The incomplete information makes the quasi-experiment family less perfect than the RCTs from the perspective of causal inferential power.</p><p><strong>Observational Designs</strong></p><p>The observational methods are considered the last resort if the other two approaches are unavailable. Data Scientists have no prior information about the DGP. They rely on statistical assumptions to ensure the designs are appropriate for the business question at hand.</p><h3>Exploratory Data Analysis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*LlcJHOVdRjrgMIbkGAvXJQ.png" /><figcaption>Duration</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*TJwoQVubhRCvN1pIBv8Tyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*qc1NWVVzqy5hmh_YSfGWHg.png" /><figcaption>distribution of data</figcaption></figure><h3>Causal Graph</h3><p>A causal graphical model is <strong>a way to represent how causality works in terms of what causes what</strong>. Each node is a random variable. We use arrows, or edges, to show if a variable causes another. let us se the below graph</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*EwzFBpShrfnmmp-kHzSneQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*Jb_TgnWntguEF1lbk28DdA.png" /><figcaption>first graph</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*C2V6DtihYHOknyOQJ56TYg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*eSN78rZl7JhzCr-r3wwq3A.png" /></figure><h3>Modeling</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*f8qOtcpINBliFOLBtoPUqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*BPl_8xn0Xenrii4xpi2uSw.png" /></figure><h3><strong>Logistic Optimization</strong></h3><p><strong>Optimization</strong> is one of the core components of machine learning. The essence of most machine learning algorithms is to build an optimization model and learn the parameters of the objective function from the given data. It is an important part of machine learning and has attracted the attention of many researchers. With the exponential growth of data amount and the increase of model complexity, optimization methods in machine learning face more and more challenges.</p><p><strong>Time and Space </strong>: Suppose that the day starts at <strong><em>time 0</em></strong> and ends after <strong><em>T hours</em></strong>. For specific times <strong><em>T</em></strong> there will be a broadcast for trip <strong><em>t</em></strong> at T where drives are located on location <strong><em>Ld</em></strong>. There are a set of locations which are the sites of customers and technician depots. Let represent the travel time in hours from location to location.</p><p><strong>Trips</strong>: There are T trips to be completed. Each trip t = { 1, 2,...., T} has a priority level 𝝅t (if priority is applied if not priority level will be 1) and requires pt minutes to be completed.</p><ul><li>Each trip t should be fully completed by the time ct.</li><li>Let the distance between each trip’s origin and destination be tod</li><li>Let the location of each trip be given by Lt = {1, 2,..., N}.</li></ul><p><strong>Broadcasted Orders : </strong>There are b broadcasted orders b = {1, 2,....,B} for every trip where B is the total number of available nearby drivers</p><p>Company Problem:</p><ul><li>he destination of the trip defines where the driver will travel, from the trip origin to the trip destination,</li><li>To increase the number of fulfilled orders, plenty of drivers have to be placed in areas where most trips originated.</li><li>So for every driver’s location Ld, Ld has to be near the next predicted trip origin,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*CkewdbmBevTd63pMDsZ4ng.png" /></figure><h3>Discussion</h3><p>The first task I did was to understand task challenges from different perspectives, such as causal inference, causal graphs, and different new related terms. The weekly challenges insights are more focused on exploratory data analysis, with no null values and clear data. The data was<br>large, and two tables were given and joined together using the trip ID and order ID. The time of a trip is calculated from the start of a trip and the end of a trip with the function. The distance of the trip is calculated from the trip’s latitude and longitude from both the start and end of the trip. The speed of the car is calculated from the distance and time. The other features, such as holidays, rain, speed drive, and shortest path, are derived from the given data using different API libraries.</p><p>Lesson Learned</p><ul><li>Creating causal graphs.</li><li>Infer the causal graph from observational data and then validate the graph</li><li>Derive more attributes with an advanced API library.</li><li>Use the causal graph for the direct flow of the steps of the feature.</li><li>Build machine learning with causal inference.</li><li>Logistic optimization</li></ul><p><strong>Future Work</strong></p><ul><li>Work with more advanced derived attributes and use feature engineering to clearly design causal graphs.</li><li>Add more machine learning techniques with hyperparameters and explain them.</li><li>Use the optimization for the project to get good results.</li><li>Explain the details steps of the causal inference in the project.</li></ul><p><strong>Reference</strong></p><ul><li><a href="https://arxiv.org/pdf/2002.02770.pdf">https://arxiv.org/pdf/2002.02770.pdf</a></li><li><a href="https://arxiv.org/pdf/2102.11107.pdf">https://arxiv.org/pdf/2102.11107.pdf</a></li><li><a href="https://towardsdatascience.com/the-ultimate-literature-review-for-causal-inference-1b310">https://towardsdatascience.com/the-ultimate-literature-review-for-causal-inference-1b310</a>9a33162</li><li><a href="https://www.microsoft.com/en-us/research/group/causal-inference/">https://www.microsoft.com/en-us/research/group/causal-inference/</a></li><li><a href="https://mattdelventhal.com/post/technician_route/">https://mattdelventhal.com/post/technician_route/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36e1414cd5d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crypto Trading Engineering: Scalable Backtesting Infrastructure]]></title>
            <link>https://medium.com/@yohgut/crypto-trading-engineering-scalable-backtesting-infrastructure-b64087ab51b9?source=rss-a0fe65873fbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/b64087ab51b9</guid>
            <dc:creator><![CDATA[Yohannes Gutema]]></dc:creator>
            <pubDate>Sat, 15 Oct 2022 04:53:22 GMT</pubDate>
            <atom:updated>2022-10-18T18:42:09.833Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NLInH-LVqU0Z0wuB" /><figcaption>Backtesting infrastructure</figcaption></figure><h3><strong>Introduction</strong></h3><p>Mela is our client and wants to make it simple for everyone to enter the world of cryptocurrencies. It also wants to give investors a reliable source of investment while lowering the risk associated with trading cryptocurrencies. Although the past performance of any financial market is never a reliable indicator of the future, it is important to run backtests that simulate current and past particular situations as well as their trend over time. Having a clear understanding of the financial system, stock market trading, and recognizing the complex data engineering systems involved in the crypto and general stock market trading systems are essential.</p><h3><strong>Objectives of the Project</strong></h3><p>The main objective of this project is to design and build a reliable, large-scale ,robust data-pipeline that can run various backtests and store various useful artifacts in a robust data warehouse system for Mela who wants to enter the world of cryptocurrencies to make simple trade for everyone. This helps to give investors a reliable source of investment while lowering the risk associated with trading cryptocurrencies. Since the past performance of any financial market is never a reliable indicator of the future, it is important to run backtests that simulate current and past particular situations as well as their trend over time. Having a clear<br>understanding of the financial system, stock market trading, and recognizing the complex data engineering systems involved in the crypto and general stock market trading systems are essential.</p><h3>Data</h3><p>There are a number of data points that yahoo finance and binance provide, but for the purpose of testing the backend development, we started off with the candlestick data. A brief description of what a K-line or candlestick data is can be found <a href="https://www.investopedia.com/terms/c/candlestick.asp">here</a>.</p><h3><strong>Exploratory Data Analysis(EDA)</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*kHEtgM58QkYwiTgpyemdTQ.png" /><figcaption>Data Analysis</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*5z002G4m7tA26GBxAvR-8Q.png" /><figcaption><em>Plotting dataset with Matplotlib</em></figcaption></figure><h3><strong>Approach</strong></h3><p>Our pipeline presented below illustrates the typical method of data engineering: speech-to-text data collecting using Kafka, Airflow AWS. The system includes several phases and operations, including the frontend, the Flask backend, the kafka cluster, the airflow component, and the spark component. Why do we select the approach? The major reason why we selected this way of end to end data engineering pipeline is because it<br>is flexible and robust. And most of all easy for backtesting machine learning engines to subscribe to a topic and retrieve a message, which is exactly what we are trying to achieve in this data engineering pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fHtytaJLjLcdzhqg.png" /><figcaption>flow diagram</figcaption></figure><h3>Installing this application</h3><ul><li>First clone this repository to your local machine using the command below</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*G978Lek2SLGK62oBvBPTmw.png" /></figure><h3><strong>Technologies used</strong></h3><p><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<br>event is triggered which the Kafka system is based on.</p><p><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.</p><p><strong>AWS :</strong>- Amazon Relational Database Service is a distributed relational database service by Amazon Web Services. It is a web service running “in the cloud” designed to simplify the setup, operation, and scaling of a relational database for use in applications.</p><p><strong>Front-end </strong>: — created with Reactjs, is how we interact with users to upload an audio file or validate audio file submissions.</p><p><strong>Back-end (microservice API)</strong>:Flask will be used to build the back-end (microservice API), which will make it easier to facilitate communication between the front-end and Kafka for a seamless connection.</p><p><strong>Mlflow</strong>— used to track the backtests and store generated metrics on the remote database.</p><p><strong>Trading Bot </strong>— an algorithmic trading robot is a computer code that can generate and execute buy and sell signals in financial markets. The main components of such a robot include entry rules that signal when to buy or sell, exit rules indicating when to close the current position, and position sizing rules defining the quantities to buy or sell.</p><h3><strong>Results and Discussions</strong></h3><h4><strong>Back-testing</strong></h4><p>Back-testing is the general method for seeing how well a strategy or model would have done ex-post. Back-testing assesses the viability of a trading strategy by discovering how it would play out using historical data.</p><p>For back-testing different experiment was done using python with different libraries. For this Relative Strength Index(RSI) indicators was used. Back testing metrics also optimized by using parameterize tuning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*S9jowkoHQVoLeQHD1IVgGA.png" /><figcaption>back-testing demo</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ffue5f3NdhivWD781LclhQ.png" /></figure><p><strong>Database-Schema</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*I_QcTHRT2TQo2tafUuQ_oQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ICYHKWAC7rPFzn9A" /><figcaption>Class diagram</figcaption></figure><h4>Ml-flow Track Back-test Run</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gQrwokSUVNLpUjL8" /></figure><p><strong>Conclusion</strong></p><p>This week we concentrated on the data engineering and machine learning tracks for creating Scalable back-testing infrastructure for Mela. We implemented the ml flow to track the model and built the LSTM model for the trade price prediction. Furthermore, we built the data pipeline, the machine learning flow, and the machine learning model using a variety of tools, including Kafka, Airflow, and Docker Compose, with back-testing to improve the effectiveness of the tests.</p><p><strong>Lesson Learned</strong></p><p>This week’s challenge taught me a variety of technical skills, including data engineering and machine learning principles and tools.</p><ul><li>Backtesting was a new concept to me that I discovered while working on this project.</li><li>I learned how to use a docker-compose file to connect backtesting with data engineering tools such as Kafka and airflow.</li><li>I learned how to work on database normalization on AWS remote cloud storage to store data.</li></ul><p><strong>Future plans</strong></p><ul><li>I will implement the integration of frameworks to test the parameters with different back-testing frameworks such as Freqtrade, and Vectorbt</li><li>Not only that, but I plan to work with different deep learning models used for time series with back-testing to increase the efficiency of testing.</li></ul><p><strong>Reference</strong></p><ul><li><a href="https://www.backtrader.com/docu/quickstart/quickstart/">https://www.backtrader.com/docu/quickstart/quickstart/</a></li><li><a href="https://www.backtrader.com/docu/">https://www.backtrader.com/docu/</a></li><li><a href="https://kafka.apache.org/documentation/">https://kafka.apache.org/documentation/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b64087ab51b9" 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/@yohgut/speech-to-text-data-collection-with-kafka-airflow-and-spark-474f9e1c9fba?source=rss-a0fe65873fbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/474f9e1c9fba</guid>
            <dc:creator><![CDATA[Yohannes Gutema]]></dc:creator>
            <pubDate>Sat, 08 Oct 2022 11:26:00 GMT</pubDate>
            <atom:updated>2025-10-06T13:01:16.750Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>The goal of this project is to develop a <strong>data engineering pipeline</strong> that enables millions of Amharic speakers to read digital texts both in-app and on the web, and to record audio versions of those texts. The purpose is to collect a rich <strong>speech-to-text dataset</strong> for training <strong>machine learning models</strong>.</p><p>For analysis and testing, we utilized an <strong>Amharic news text classification dataset</strong>. We also developed a <strong>web-based application</strong> that processes text and audio files by sending them to and receiving them from a <strong>data lake</strong>. These files are then <strong>transformed in a distributed manner</strong> and <strong>loaded into a data warehouse</strong> in a suitable format for training a <strong>speech-to-text mode</strong></p><p><strong>Business objectives</strong><br>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. Using the Apache frameworks; Kafka, Airflow, and Spark for generating, preprocessing, and storing the audio speech data for the respective text. With the help of this system we can collect a larger number of text files and ask volunteers to record audios of the text files. The audio data will be used to develop an accurate machine learning speech recognition model for the language.<br><strong>Approach Used</strong><br>Our pipeline presented below illustrated the typical method of data engineering: speech-to-text data collecting using Kafka, Airflow, and Spark. The system includes several phases and operations, including the frontend, the Flask backend, the kafka cluster, the airflow component, and the spark component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/0*OOJGr9edZVwXw-NP.png" /><figcaption>Architectural design of the system</figcaption></figure><p><strong>How does it work?</strong><br>The overall workflow of the system architecture represented on the above diagram is started on the frontend users. Users can send requests for text transcription and an audio through the front end, which they can interact with. The Javascript function is used to send the request to the API. The API responds to a consumer’s request for untranscribed text in the Kafka Cluster, retrieves the overall data upon receipt of the user’s request, and sends individual data items to the front-end until the entire dataset has been fetched. Then, the audio data with untranscribed text is saved in an S3 bucket, and the references are sent to Kafka as topics.</p><p>The data streaming between the API and Airflow is managed by the Kafka cluster. It would gather information from the front end and send it to the S3 bucket storage to be processed later. The Airflow component queues the audio data that has been transcribed and sends it to storage (S3 bucket). Untranscribed text is read by the Airflow flow, stored in an S3 bucket, and processed text audio is sent to a Kafka cluster. The audio data is preprocessed using the spark component. The transcription of the audio is cross-checked against it. The data is saved to the S3 bucket if the audio and transcription are accurate.</p><p><strong>Why do we select the approach?</strong></p><p>The major reason why we selected this way of end to end data engineering pipeline is because it is flexible and robust. And most of all easy for speech-to-text machine learning engines to subscribe to a topic and retrieve a message, which is exactly what we are trying to achieve in this data engineering pipeline.</p><p><strong>Technologies used to build the data capture pipeline</strong><br><strong>Airflow — </strong>Apache Airflow is an open-source platform for authoring, scheduling and monitoring data and computing workflows<strong>1. </strong>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</p><p><strong>Kafka :</strong>- Apache Kafka is a distributed data store optimized for ingesting and processing streaming data in real-time<strong>2</strong>. Streaming data is data that is continuously generated by thousands of data sources, which typically send the data records in simultaneously. Because Kafka Streams is a very recent and quick, lightweight stream processing solution that performs best if all of your data intake is coming through Apache Kafka, we are very interested in applying it to our system.</p><p><strong>Spark :- </strong>Spark is a general-purpose distributed data processing engine that is suitable for use in a wide range of circumstances<strong>3</strong>. 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</p><p><strong>S3 Buckets: </strong>Amazon Simple Storage Service (Amazon S3) is a scalable, high-speed, web-based cloud storage service<strong>4</strong>. The service is designed for online backup and archiving of data and applications on Amazon Web Services (AWS). A bucket is a container for objects stored in Amazon S3. You can store any number of objects in a bucket and can have up to 100 buckets in your account.</p><p><strong>Front-end :</strong>— created with Reactjs, is how we interact with users to upload an audio file or validate audio file submissions.</p><p><strong>Back-end </strong>(micro-service API):Flask will be used to build the back-end (micro-service API), which will make it easier to facilitate communication between the front-end and Kafka for a seamless connection.</p><h3>Data Exploratory Analysis</h3><p>The <a href="https://github.com/IsraelAbebe/An-Amharic-News-Text-classification-Dataset/tree/main/data">Amharic news text classification dataset</a> is used in this work for analyzing the pipeline workflow. The dataset is primarily used as a source of transcription text, which will then be displayed to frontend application users in order for them to obtain the audio recorded equivalence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*nmzDox-OlvZYeLDtoORfDg.png" /></figure><p>The dataset contains various news data collected from various sources, with the goal of classifying Amharic news using machine learning classifiers. The data was obtained from a GitHub user named <a href="https://github.com/IsraelAbebe/An-Amharic-News-Text-classification-Dataset/tree/main/data">Israel Abebe</a> and consists of six columns: headline, category, data, views, article, and link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*uO_3Faj3WJEHoR_liCipew.png" /></figure><p>Since our goal is to extract sentences for our audio data collection system, we only took two fields from this dataset: text category and article. The reason for choosing these fields is that the sentences in the other fields are inappropriate for our needs, and we can get a number of sentences from a single article by segmenting it with sentence end marks. For each article, we have six defined possibilities of text category as shown in the following bar plot diagram; sport, politics, business, entertainment, national, and international news.</p><p>While attempting to preprocess the data, we discovered that there are no missing values and that all of the fields contain only string object type data. We segmented out and took texts that included less than 15 words associated with their category to get precise sentences that fit our requirements. Following that, we saved our transcription text data in our project data folder for the upcoming processes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*MI_TIIHnJu1AYOnHT4MlTg.png" /><figcaption>Distribution of text category</figcaption></figure><h3>Results and Discussion</h3><p>We began our implementation with the system’s front-end. This was a react-based user interface with which the users would interact. It would allow the user to retrieve a sentence, skip to the next sentence, record an audio, listen to the audio, clear and re-record the audio, and finally send the audio and sentence to the backend. All of these features were built with the ReactJS front-end framework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/0*5BTwDmQ651krywn0.png" /></figure><p>The front-end communicates with the Flask back-end API. The front-end receives new sentences from this API and also sends text-audio pairs. In addition to the front-end, this API communicates with a Kafka instance, which serves as our system’s central bus. When a front-end request arrives, the back-end consumes one message from a Kafka topic. That single message is a sentence that has already been published on the subject. The message is then sent to the front-end by the back-end. Because it sends the text-audio pairs it receives from the front end to another Kafka topic, the API also serves as a publisher client.</p><p>We use a dockerized version of Kafka. There are two zookeeper instances and two brokers in our current configurations. Everything else is interacting with the brokers’ exposed ports. The docker-compose file we’re using also launches kafdrop, a Kafka visualization webapp. This enables us to have an easy-to-use interface for checking the status of our Kafka instance. This includes checking to see if messages have been published on the topics, determining whether the brokers are operational, determining when new messages arrive, and so on.</p><p>The spark jobs that clean and validate the audio in the text-audio pairs are another component. Airflow is used to start the spark job. The spark component first receives a list of audio text pairs and loads them into a spark dataframe before distributing them among various spark clusters. We remove long silences in the audio clips first, followed by any noise. Finally, the cleaned audio text pairs are saved in an Amazon S3 bucket.</p><h3>Lessons Learned</h3><p>In doing this project, I have learned how to create and configure Apache Kafka clusters, how to publish and subscribe to streams of records, how to store streams of records in a fault-tolerant durable way, and most importantly how to process them as they occur. I have also learned how to work with Apache Airflow for workflow orchestration and Apache Spark to load and transform the data we have.</p><h3>Future Plans</h3><p>Creating a reliable and fault-tolerant pipeline for storing speech and text can pave the way for training an effective Machine Learning Model. In this project, we were able to collect text and audio files in Amharic and store them in an S3 bucket. There are currently insufficient audios and transcripts for the Amharic language to develop an accurate machine learning speech recognition model.</p><p>Taking this into consideration, we can collect a larger number of text files and ask volunteers to record audios of those text files. As a result, the collected data will be saved in an S3 bucket and will be ready to be trained into a model.<br>Another issue is that our front-end can access the text via the flask API, which accesses the kafka consumer, but when it does so, we want it to access a text randomly from the kafka cluster. We intend to make this possible in the future.</p><p><strong>References</strong></p><ol><li>https:/ <a href="http://www.techtarget.com/searchaws/definition/AWS-bucket">www.techtarget.com/searchaws/definition/AWS-bucket</a></li><li>https:/ <a href="http://www.databricks.com/spark/about">www.databricks.com/spark/about</a></li><li>2 https:/ aws.amazon.com/msk/what-is-kafka/</li><li>1 https:/ airflow.apache.org/</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=474f9e1c9fba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[End-to-End Web3 dApps : Certificate generation, distribution, and value transfer with Algorand…]]></title>
            <link>https://medium.com/@yohgut/end-to-end-web3-dapps-certificate-generation-distribution-and-value-transfer-with-algorand-9678410c98c2?source=rss-a0fe65873fbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/9678410c98c2</guid>
            <dc:creator><![CDATA[Yohannes Gutema]]></dc:creator>
            <pubDate>Sat, 01 Oct 2022 07:08:47 GMT</pubDate>
            <atom:updated>2022-10-03T11:27:38.367Z</atom:updated>
            <content:encoded><![CDATA[<h3>End-to-End Web3 dApps :</h3><h3>Certificate generation, distribution, and value transfer with Algorand NFTs and smart contracts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/0*0PhuYciXlk0WJlno" /></figure><h3>Overview of Web3</h3><p>Web3 is the stack of protocols that enable fully decentralized applications. Web3 technology is inherently about the user controlled internet. It is being achieved by a growing stack of decentralized technologies, such as blockchains, smart contracts, oracles, crypto wallets, storage networks, and more. 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.</p><p>Nowadays, the terms “web2” and “web3” are relatively new concepts used to market blockchain technologies. The figure below shows the different between web1,web2 and web3</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*3jLhxLioIh0YrVlt" /><figcaption>internet evolution web1,web2,web3</figcaption></figure><h3>Business Objective</h3><p>The main objective of this project is to build end-to-end Web3 dApps on Algorand Blockchain that will help 10 Academy generate and distribute Non-Fungible Tokens (NFTs) 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><p>Our client (10 Academy in this case) would like to solve the challenge of ensuring that certificates are available to all trainees in a secure way, and (if possible) that certificate holders can benefit from smart contract actions now and in the future. At present, certificates are distributed as simple PDF files, without the ability to verify their authenticity nor can our client undertake smart actions with the trainees/their contracts.</p><h3>The Algorand blockchain</h3><p>Algorand is an autonomous, decentralized blockchain network. It offers a wide range of secure, efficient and scalable applications. It was built for the financial future and the world’s first pure proof-of-stake(PoS) fundamental blockchain.</p><p>Algorand’s technology provides a collection of high-performance layer 1 blockchains that offer security, scalability, privacy and transaction finality. A layer-1 blockchain is a collection of solutions that improve the fundamental protocol to make the system more scalable. The consensus protocol changes, as well as sharding , are the two most prevalent layer-1 options.</p><p>The Algorand blockchain is managed by the Algorand Foundation and is available to any company or individual that wants to use it. Performance, interoperability and scaling as well as layer-2 smart contrats and private and public models are at the forefront of Algorand’s technical innovation development. Additional functionality like payment scalability and off-chain computing can be provided by layer-2 scaling solutions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44IYAyxS_Pd-hcZ237PNHA.png" /><figcaption>Algorand protocol</figcaption></figure><h3>Technologies Used for Implantation</h3><p>There are many technologies used to build the front-end and back-end of a web3 application. For this project HTML and CSS are used for the front-end and python is used back-end with the flask framework.</p><p>Algorand was the blockchain network used for this project. A local private network was started for development.</p><p><strong>Front-end</strong></p><ul><li>HTML</li><li>CSS</li><li>Javascript</li></ul><p><strong>Back-end</strong></p><ul><li>Python scripts (Algorand Python SDK)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*riXuV6tSbnRNTrZKkq4tdg.png" /><figcaption>login page</figcaption></figure><h3><strong>Result and Discussions</strong></h3><p>This project made use of the Algorand blockchain network and a neighborhood private network was started for development. Three accounts that can be used to fund other new accounts and the development of the application have already been created on the secret network.</p><p><strong>Accounts:</strong> entities on the Algorand blockchain associated with specific on-chain data, like a balance. An Algorand Address is an identifier for an Algorand account. After generating a private key and a corresponding address, sending Algos to the address on Algorand will initialize<br>its state on the Algorand blockchain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*_KFkqtVFs-pX4TJAX6uupg.png" /></figure><p><strong>Transactions: </strong>An Asset Transfer Transaction is used to opt-in to receive a specific type of Algorand Standard Asset, transfer an Algorand Standard asset, or revoke an Algorand Standard asset from a specific account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*RfP48q5S6EF4P7sRjOs6uw.png" /></figure><h3>NFT certificates</h3><p><strong>NFT: </strong>A non-fungible token is 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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*LNKO0TTqxxJFpIgxz1gQOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d4FliiVbvNTcJFrsTY9UqQ.png" /></figure><p><strong>Wallet: </strong>A blockchain wallet address serves as an individual’s identity while also storing the owner’s various cryptocurrencies. These programs store users’ public and private keys and communicate with other blockchain networks. These will allow tracking of digital assets, such as<br>Bitcoin, Ethereum, and Litecoin.</p><p><strong>Smart contracts:</strong> are snippets of code that live on the blockchain. They operate within the blockchain and are unchangeable. Smart contracts are based on an agreement between the parties. A transaction will happen if the rules written in smart contracts are executed accordingly.</p><h3>Challenges</h3><p>During this project I faced many challenges such as</p><ul><li>setup installation specifically sandbox</li><li>understanding concept of Algorand and blockchain</li><li>using the wallet, and AlgoSigner are challenging for me</li></ul><h3>Lesson Learned</h3><p>This project was so informative. Through the project, I learned the basics of blockchain technology and the future of the web. I learned the features of web 3 and how web 3 is coming up with solutions to problems associated with web 1 and web 2 technologies. I also learned the architecture of web 3 technology and how blockchain technology is enabling the development of more secure, reliable and transparent web apps and services. I also learned how to build and end to end web 3 decentralized applications.</p><h3>Future works</h3><p>Finally, we have a plan in the future to complete the development of the above project by adding the following features:</p><ul><li>To implement the MainNet to the certificate generation.</li><li>Generate the certificate picture directly using a form like input.</li><li>A way to associate privileges to access more than just resource links with the certificate NFTs.</li></ul><h3><strong>Reference</strong></h3><ol><li><a href="https://web3-technology-stack.readthedocs.io/en/latest/">https://web3-technology-stack.readthedocs.io/en/latest/</a></li><li>Understanding the web3 stack: <a href="https://edgeandnode.com/blog/defining-the-web3-stack">https://edgeandnode.com/blog/defining-the-web3-stack</a></li><li><a href="https://brave.com/web3/built-on-web3/">https://brave.com/web3/built-on-web3/</a></li><li><a href="https://cointelegraph.com/blockchain-for-beginners/aagorand-algo-a-beginners-guide-to-the-decentralized-blockchain-technology">https://cointelegraph.com/blockchain-for-beginners/aagorand-algo-a-beginners-guide-to-the-decentralized-blockchain-technology</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9678410c98c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data warehouse tech stack with MySQL, DBT, Airflow]]></title>
            <link>https://medium.com/@yohgut/data-warehouse-tech-stack-with-mysql-dbt-airflow-11b46950ed0c?source=rss-a0fe65873fbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/11b46950ed0c</guid>
            <dc:creator><![CDATA[Yohannes Gutema]]></dc:creator>
            <pubDate>Sat, 24 Sep 2022 18:15:32 GMT</pubDate>
            <atom:updated>2022-09-25T17:19:32.744Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction</strong></h3><p>Data engineering involves designing and building systems for collecting, storing, and analyzing data on large scale. A data warehouse is a database, which is kept separate from the organization’s operational database intended for querying and analysis of historical data. A data warehouse is built by collecting data from different organization’s transactional data sources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*kOQzMPNh67dG1Qkx.jpeg" /><figcaption>Pipeline using ELT pipeline using MySQL, Airflow, DBT and Redash</figcaption></figure><p>The diagram shown above shows that workflow of this pipeline starts by reading the raw CSV data from the source into MySQL(Postgress) database, transform it using dbt, present the output by using Redash, and the final output then can be used by the data consumers such as BI tools, or Machine learning models. In the meantime, Airflow is used to schedule a daily job to sync the data from the source and perform the overall operations.</p><p><strong>Objective of the projects </strong><br>This project aims at developing a scalable data warehouse that will host the vehicle trajectory data extracted by analyzing footage taken by swarm drones and static roadside cameras.</p><h3>Data</h3><p>Data used in this project is found 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.</p><h3>Methodology</h3><p>Extract Load Transform (ELT) framework is the method that will be used with DBT. The ELT framework helps analytic engineers in the city traffic department setup transformation workflows on a need basis.</p><p><strong>Tech Stack</strong></p><p><strong>Airflow</strong>: an open-source workflow management platform which offers the ability to develop, monitor, and schedule workflows programmatically. Airflow pipelines are defined in Python, which are then converted into Directed Acyclic Graphs (DAG). Airflow offers numerous integrations with third-party tools, including the Postgres Airflow Operator and can be run locally using Docker Compose. Airflow is used in our pipeline to schedule a daily job that triggers the Postgres sync, followed by the dbt transformation.</p><p><strong>dbt (Data Build Tool): </strong>an open-source data transformation tool that relies on SQL to build production-grade data pipelines. dbt replaces the usual boilerplate DDL/DML required to transform data with simple modular SQL SELECT statements and handles dependency management. dbt provides a cloud-hosted option and a CLI, a Python API and integration with Airflow. In our pipeline, dbt applies a simple transformation on the ingested data using a SQL query.</p><p><strong>PostgreSQL: </strong>an advanced, enterprise class open source relational database that supports both SQL (relational) and JSON (non-relational) querying. I used it to store the raw and transformed data.</p><p><strong>Redash</strong>: an open source web application used to explore, query, visualize, and share data from our data sources.</p><p><strong>Docker</strong>: an open-source platform for building, deploying, and managing containerized applications</p><p><strong>Python</strong>: an object oriented programming language used to write the data extracting, loading and transforming scripts.</p><h3>Implementation</h3><p>To perform this projects the following steps are done with experiment</p><p><strong>Step 1: Data Extraction and Loading</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/981/1*kRcs5PMmsMN6L6wtDsmceA.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><h4><strong>Step 2: </strong>set up repo with default files</h4><p>The next step I took was to set up a new repo 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 Dockize 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*kttTiVJx0TC5wTWylUU5JA.png" /><figcaption>docker file</figcaption></figure><p>Next, I created a dag file and went ahead to configure it so as to load my data into the warehouse.</p><h4>Step 3: The Airflow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uvxJk8FdHBnR0O89" /><figcaption>ELT dag</figcaption></figure><p>Once I ensured that everything was running in my airflow dag, I went ahead and setup my Data Build Tool(DBT).</p><p><strong>step 4: The dbt Transformation</strong></p><p>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.</p><p>A python script that allows the dbt transformation models to transform the raw data is written to generate the overall vehicle’s information, such as computing the total number of vehicles in each category, average speed of the vehicle, and the total traveled distance. In addition to that, the individual vehicle information for the six vehicle types such as car, taxi, bus, motorcycle, medium, and heavy vehicles is extracted from the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*vZDbBPAHcrGuVYgV.png" /><figcaption>dbt Lineage Graph</figcaption></figure><p><strong>Step 5: Redash and Visualization</strong></p><p>the last steps is Visualization of the data using Redash, which helps us instantly develop a dashboard for us where we can view these outcomes. 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*OgCddQgDQoBkpqm4PQmECA.png" /><figcaption>Redash query page</figcaption></figure><h4>Challenges</h4><p>The main Challenge I faced in this projects was Setup and the tools used are new for me and I lost most of my time on installing those tools. Using the <em>docker-compose.yml </em>file from the Airflow documentation took a large amount of resource so I used a less complicated <em>docker-compose.yml. </em>Trying to setup and connect the Redash was a challenge.</p><p><strong>Future Work</strong></p><p>The faced challenges can be improved by understanding how Redash works with Airflow and DBT, how to set it up and keep it working, and use a larger storage or techniques to run <em>docker-compose.yml </em>for the Airflow without the PC being busy, finding AWS instance would be an ideal solution.</p><h4>Conclusion</h4><p>I’ve learned from this data warehousing project that by combining these incredible tools in real time, we may manage to carry out such complicated tasks. The data is extracted, analyzed, and transformed using SQL queries in dbt, saved to our Postgres data warehouse, and then potentially published on Redash for sensing it. This is merely a typical illustration of how an ELT pipeline reduces overhead.</p><h3>Reference</h3><ol><li><a href="https://www.analyticsvidhya.com/blog/2021/06/how-to-build-a-data-warehouse-using-postgresql-in-python/">https://www.analyticsvidhya.com/blog/2021/06/how-to-build-a-data-warehouse-using-postgresql-in-python/</a></li><li><a href="https://docs.getdbt.com/dbt-cli/install/overview#pip">https://docs.getdbt.com/dbt-cli/install/overview#pip</a></li><li><a href="https://livebook.manning.com/book/data-pipelines-with-apache-airflow/chapter-1/v-6">https://livebook.manning.com/book/data-pipelines-with-apache-airflow/chapter-1/v-6</a></li><li><a href="https://www.youtube.com/playlist?list=PLy4OcwImJzBLJzLYxpxaPUmCWp8j1esvT">https://www.youtube.com/playlist list=PLy4OcwImJzBLJzLYxpxaPUmCWp8j1esvT</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11b46950ed0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prompt Engineering: In-context Learning with LLMs]]></title>
            <link>https://medium.com/@yohgut/prompt-engineering-in-context-learning-with-llms-bc81b5ea659c?source=rss-a0fe65873fbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc81b5ea659c</guid>
            <dc:creator><![CDATA[Yohannes Gutema]]></dc:creator>
            <pubDate>Sat, 17 Sep 2022 15:21:20 GMT</pubDate>
            <atom:updated>2022-09-19T05:38:09.568Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GDMugffPGIggX3CE.png" /></figure><h3><strong>Overivew</strong></h3><p>Language modeling is one of the most critical components of natural language processing. It is a statistical tool that analyzes the pattern of human language for predicting words. In language modeling, there is a concept called in-context learning. Large language models such as DALL-E, MidJourney, GPT-3, etc. are capable of in-context learning. For a given task, the model inputs an optional description of that task along with some examples demonstrating the tasks, up until some final example that the model should complete itself.</p><p>Large language models typically range in size from tens of gigabytes to petabytes and are trained on vast volumes of textual data. They rank among the models with the highest number of parameters, where a <strong>parameter</strong> is a value that the model can alter on its own as it gains knowledge. The components of the model that are learned from prior training data are called parameters, and they effectively define the model’s competence for a problem, such as generating text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*RSDH1jYTZMpt0euT.png" /><figcaption>Prompt engineering</figcaption></figure><p><strong>Word embedding — </strong>One of the most popular and crucial techniques for extracting text data features is word embedding. The embedding layer, which maintains a lookup table to convert words represented by numeric indexes to their dense vector representations, frequently controls the deep learning component of the TensorFlow and Keras frameworks.</p><h4>Attention Mechanism</h4><p><strong>Seq2Seq</strong> consists of an encoder-decoder architecture, where the encoder processes the input sequence and encodes it into a context vector with a predetermined length. The decoder is then given a context vector as initialization, and it uses this vector to produce the output that has been transformed or translated. This Seq2Seq paradigm has the drawback of not being able to store larger sequences. Once it has processed the entire sequence, it frequently forgets the earlier portions of the input sequence. This issue of long decencies was addressed by the attention mechanism.</p><p><strong>Transformer algorithms — </strong>A transformer is a deep learning model that is self-sufficient and evaluates its input and output data representations. Transformers quickly became the front-runner for applications like word recognition that focuses on analyzing and predicting text. It led to a wave of tools, like OpenAI’s Generative Pre-trained Transformer 3 (GPT-3), which trains on hundreds of billions of words and generates consistent new text to an unsettling degree.</p><p><strong>Fine-Tuning</strong> — Pre-trained language models for specific tasks (e.g. sentence classification, named entity recognition, question-answering, etc.) need to fine-tune, which usually requires much less data as compared to what’s needed for pre-training. All the model parameters are updated through gradient descent, not just the task-specific layer.</p><h3>In-context Learning</h3><p>In-context learning allows users to quickly build models for a new use case without worrying about fine-tuning and storing new parameters for each task. Fine-tuning models require enormous amounts of data and also needs tuning and updating model weights to accurately solve problems.</p><p><strong>To create efficient and effective training prompts for any type of task:</strong></p><blockquote><strong><em>Step -1:</em></strong><em> Define the problem you are trying to solve and bucket it into one of the possible natural language tasks classification, Q &amp; A, text generation, creative writing, etc.</em></blockquote><blockquote><strong><em>Step -2: </em></strong><em>Ask yourself if there is a way to get a solution with a zero-shot.</em></blockquote><blockquote><strong><em>Step -3:</em></strong><em> If you think that you need external examples to prime the model for your use case, go back to step 2 and think really hard.</em></blockquote><blockquote><strong><em>Step -4:</em></strong><em> Now think of how you might encounter the problem in a textual fashion, given the “text-in, text-out” interface of GPT-3.</em></blockquote><blockquote><strong><em>Step -5: </em></strong><em>If you end up using external examples, use as few as possible and try to include variety in your examples without essentially overfitting the model or skewing the predictions</em></blockquote><h4>Objective of the Project</h4><p>The objective of this project is to provide a summary of the task with a focus on the LLM, Transformer, GPT, and In-context learning. To build entity extraction using cohere API with the prompt from the client. Describe the methods behind the pretrained LLM model and GPT3. The first business to build a system that gathers news artifacts from websites for the clients is required by the business for this project.</p><p><strong>Data and Features</strong></p><p>There are two datasets you will use for this project: <strong>Data 1: </strong>→ <a href="https://docs.google.com/spreadsheets/d/19N_K6SnIm0FylD2TBs-5y3WeSgdveb3J/edit?usp=sharing&amp;ouid=108085860825615283789&amp;rtpof=true&amp;sd=true">This data</a> with the following columns.</p><ul><li><strong>Domain- a </strong>base URL or a reference to the source this item comes from</li><li><strong>Title</strong> — the title of the item — the content of the item</li><li><strong>Description</strong> — the content of the item</li><li><strong>Body</strong> — the content of the item</li><li><strong>Link</strong> — URL to the item source</li><li><strong>Timestamp</strong> — timestamp that this item was collected at</li><li><strong>Analyst_Average_Score</strong> — target variable — the score to be estimated</li><li><strong>Analyst_Rank </strong>— score as rank</li><li><strong>Reference_Final_Score</strong> — Not relevant for now — it is a transformed quantity</li></ul><p><strong>Data 2:</strong>The data is job descriptions and relationships between entities in JSON format.</p><p>⇾ Dataset 1: <a href="https://github.com/walidamamou/relation_extraction_transformer/blob/main/relations_dev.txt">For development and training</a> and Dataset 2: <a href="https://github.com/walidamamou/relation_extraction_transformer/blob/main/relations_test.txt">For testing and final reporting</a></p><h4>Entity Extraction from Job Description</h4><p>In this section, we dive into how to design a prompt to extract entities from job descriptions using the <a href="https://os.cohere.ai/">cohere</a> API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*n3qCVEZa4VRKL1LS.png" /></figure><p><strong>Read train and test dataset</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*cVTnRmgiftNkv1wCGjhNMw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*uiW9BAlM_TkO3bYk9dpOlg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*A_u1dahGtx6NxD8_IKAjvw.png" /></figure><p>After reading the JSON data which contains job descriptions and extracted entities like SKILLS, EXPERIENCE, DIPLOMA, etc., we design a good prompt for the models.</p><blockquote><strong>Extraction of Entity with Generative Models</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*7gZEGplvpyx1TBE6NnY0Sg.png" /></figure><p><em># Create and retrieve a Cohere API key from os.cohere.ai</em><br>co <strong>=</strong> cohere<strong>.</strong>Client(api_key)</p><p><em>PROMPT — below is provided an example for the few shot learing, extracted from the training data. we attach a given job description to these examples and give it to the model.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*FpUMRD_UkXX1oD9kLD_o4w.png" /></figure><p><strong>Save Extract text</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*cYNzlcNU8sqaoXHBGw8DDg.png" /></figure><h3>News Artifact Scoring and Classification</h3><p>The step used for this task is similar to what we have seen in the above section. Hence, we will apply the in-context learning of the cohere platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*2ub4yBG5-H9jz-ddvfxmCw.png" /></figure><h3>Summary</h3><p>In-context learning enables LLMS like GPT-3 to learn patterns from a few examples. But generating good examples or optimal prompts for the model is expected from the user to get good functionality. We can use these LLMS for our business needs. So, we should understand the business and design prompts that can help the models generate or extract the pattern we needed for our business. Large companies like Google, OpenAI, etc are developing these models. Small companies could not develop this massive model from scratch as it is costly in terms of the dataset, and computational resources. However, they can benefit from the model developed by large companies using the provided API. In this example, we have tried to provide an example of the usage of API to solve problems like entity extraction and news classification based on their content.</p><h3>Recommendation and Future Work</h3><p>The blogger only focus on highlight concept of Large language models, therefore the detail concept of language models is needed for future.</p><h3>References</h3><p><a href="https://docs.cohere.ai/api-reference/">https://docs.cohere.ai/api-reference/</a></p><p><a href="https://towardsdatascience.com/the-beginners-guide-to-language-models-aa47165b57f9">https://towardsdatascience.com/the-beginners-guide-to-language-models-aa47165b57f9</a></p><p><a href="https://towardsdatascience.com/understanding-neural-machine-translation-encoder-decoder-architecture-80f205643ba4">https://towardsdatascience.com/understanding-neural-machine-translation-encoder-decoder-architecture-80f205643ba4</a></p><p><a href="http://ai.stanford.edu/blog/understanding-incontext">http://ai.stanford.edu/blog/understanding-incontext</a></p><p><a href="https://neptune.ai/blog/word-embeddings-guide">https://neptune.ai/blog/word-embeddings-guide</a></p><p><a href="https://www.davidsbatista.net/blog/2018/12/06/Word/_Embeddings">https://www.davidsbatista.net/blog/2018/12/06/Word_Embeddings</a></p><p><a href="https://towardsdatascience.com/word-embeddings-what-are-they-really-f106e1ff0874">https://towardsdatascience.com/word-embeddings-what-are-they-really-f106e1ff0874</a></p><p><a href="https://docs.cohere.ai/text-classification-embeddings">https://docs.cohere.ai/text-classification-embeddings</a></p><p><a href="https://fourweekmba.com/prompt-engineering/">https://fourweekmba.com/prompt-engineering/</a></p><p><a href="https://txt.cohere.ai/how-to-train-your-pet-llm-prompt-engineering/">https://txt.cohere.ai/how-to-train-your-pet-llm-prompt-engineering</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc81b5ea659c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sales prediction for ROSSMANN Pharmaceutical]]></title>
            <link>https://medium.com/@yohgut/rossmann-pharmaceutical-sales-prediction-using-machine-learning-model-b8bbc9d5c7d9?source=rss-a0fe65873fbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8bbc9d5c7d9</guid>
            <dc:creator><![CDATA[Yohannes Gutema]]></dc:creator>
            <pubDate>Sat, 10 Sep 2022 10:47:34 GMT</pubDate>
            <atom:updated>2022-09-11T21:27:48.710Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L4Awi9L1Im1AU4AcKJHPfw.jpeg" /><figcaption>store</figcaption></figure><p><strong>Business Understanding</strong></p><p>Rossmann owns and operates many pharmacies throughout different countries. The accuracy of the statistics may change when thousands of individual managers estimate sales based on their personal experiences.</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>The data teams identified factors such as promotions, competition, school and state holidays, seasonality, and locality as necessary for predicting the sales across the various stores.</p><p>The aim this article is to build and serve an end-to-end product that delivers this prediction to analysts in the finance team.</p><h3>Data Understanding</h3><p>The data for this challenge can be found <a href="https://www.kaggle.com/competitions/rossmann-store-sales/data">Rossmann Store Sales | Kaggle</a></p><blockquote><strong>Data Preprocessing</strong></blockquote><p>The initial step was to look for outliers in the data and prepare it for further analysis by filling missing values with mean for numerical variables, a mode for categorical variables.</p><p>The data provided by the data team was classified in to three groups. The data is raw data and must need preprocessing as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*jvFxM6S1-U0ThMEQF_5IYQ.png" /><figcaption>top portion of train dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*zTK8A4NgsvVZ9zTOJ2ZrkQ.png" /><figcaption>top portion of test dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*QL6k_LF5SSOvs2ndQsmlNw.png" /><figcaption>list of store dataset column and top portion of store csv dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/1*6BafMtZKMpKvdpD9v4Btng.png" /><figcaption>checking missing values in store dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*CuK9W0hgCTOzwurUfrKtXg.png" /><figcaption>Handle missing values</figcaption></figure><blockquote><strong>During preprocessing we need to convert Date Time data filed into month, day and year.</strong></blockquote><p>Merge separate tables; train &amp; store and test &amp;store data as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*5HcnUVlURIdg8WW3UySiww.png" /><figcaption>merging separate tables</figcaption></figure><blockquote><strong>Checking for outliers</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*0FVH1kxTTCgV-qMzjSTBUw.png" /><figcaption>competition distance Outlier</figcaption></figure><h3>Feature Importance</h3><p>After the raw dataset is preprocessed the next step is features selection based on their importance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*jh7Ei8GX9DLqfP3AVQhafA.png" /></figure><p>Based on the above figure competition distance is the most important features for Random forest models in order to determine its performance</p><h3><strong>Data Exploration and Analysis(EDA)</strong></h3><p>In this section we are going to explore the behavior of customers in the various stores. Our goal is to check how some measures such as promos and opening of new stores affect purchasing behavior.</p><p>The following points are going to be analysis:-</p><blockquote><strong>Comparing Sales behavior on holiday</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*V1m-sdIq38TVL0w6Bo-fhA.png" /><figcaption>Sales and Customers during holidays</figcaption></figure><p>There appear to be more sales during and after the holidays than before. During the Christmas season, most customers and sales were recorded.</p><blockquote><strong>Seasonal (Christmas, Easter etc) purchase behaviors</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*LKaI3LWkTWMASn7FAFf8AQ.png" /></figure><p>Sales increased during December month</p><blockquote><strong>Correlation between features</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*GWljquBAVKDRAhapAcRi9w.png" /><figcaption>Scater b/n sales and customers</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*vyvff9D6DwsXEbGInZj4Hg.png" /></figure><p>The correlation between the features Sales and customers is around 0.9208. The number is closer to 1, which means these two features are highly correlated and have positive Correlation</p><blockquote>Number of sales in the weeks</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*VZbAGSKFPDO7hy28gbE33w.png" /></figure><p>The first day of the week has the highest sales and the opposite is for last day of the week</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uzhrvSQXgLCMT7h_TDapuw.png" /></figure><blockquote><strong>How the assortment type affects sales</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j8ghMwjp6uSzuU7t4WAGLQ.png" /></figure><p>Stores with extra assortment have highest mean Sales and number of Customers</p><h3>LSTM Models for Time Series Forecasting Rossmann Data</h3><blockquote>Training LSTM</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*3RrjkcPnOjqF2MzM_flapw.png" /></figure><blockquote>Calculating loos function</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*0hsezL4IYLC5A4uiuj4bng.png" /></figure><blockquote>Forecasting the model</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*iWqThW0L0BbhHEXHsgte6w.png" /></figure><h3>Summary</h3><ul><li>More stores are opened during school holidays, compared to state holidays</li><li>There is a positive correlation between the number of sales and the number of customers for the store types.</li><li>Promotion affects the sales in a positive way, the increase to promotion leads to an increase in sales.</li><li>The Rossmann data is time series data</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8bbc9d5c7d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>