<?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 Nardos Tilahun on Medium]]></title>
        <description><![CDATA[Stories by Nardos Tilahun on Medium]]></description>
        <link>https://medium.com/@nardostilahun?source=rss-539c90042afe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rHLntMFp5IVIqtstOYAGdg.png</url>
            <title>Stories by Nardos Tilahun on Medium</title>
            <link>https://medium.com/@nardostilahun?source=rss-539c90042afe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 05:49:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nardostilahun/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[Amharic Speech-to-text data collection tool]]></title>
            <link>https://medium.com/@nardostilahun/amharic-speech-to-text-data-collection-tool-cb4340e7e1ae?source=rss-539c90042afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb4340e7e1ae</guid>
            <dc:creator><![CDATA[Nardos Tilahun]]></dc:creator>
            <pubDate>Sat, 09 Jul 2022 20:57:12 GMT</pubDate>
            <atom:updated>2022-07-12T20:28:29.191Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This blog describes how to produce a tool that can be deployed to process posting and receiving text and audio files from and into a data lake, apply transformation in a distributed manner, and load it into a warehouse in a suitable format to train a speech-to-text model.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*T5SpX_yHqzXesO9M-lUegA.png" /></figure><h4>Abstract</h4><p>The purpose is to build a data engineering pipeline that allows recording millions of Amharic and Swahili speakers reading digital texts in-app and web platforms. There are a number of large text corpora we will use, but for the purpose of testing the backend development, you can use the recently released Amharic news text classification dataset with baseline performance dataset: <a href="https://github.com/IsraelAbebe/An-Amharic-News-Text-classification-Dataset">IsraelAbebe/An-Amharic-News-Text-classification-Dataset: An Amharic News Text classification Dataset (github.com)</a></p><p>You can read a brief description of the data <a href="https://arxiv.org/pdf/2103.05639.pdf">here</a>.</p><p><strong>Alternative data</strong></p><p>Ready-made Amharic data collected from different sources <a href="https://drive.google.com/file/d/1_YLX27TdACjIF1iu8e3t-kkTb1qBlLkO/view?usp=sharing">here</a></p><h4>Introduction</h4><ul><li><strong>Apache Kafka</strong></li></ul><p>Is a distributed messaging platform that allows developers to sequentially log streaming data into topic-specific feeds, which other applications in turn can tap into. Its framework basically consists of 3 players, being 1) brokers; 2) producers; and 3) consumers. A broker is an instance of a Kafka server (also known as a Kafka node) that hosts named streams of records, which are called topics. A broker takes in messages from producers and stores them to a topic.</p><ul><li><strong>Apache Airflow</strong></li></ul><p>Is a task scheduling platform that allows you to create, orchestrate and monitor data workflows. Used to schedule the texts coming from the queue, and also prioritize tasks. We can create a DAG around it so that Airflow can periodically trigger a stream of data that is pushed by the Producer into the topic.</p><ul><li><strong>Apache Spark</strong></li></ul><p>Is a multi-language engine for executing data engineering, data science, and machine learning on single-node machines or clusters. By implementing the kafka clusters on a node we can use it to transfer the data to the client.</p><p>First, step is to filter text corpus relevant. Spark can easily be used for streaming purpose. Then, perform semantic analysis on the text corpus.. Some text corpus to be considered positive matches, whereas some to be<br>considered negative, so support vector machine (SVM)can be used for this purpose.</p><h4>Generate ID</h4><p>Start off by generating an ID and that will be used to uniquely identify the data streaming into the frontend and also determine the data storage into the data lake. The uuid package can generate the id as 16 octets and represented as 32 base-16 characters, that can be used to identify the audio file and random text that appears on the screen.</p><h4>Generate Text</h4><p>The next step is to generate random texts from the csv containing multiple different news articles and headlines classified into different categories. By using pyspark to generate the random text after connecting spark session to a kafka cluster. Therefore the randomly generated data retrieved is going to come as the headline, article,category and date received but from the dataset. And place the necessary validations that are required for this particular task.</p><h4>Streaming Text</h4><p>After generating the random text, then the streaming begins and stream the data into the frontend for the user to see. For this service use apache kafka, send the published random text data, consume the text and send back an audio file flush it to the data lake that, s3 bucket.</p><p><strong>Preprocess Data</strong><br>Once the data is received clean and pass it through some checks, preprocessing<br>1. Check the audio file whether it has data by displaying a simple wave form<br>2. Check the frequencies of the audio file to see if they are normal<br>3. Convert it into spectogram and check the mfccs, to see whether the standard 12 coeﬀicients, if they are having some pattern<br>4. Split the audio file into chunks, that is words and then we store it and count the number of chunks whether they are similar to the length of the articles string split.</p><p>Once it passes all these checks, transform the data by matching it to the data in the data lake and attaching the id for retrieval. Once it is pushed to the s3 bucket, that means it is successfully push it to the s3 bucket. Further tasks can be run for updating the metadata, and the model.</p><h4>Conclusion</h4><p>So we can conclude, that yes there is a decrease in the word error rate, meaning we truly achieve our purpose. And then another thing, is that we notice that this action takes seconds, therefore this is really awesome, because we get the best of both worlds.</p><p>Want to have a look at the implementation? Follow these link.</p><p><a href="https://github.com/nardoshood/STT-Data-Collection">GitHub - nardoshood/STT-Data-Collection</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb4340e7e1ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amharic Speech-to-text]]></title>
            <link>https://medium.com/@nardostilahun/amharic-speech-to-text-59aa55b097fa?source=rss-539c90042afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/59aa55b097fa</guid>
            <category><![CDATA[amharic-text-to-speech]]></category>
            <category><![CDATA[text-to-speech]]></category>
            <category><![CDATA[amharic]]></category>
            <dc:creator><![CDATA[Nardos Tilahun]]></dc:creator>
            <pubDate>Thu, 09 Jun 2022 18:16:47 GMT</pubDate>
            <atom:updated>2022-06-15T07:27:54.174Z</atom:updated>
            <content:encoded><![CDATA[<p>The objective of this project is to build a deep learning model that is capable of transcribing a speech to text. We will build an end-to-end automatic speech recognition for Amharic language. It will accept Amharic audio as input and return a predicted transcription of the spoken language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*FeGlZl-94wZpTjxUk9-XZw.gif" /></figure><p>This blog shows the steps taken in the implementation of the speech recognition and a summary.</p><h4>Introduction</h4><p>The World Food Program wants to deploy an intelligent form that collects nutritional information of food bought and sold at markets in two different countries in Africa — Ethiopia and Kenya. The design of this intelligent form requires selected people to install an app on their mobile phones, and whenever they buy food, they use their voice to activate the app to register the list of items they just bought in their own language. The intelligent systems in the app are expected to live to transcribe the speech-to-text and organize the information in an easy-to-process way in a database.</p><p>Our task is to create a deep learning model capable of converting speech to text. The model we will create should be precise and resistant to background noise.</p><p><strong><em>Speech Recognition</em></strong></p><p>Speech recognition, also known as automatic speech recognition (ASR), computer speech recognition, or speech-to-text, is a capability which enables a program to process human speech into a written format. Speech recognition focuses on the translation of speech from a verbal format to a text one.</p><p>Though there are good implementation of speech recognition developed for English language and other languages, speech recognition for Amharic language still remains underdeveloped. From business context, Amharic speech recognition can be used in <em>Hands Free Technology, Systems Aiding the Visually- and Hearing-Impaired, </em>and<em> so on.</em></p><h4>Methology</h4><ul><li>First audio data will be collected with their respective transcription. The audio data used in this model can be found <a href="https://github.com/getalp/ALFFA_PUBLIC/tree/master/ASR/AMHARIC">here</a>, contains (~20hr training and ~2hrs test)</li><li>Then the audio data will be preprocessed so the necessary features is extracted and ready for be trained</li><li>The preprocessed data is then feed into the model for training</li><li>The model will be deployed and the users can upload their audio through the web app to see the model working and get the text from of the audio.</li></ul><p><strong>Preprocessing</strong></p><ul><li>Load audio files — The input data are Amharic audio ﬁles of the spoken speech that are in the audio format “.wav”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*vjwcyqP6ywX-CT9aiBkC2A.png" /></figure><ul><li>Convert all audio files from mono to stereo channels — Our speech dataset must be in a similar channel to be processed for ASR</li><li>Prepare a meta data — Metadata is information that is used to link an audio file to its transcribed counterpart.</li><li>Standardize all data with the same sampling rate (44.1KHZ) — Resample the audio ﬁles so that they have uniform sample rates.</li><li>Resizing all data to the same length (duration) — We have found that most of our audio duration is between 2 -8. Convert all items to have the same duration, which involves padding the shorter audio ﬁles and truncating the longer ones. In our case we used the padding method.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*lmcSs9dTjA8DnWuCvc8nhA.png" /></figure><ul><li>Data augmentation to enhance the dataset —</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*vlG8N28NpUpyRqgkU9WDpw.png" /></figure><ul><li>Extract features from the audio file — Every audio signal consists of many features. However, we must extract the characteristics that are relevant to the problem we are trying to solve.</li><li>Convert the raw audio ﬁles to Mel Spectrograms which capture the nature of the audio ﬁles as images by decomposing them into sets of frequencies.</li></ul><h4>Deep learning architecture</h4><p>In the deep learning era, neural networks have shown significant improvement in the speech recognition task. Various methods have been applied such as convolutional neural networks (CNNs), recurrent neural networks (RNNs), while recently Transformer networks have achieved great performance.</p><p><strong>Recurrent Neural Networks(RNN)</strong></p><p>RNNs perform computations on the time sequence since their current hidden state is dependent on all the previous hidden states. More specifically, they are designed to model time-series signals as well as capture long-term and short-term dependencies between different time-steps of the input.</p><p><strong>Convolution Neural Network(CNN)</strong></p><p>Convolution Neural Networks (CNN) is a type of deep learning architecture that is specialized to be used in analyzing visual datasets. Since CNN can exploit spatial and temporal correlation in the datasets, it is successful architecture in image analysis and processing. The convolution layer explores useful local features of the input data, and the sub-sampling layer gets the features and summarizes the results.</p><p><strong>Deep Speech Model</strong></p><p>The core of the engine is a recurrent neural network (RNN) trained to ingest speech spectrograms and generate text transcriptions. It combines a 2D CNN, RNN and a Connectionist Temporal Classification (CTC) loss to build an ASR</p><p>The first Architecture used to build the Deep learning model is simple model using a GRU(gated recurrent units) which is an lstm with a forget gate and CNN (convolution neural networks. A CTC (Connectionist Temporal Classification) loss was used to aligned words with their specific signal audio</p><p>The second model used the deep speech architecture, full reference can be found at <a href="https://keras.io/examples/audio/ctc_asr/"><em>https://keras.io/examples/audio/ctc_asr/</em></a></p><p>We evaluated the quality of the models using <a href="https://en.wikipedia.org/wiki/Word_error_rate">Word Error Rate (WER)</a>. For the first model the WER was 100% but for the second model WER ws much better with a WER of 59%</p><ul><li><strong>For the first model</strong></li></ul><p>True: በለጠ ች የ በየነ የ በኩር ልጅ ነች</p><p>Predicted: ቡሉጡሀቡሀማሀኸማሉቾ</p><ul><li><strong>For the second model</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fn6ski-5H7dszqSj" /></figure><p><strong>Deployment</strong></p><ul><li>At last the model was integrated with an web app which was deployed on azure app service.</li><li>The frontend was built using react which accepts wav file from users and deployed on netlify.</li><li>The backend was done using flask which accepts an audio from the frontend and transcribes the given audio and sends the data back to the user interface to be displayed</li></ul><h4>Future work</h4><p>The model can have better performance if we do more training. Therefore, we aim to improve the performance of the model and compress the size.</p><h4>Reference</h4><ul><li>Full project can be found on my github page <a href="https://github.com/nardoshood/STT">https://github.com/nardoshood/STT</a></li><li>Automatic Speech Recognition using CTC<a href="https://keras.io/examples/audio/ctc_asr/"> https://keras.io/examples/audio/ctc_asr/</a></li><li>Deep Speech Model <a href="https://deepspeech.readthedocs.io/en/r0.9/DeepSpeech.html#deepspeech-model">https://deepspeech.readthedocs.io/en/r0.9/DeepSpeech.html#deepspeech-model</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59aa55b097fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sales Prediction — Rossmann Pharmaceuticals]]></title>
            <link>https://medium.com/@nardostilahun/sales-prediction-rossmann-pharmaceuticals-95b6c28d8b0e?source=rss-539c90042afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/95b6c28d8b0e</guid>
            <category><![CDATA[sales-prediction]]></category>
            <dc:creator><![CDATA[Nardos Tilahun]]></dc:creator>
            <pubDate>Thu, 26 May 2022 21:32:55 GMT</pubDate>
            <atom:updated>2022-05-31T15:14:46.248Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sales Prediction a case for Rossmann Pharmaceuticals</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*PeXZJSvXvYYKikJS9cxWAg.png" /><figcaption>Time-series analysis</figcaption></figure><h4>Business Overview</h4><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 team 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>In this article we will discover how to make predictions and deliver and end-to-end product that can help the finance team.</p><ul><li>The data can be found <a href="https://www.kaggle.com/competitions/rossmann-store-sales/data">Rossmann Store Sales</a></li></ul><h4>Preprocessing</h4><p>Before using the data and start exploring to make visualizations we need to prepare the raw data.</p><blockquote>Note: This step is important because we don’t want to skew our analysis.</blockquote><p>We have four data we will use for this preprocessing. Some of the raw data are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*KTjsZwsn96sdee_GQuJX1Q.png" /><figcaption>Some portion of data in train.csv file</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*XTVlHyiQbsLoxnXycmzLZw.png" /><figcaption>Some portion of data in test.csv file</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Se0KjdWMj5JgL9COLp6law.png" /><figcaption>Some portion of data in store.csv file</figcaption></figure><ul><li>Merge separate tables; train &amp; store data</li></ul><pre>train_df = pd.merge(train_df, store_df, how=&#39;inner&#39;, on=&#39;Store&#39;)<br>train_df.info()</pre><ul><li>test &amp; store data</li></ul><pre>test_df = pd.merge(test_df, store_df, how=&#39;inner&#39;, on=&#39;Store&#39;)<br>test_df.info()</pre><ul><li>Look for outliers in the data</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*_m4bcFQ-m81dPPgC3KXHEw.png" /></figure><ul><li>Filling missing values with mean for numerical variables, a mode for categorical variables</li></ul><pre>fill_mean = [&#39;Promo2SinceYear&#39;, &#39;Promo2SinceWeek&#39;, &#39;CompetitionOpenSinceMonth&#39;, &#39;CompetitionOpenSinceYear&#39;, &#39;CompetitionDistance&#39;]<br>train_df = preprocess.fill_median(train_df, fill_mean)<br>test_df = preprocess.fill_median(test_df, fill_mean)<br><br># Fill the PromoInterval with mode values<br>train_df = preprocess.fill_mode(train_df, [&#39;PromoInterval&#39;])<br>test_df = preprocess.fill_mode(test_df, [&#39;PromoInterval&#39;])<br><br># Fill Open with 0 in test data <br>test_df = preprocess.fill_with_zero(test_df, [&#39;Open&#39;])</pre><ul><li>Convert the ‘Date’ to datetime so we can divide it to month, day, and year for time-required explorations.</li></ul><h4>Data Exploration</h4><p>Here we will 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>We use the following points as a guide during your analysis.</p><ul><li><strong>Sales behavior before, during and after holidays</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*cw62l9ybO69e_ewkCa3RFg.png" /></figure><p>We can see from the above comparison public holidays have more purchase,</p><p>Christmas has the least purchase sales</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*Fs_RXNRfOS-g2kdD4UAFIA.png" /></figure><ul><li><strong>Seasonal (Christmas, Easter etc) purchase behaviors</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*QgyR0KvJ-boTSltn3BDPvg.png" /></figure><p>Sales goes up around December, at times of Christmas and New Years.</p><ul><li><strong>Correlation between sales and number of customers</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*VowWwRGi4nq2A3N8kdsbKQ.png" /></figure><ul><li>It can be clearly seen that there is a positive correlation between the number of sales and the number of customers</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*noot4a0ajvJMx9i2VXr4cQ.png" /></figure><p>Show that there is a positive correlation between the number of sales and the number of customers for the store types.</p><ul><li><strong>How promo affect sales</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*aftvkgEkYXIsfRt3F9S7qQ.png" /></figure><p>Promotion affects the sales in a positive way, the increase to promotion leads to an increase in sales.</p><ul><li><strong>Number of sales through out the week.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*2tyhFrh2gwKhgYBx7-wMNw.png" /></figure><p>Shows that sales of the last day of the week is almost close to 0, none</p><ul><li><strong>How the assortment type affects sales</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*gBs1gtUcFz7MqUVQRKhwyg.png" /><figcaption>.</figcaption></figure><p>Assortment(A collection of goods or services provided to a consumer.) b has highest sales and a has the lowest sale.</p><h4>Summery</h4><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></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95b6c28d8b0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding A/B Testing]]></title>
            <link>https://medium.com/@nardostilahun/understanding-a-b-testing-7865b4c7c40e?source=rss-539c90042afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/7865b4c7c40e</guid>
            <category><![CDATA[ab-test]]></category>
            <category><![CDATA[ab-testing]]></category>
            <category><![CDATA[a-b-testing]]></category>
            <dc:creator><![CDATA[Nardos Tilahun]]></dc:creator>
            <pubDate>Fri, 20 May 2022 19:38:13 GMT</pubDate>
            <atom:updated>2022-05-26T15:40:24.317Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*v9TgE5KJlSHZ0JIEnJgauQ.png" /><figcaption>A/B Testing</figcaption></figure><p><em>The main objective of this post is to understand A/B testing by using real life problem (data).</em></p><p>Before diving into the project let us first recap our understanding of A/B testing.</p><h4>A/B Testing</h4><p>According to Wikipedia, A/B testing is a way to compare two versions of a single <a href="https://en.wikipedia.org/wiki/Variable_(mathematics)">variable</a>, typically by testing a subject’s response to variant A against variant B, and determining which of the two variants is more effective.</p><p><strong>a) Classic A/B Testing &amp; how it works</strong></p><p>Step 1: We define BCR(baseline conversion rate) and MDE(Minimum Detectable Effect</p><p>Step 2: We calculate the sample size</p><p>Step 3: We start driving traffic to our variations. The test can be finished only when each variation was visited by the necessary number of users</p><p>Step 4: Evaluate the results of our A/B test. If the difference in performance between variations reached MDE or exceeded it, we can consider that the hypothesis of our experiment is proven right.</p><p><strong>b) Sequential A/B Testing &amp; how it works</strong></p><ul><li>Sequential AB-tests allow us to monitor p-Values continuously and to make the decision to refute a hypothesis earlier based on the observed results.</li><li>Gives users a chance to finish the experiment earlier without increasing the possibility of false results.</li><li>It enables multiple checks on every step ensuring that the error level doesn’t exceed 5%.</li></ul><p>Step 1: We start our experiment by choosing a sample size, let’s call it N;</p><p>Step 2: Randomly assign variations under test to the treatment and control, with 50% probability each.</p><p>Step 3: Track the number of incoming successes for both variations. Let’s refer to the conversion rate of treatment variation as T and the conversion rate of control as C.</p><p>Step 4: It’s necessary to finish the test when T−C reaches √2N and declare the treatment variation to be the winner of your A/B test.</p><p>Step 5: ​​It’s necessary to finish the test when T+C reaches N. In such a case, declare that the experiment had no winner.</p><p><strong>c) Machine Learning Approach</strong></p><p>A major issue with traditional, statistical-inference approaches to A/B Testing is that it only compares 2 variables — an experiment/control to an outcome. The problem is that customer behavior is vastly more complex than this. Customers take different paths, spend different amounts of time on the site, come from different backgrounds (age, gender, interests), and more. This is where Machine Learning excels — generating insights from complex systems.</p><ul><li>Machine Learning algorithms enable us to model complex systems that include all of the ongoing events, user features, and more.</li><li>It is done by tailoring some of the features to represent the target feature and training several ML algorithms to model the intricacies that go under the hood inside the data. The core idea behind is to model the complex and abstract relationships with features including all of the ongoing events, user features, and more, and get their relationship with the target or the expected outcome that is too complicated for the human eye.</li></ul><p>The con of machine learning is:</p><ul><li>It can be less explainable and have lower performance.</li></ul><p>The benefit of machine learning is:</p><ul><li>Unlike statistical inference, Machine Learning algorithms enable us to model complex systems that include all of the ongoing events, user features, and more. There are several algorithms each with strengths and weaknesses.</li></ul><h4><em>Now lets look at a problem statement.</em></h4><p>The main objective of this project is to evaluate if the ads that smartAd company runs resulted in a significant lift in brand awareness. You can get the data <a href="https://github.com/nardoshood/smartAd-abTest/blob/main/data/AdSmartABdata.csv">here</a>.</p><p>The BIO data for this project is a “Yes” and “No” response of online users to the following question. The users targeted are online users shown the question whether they know the brand or not. And from these users, a sample was taken by taking a certain number of users that are not less than 30.</p><blockquote>Q: Do you know the brand Lux?</blockquote><blockquote>O Yes or</blockquote><blockquote>O No</blockquote><p>From the data we are able to observe the following</p><ul><li>The control group are the ones that were shown the dummy ad, while exposed online users are the ones that were shown the creative ad designed by smartAd.</li><li>Random sampling statistical process is used to generate data with Binomial distribution used to simulate data.</li><li>Since we have a large sample n &gt; 1000, we can model the data as normal distribution and use the Z-test as our statistical test.</li><li><strong>Hypothesis 0 (Null Hypothesis) </strong>states that both control and variation group engagement results have no statistical significance.</li><li><strong>Hypothesis 1 </strong>states that control and variation group engagement success has a different result and one of them has a statistical significance.</li><li>Level of Significance, <strong>𝛼=0.05</strong></li></ul><p><a href="https://github.com/nardoshood/smartAd-abTest/blob/classic-A/B-Testing/notebooks/classical_AB_testing.ipynb"><strong><em>Performing classic A/B testing</em></strong></a></p><p>A p-value is a statistical measurement used to validate a hypothesis against observed data. They are used to measure the probability of obtaining the observed results, assuming that the null hypothesis is true.</p><ul><li>Type I error: we reject the null hypothesis when it is true.</li><li>Type II error: we fail to reject the null hypothesis when it is false.</li></ul><p>With a p-value, we can use one value to make this decision and compare it directly to the significance level. If the p-value is less than the significance level then the null hypothesis is rejected, but if it is we fail to reject it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*4D5f1vqQL18K0eo1iw_0wg.png" /><figcaption>Barplot showing the awareness of users for both controlled &amp; exposed groups</figcaption></figure><pre># conclusion on p value<br>#calculating standard error of both groups<br>SE_control = np.sqrt((p_control_convert*(1-p_control_convert))/total_control)<br>SE_exposed = np.sqrt((p_exposed_convert*(1-p_exposed_convert))/total_exposed)<br># calculating z_score<br>Z_score = (p_exposed_convert - p_control_convert)/(np.sqrt(SE_control**2 + SE_exposed**2))<br># calculating p_value<br>p_value = norm.sf(Z_score)<br>p_value</pre><p>By using the above formula we calculated the p-value to be 0.2591726745827285, which is greater than our significance level (0.05)</p><p>With classical A/B testing, we determined if there was a significant lift in brand awareness which is instrumental to smartAd in making the next move.</p><p><a href="https://github.com/nardoshood/smartAd-abTest/blob/main/notebooks/sequential_testing.ipynb"><strong><em>Performing Sequential A/B Testing</em></strong></a></p><p>In sequential AB-tests, the final sample size where the AB-test is stopped is dependent on the data we observe during the test. So if we observe more extreme results at the start, the test can be ended earlier. To achieve this, a pair of statistical borders are drawn, e.g. based on the Type-I-Error rate we would like to obtain in our test. For every new data point we get, the sum of the log-likelihood ratio of our data is then compared to these boundaries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*w1hPfiDWT7Jm2OtDY8TuPg.png" /></figure><p><a href="https://github.com/nardoshood/smartAd-abTest/blob/main/notebooks/ml_model.ipynb"><strong><em>Automating A/B tests with Machine Learning</em></strong></a></p><ol><li>Logistic Regression-</li></ol><ul><li>Using ‘Browser’ dataframe</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*imf5QAo13c1Cdse84Ls7Lw.png" /><figcaption>Accuracy score</figcaption></figure><ul><li>Using ‘Platformos’ dataframe</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*C0FrqnOcxLKCnbmyHqOaHA.png" /><figcaption>Accuracy score</figcaption></figure><p>2. XGBoost</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*7kt5c_wT0oebKR0jbO72Ww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*MBAir7cMDs-td07c3SGFLg.png" /></figure><p>With Machine Learning, we discover that the other features like the hour of the day, and the dates, determine the conversion in brand awareness. it helps to discover useful information about datasets and variables when developing or aligning algorithms. Automates A/B testing to make the process more efficient and effective.</p><p>Top performing algorithms</p><p>1. XGBoost</p><p>2. Logistic Regression</p><p>3. Random Forest</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7865b4c7c40e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Twitter Sentimental Analysis ( using Economical Data)- with sourcecode]]></title>
            <link>https://medium.com/@nardostilahun/twitter-sentimental-analysis-using-economical-data-562e4c48d492?source=rss-539c90042afe------2</link>
            <guid isPermaLink="false">https://medium.com/p/562e4c48d492</guid>
            <category><![CDATA[10-accademy]]></category>
            <category><![CDATA[twitter-sentiment]]></category>
            <category><![CDATA[sentimental-analysis]]></category>
            <dc:creator><![CDATA[Nardos Tilahun]]></dc:creator>
            <pubDate>Sat, 30 Apr 2022 08:58:51 GMT</pubDate>
            <atom:updated>2022-05-02T06:17:27.929Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*N_xjOALpmIVHMJx0Xras4w.jpeg" /><figcaption>Wordcloud generated from the original data set</figcaption></figure><p>The goal of this article is to use tweets, to analyze them regarding the most used words and classifying them regarding their sentiment (positive, negative or neutral). We will use collection of tweets with keyword “Economy” as a dataset.</p><blockquote>How do I use my own dataset? And how to get it? Read the article “<a href="https://medium.com/towards-data-science/how-to-build-a-dataset-from-twitter-using-python-tweepy-861bdbc16fa5">How to build a dataset from Twitter using Python tweepy</a>”</blockquote><p>We begun by transforming the tweets into the right format so that we can use it for the training. Thus, clean the data. Cleaning twitter data consists checking if there is an error in the data, check if there is missing data, drop the Null valued rows, and clean the hashtag row. In this project we start of by cleaning the original data, we cleaned the emojis, links, non English tweets, hashtags, and duplicated tweets. (<a href="https://github.com/nardoshood/Twitter-Data-Analysis/blob/main/extract_dataframe.py"><em>extract_dataframe.py</em></a>)</p><p>From the original text (tweet) we extract the cloumns :<em> ‘created_at’, ‘source’, ‘original_text’, ‘polarity’, ‘subjectivity’, ‘lang’, ‘favorite_count’, ‘retweet_count’, ‘original_author’, ‘followers_count’, ‘friends_count’, ‘possibly_sensitive’, ‘hashtags’, ‘user_mentions’, and ‘place’.</em></p><p>The generated data frame will not be enough to to process the data and design the topic modeling. We are going to need to clean it more. we need to further clean up the “orignal_text” column and add a column called “cleaned_text” to hold the cleaned text in our data frame. Clean out the missing values, unnamed column, drop duplicate rows, convert some columns in to numeric data type, remove the hashtag, remove mentions, and remove links from the original text. <em>(</em><a href="https://github.com/nardoshood/Twitter-Data-Analysis/blob/main/clean_tweets_dataframe.py"><em> clean_tweets_dataframe.py</em></a><em> )</em></p><p>Once we have selected the features, we pass the data through the preprocessing stage. Here, the data gets prepared for the modeling step. Following comes the modeling, sentiment analysis and topic modeling. ‘</p><p>Each model would have its own Jupyter notebook. We used the cleaned data and built the models to get the sentiment of the tweets and look for any abstract topic related to the tweets.</p><h4>Insights about the data</h4><p>While exploring our datasets we have extracted the following insights.</p><ul><li>Determine the nature of polarity/subjectivity and study their correlation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*lqmKL1dCwHru_dJ3Mu8oCw.jpeg" /><figcaption>Bar chart shows the count of polarity and subjectivity</figcaption></figure><p>The above figure shows that most of the tweets have neutral polarity level and less subjectivity.</p><blockquote>Polarity is float which lies in the range of [-1,1] where 1 means positive statement and -1 means a negative statement. Subjective sentences generally refer to personal opinion, emotion or judgment whereas objective refers to factual information. Subjectivity is also a float which lies in the range of [0,1].</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*qvJZY4pBOYMBjPhGHYMh1w.jpeg" /><figcaption>Hit map of the correlation matrix</figcaption></figure><p>The above figure shows that polarity and subjective do not have much correlation in our case.</p><ul><li>Determine which language is used most in the tweets.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*WmUdS7LJEPiGlT8sml9sIw.png" /><figcaption>Pie chart show tweets percentage based language.</figcaption></figure><p>To determine the frequent language used for tweeting, we used the “lang” column and analysis that.</p><ul><li>Determine the nature of tweets for the top 50 authors</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*C5DJ9Gq-rGzC1yhffPdJWQ.jpeg" /><figcaption>Bar chart shows polarity and subjectivity for the top 50 authors</figcaption></figure><p>The above figure shows tweet polarity and subjectivity analysis for the top tweet authors. It shows the nature of tweets. For the analysis top 50 authors were selected by using the number of followers_count, friends_count, retweet count, and favourit_count.</p><ul><li>Determine the nature of frequent retweets</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*KjRBeWIsn7ynHlTWZ1VnrQ.jpeg" /><figcaption>Pie chart shows percentage for the nature of retweets</figcaption></figure><p>The above figure show the nature of retweets with higher number. To analyze this we used the “retweet_count”, “polarity” and “subjectivity”. The figure show that most retweeted tweets have a positive polarity.</p><h4><strong>Sentiment Analysis</strong></h4><p>Sentiment analysis is a process that detects the affective state of a text automatically. Our task was to identify and classify tweets as positive or negative.</p><p>First we labeled our data by using the ‘polarity’ column generated using the text blob library. We used SGD classifier to model our data, our classifier had precision of 81%.</p><h4>Topic Modeling</h4><p>Topic modeling is an unsupervised machine learning technique that’s capable of scanning a set of documents, detecting word and phrase patterns within them, and automatically clustering word groups and similar expressions that best characterize a set of documents.</p><p>We used genism library to do topic modeling for this project.</p><h4>TL;DR</h4><ol><li>Using the keyword “Economy” extract tweets from twitter to use as a data frame.</li><li>Clean the data frame and extract the columns needed for the analysis process.</li><li>Perform more cleaning on the columns extracted from step 2.</li><li>Conduct the sentimental analysis.</li><li>Determine the nature of polarity/subjectivity and study their correlation.</li><li>Determine the nature of tweets for the top 50 authors.</li><li>Determine the nature of frequent retweets</li></ol><ul><li><em>Tools used for this project are: python, Jupiter notebook, and libraries pandas, wordcloud, plotly, numpy.</em></li><li><em>Source code for this project can be found at </em><a href="https://github.com/nardoshood/Twitter-Data-Analysis"><em>github</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=562e4c48d492" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>