<?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 Nken Allassan on Medium]]></title>
        <description><![CDATA[Stories by Nken Allassan on Medium]]></description>
        <link>https://medium.com/@tchangmenaa?source=rss-1fba06c54fee------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Bk-jY1w8PlCBlIMo_yoTew.jpeg</url>
            <title>Stories by Nken Allassan on Medium</title>
            <link>https://medium.com/@tchangmenaa?source=rss-1fba06c54fee------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 06:27:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tchangmenaa/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[Steps to approach a Machine Learning Project]]></title>
            <link>https://tchangmenaa.medium.com/steps-to-approach-a-machine-learning-project-a62ed9e76708?source=rss-1fba06c54fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/a62ed9e76708</guid>
            <category><![CDATA[feature-engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Nken Allassan]]></dc:creator>
            <pubDate>Thu, 09 Sep 2021 16:11:45 GMT</pubDate>
            <atom:updated>2021-09-09T16:11:45.890Z</atom:updated>
            <content:encoded><![CDATA[<p>Starting a Machine Learning (ML) project from scratch is not easy especially when you’re a newbie. From my own experience here is a post about the different steps to build and kick-start such projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3R-peId5o5ENAMPu-58fVg.jpeg" /><figcaption><a href="https://images.search.yahoo.com/search/images;_ylt=AwrJ61sJCTphvLcAwCdXNyoA;_ylu=Y29sbwNiZjEEcG9zAzEEdnRpZAMEc2VjA3BpdnM-?p=starting+a+machine+learning+project&amp;fr2=piv-web&amp;fr=yhs-invalid#id=30&amp;iurl=https%3A%2F%2Fi.ytimg.com%2Fvi%2F_01atWHq0qA%2Fmaxresdefault.jpg&amp;action=click">got it here</a></figcaption></figure><p>The idea of this post came from my friend Genelva, which I will like to thanks for asking me how can we start a ML project, <strong>considering a data set you have in your possesion. </strong>Well, here was my answer 😉 :</p><h4>The Origin and nature of the data</h4><p>Knowing where the data comes from could be a source of valuable insights to your ML model as it can give information on how the data has been splitted. Generally, raw data are splitted into 3 sets, <strong><em>training validation and testing set</em></strong>, considering that the validation set is obtained from the training set. The splitting of the training and testing data is not usually random, and most of the time follows the same distributions (even if it is not the case, the idea is to identify which distribution both the train and test set follows) this information can help you think about which patterns the two sets of data points follow. Moreover the nature of the data could help you choose a suitable model for the training (example time series data suit well with recurrent neural networks 😊)</p><h4>Exploratory data Analysis (EDA) and data preprocessing</h4><p>Most of the time physical phenomenom generate data which follows a normal distribution. The trick is that most of these data are collected either by humans or machines which can bring out sources of errors called <strong>outliers. </strong>Outliers are set of values which do not follow the same distribution or rules like normal values. EDA can help you identify this data points easily as they may affect your ML model in a bad way. But it is important to note that, outliers can also give some extra information to your model (for example a drastic drop of the temperature of an area could be as a result of a change in seasonality, not necessarily a wrong value). EDA can also help you identify<a href="https://corporatefinanceinstitute.com/resources/knowledge/other/skewness/"> skewness</a> in the data which generally need to be normalized or standardized, usally done during the <strong>data preprocessing</strong> stage. Dealing with large values in ML can cause<a href="https://us.search.yahoo.com/search?fr=yhs-invalid&amp;p=overfitting"> overfitting</a> of your model. The reason been that, higher valued variables are much more prioritized than lower ones. To overcome this problem, it is important to draw back these values to a range suitable for training (generally between 0 and 1).</p><h4>Feature Engineering</h4><p>I like this part 😍. For me feature engineering is an art, the art of creating new and explicit features from already existing ones. Unfortunately this is where most data scientist give up! because it is time consuming and require alot of reflexion and intuition testing (a data scientist should be patient…generally I eat biscuit and drink milk when i enter into this critical thinking stage 😂😂). However it is worthy to do it !! since it boost the performance of your model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*wmoIGRKnGvjQ5XeZwpHO1Q.gif" /><figcaption><a href="https://images.search.yahoo.com/search/images;_ylt=AwrE1xlYJzphy5UATwVXNyoA;_ylu=Y29sbwNiZjEEcG9zAzEEdnRpZAMEc2VjA3BpdnM-?p=just+be+patient+gif&amp;fr2=piv-web&amp;fr=yhs-invalid#id=0&amp;iurl=https%3A%2F%2Fmedia1.tenor.com%2Fimages%2Fc26a081912a71af8d0e57799c291ced5%2Ftenor.gif%3Fitemid%3D8524221&amp;action=click">Just wait stay patient</a></figcaption></figure><h4>Model Selection and Validation Strategy</h4><p>Now you can select your model, this is the right time to do it. Generally most of us decide to choose a ML model before any analysis thinking that the best model will always win ….Nope! this is wrong (but as I said in the first point the nature of the data can give you an idea of which model to choose) . Talking of the validation strategy, your model should be able to fit well with unseen data, this is useful for the deployment phase of your project. Depending of the latter, I can mention K-Fold cross validation and Stratify fold validation. The efficiency of ML models are improved using this approaches in most cases.</p><p>Yeah! now that you have this general overview of concept, a baseline project can be easily developed using these steps.</p><blockquote>Just like my Prof use to say, ML is not magic , it’s just making use of a set of numbers which you need to torture to get information from and provide valuable answers to different questions.</blockquote><p>See you for the next post 😁😁</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a62ed9e76708" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Face detection using the Haar Cascade Classifier]]></title>
            <link>https://tchangmenaa.medium.com/face-detection-using-the-haar-cascade-classifier-3057f57b3295?source=rss-1fba06c54fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/3057f57b3295</guid>
            <category><![CDATA[facedetection]]></category>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[viola-jones]]></category>
            <dc:creator><![CDATA[Nken Allassan]]></dc:creator>
            <pubDate>Mon, 15 Feb 2021 15:25:25 GMT</pubDate>
            <atom:updated>2021-02-15T15:25:25.879Z</atom:updated>
            <content:encoded><![CDATA[<p>A step-back in Level 3 at the National Advance school of Engineering Douala, where i built my first facial recognition system using the concept of Principal component Analysis(PCA) more precisely the viola-jones Algorithm. Today i’m introducing one of the most common <strong><em>“Hello world”</em></strong> project in computer vision: <strong>Face detection</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tdz9Pm3pTT75ix1yZDCSLg.png" /><figcaption>family smiling faces</figcaption></figure><h3>What is computer Vision?</h3><p>Computer vision is a field of study which deals with how computer see and understand digital images and videos.</p><p>Computer vision involves seeing or sensing a visual stimulus, make sense of what it has seen and also extract complex information that could be used for other machine learning activities.</p><h3>Application of Computer Vision?</h3><p>Ofcourse as mentioned on this post one of the application of computer vision is face detection, in a global way <strong>object detection</strong>. Another application is more specific and commonly used in industries as<strong> facial recognition</strong> systems (will work on it for the next post 😎). In domain of Automobile industries i’m sure you’ve already heard about self driving cars,🤔 which also uses the notion of computer vision (no magic here! 😜).</p><p>The commonly used open source library for computer vision is <a href="https://opencv.org/">opencv</a> which contains several hundreds of computer vision algorithm.</p><h3>Getting back to Haar Cascade Classifiers!</h3><p>Haar Cascade classifier is an effective object detection approach which was proposed by Paul Viola and Michael Jones in their paper, “Rapid Object Detection using a Boosted Cascade of Simple Features” in 2001.</p><p>This is basically a machine learning based approach where a cascade function is trained from a lot of images both positive and negative. Based on the training it is then used to detect the objects in the other images.</p><p>The algorithm is based on simple small filters to detect edges (features)on object(images ) we then concatenate the features in the form of Cascade hence the name <strong>Cascade Classifiers.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*4dGt73J4-aLBbk3c09_y2A.jpeg" /><figcaption><a href="https://medium.com/datadriveninvestor/haar-cascade-classifiers-237c9193746b">link to picture</a></figcaption></figure><p>As seen on the picture below the feature extraction are done in stages with each stage made up of set of filters (haar-filters).</p><p>The informations are then stored in large individual .xml files with a lot of feature sets and each xml corresponds to a very specific type of use case (face detection, eye-glasses detection etc…)</p><h3>Coding time…</h3><p>Without talking too much, let’s start coding 🙂....</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*xlBm1rTR6Xjg_IiFXalKsw.png" /><figcaption>the code</figcaption></figure><p>The image above actually presents a bunch of code for our task (face detection).</p><p>So in our case we are working with the“haarcascade_frontalface_default.xml” file(line 14). But before that we need to load frames of images captured by our camera the frame compile together form the video (remember videos are just a compilation of many images(line 10)). Each image is converted into greyscale for it to better fit with the classifier (line 20). The classifier then do the job by detecting all faces found in the image (line 22), draw rectangles on it (line 24–25) and release the entire images in the form of a video (line 27). As simple as that, without entring that much into the mathematical aspect of this concept (Remember it is a hello not goodbye world 😂). The code can be accessed through my <a href="https://github.com/matzolla/Face-detection-/blob/main/aims.py">github link</a>.</p><p>Many post and advanced concept of computer vision coming soon. stay tuned</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3057f57b3295" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[La plateforme ZINDI]]></title>
            <link>https://tchangmenaa.medium.com/la-plateforme-zindi-371d2b145434?source=rss-1fba06c54fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/371d2b145434</guid>
            <category><![CDATA[zindi-africa]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Nken Allassan]]></dc:creator>
            <pubDate>Thu, 20 Aug 2020 07:30:23 GMT</pubDate>
            <atom:updated>2020-08-20T07:30:23.388Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>“In zindi we either win or learn, we never loose” </strong>C’est l’une des meilleures choses que j’ai apprise sur cette plateforme. Aujourd’hui je vous parle du monde de Zindi</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-YI9gHLV3P8m05OH655Pgw.jpeg" /><figcaption>le monde incroyable de zindi</figcaption></figure><p>Fondé en 2018 par<strong> Celina Lee </strong>une coach de carrier et animatrice du podcast <strong><em>“live your dream” ,</em></strong>Zindi est la première plateforme de concours de science des données en Afrique. La plateforme héberge tout un écosystème de science des données composé de scientifiques, d’ingénieurs, d’universitaires, d’entreprises, d’ONG, de gouvernements et d’institutions axés sur la résolution des problèmes les plus urgents de l’Afrique. Elle travaille avec des entreprises, des organisations à but non lucratif et des institutions gouvernementales pour développer, organiser et préparer des défis basés sur les données. Les solutions sont classées automatiquement en fonction de la précision obtenue. Que vous testiez les eaux de la science des données pour la première fois ou que vous essayiez de résoudre un problème commercial persistant avec les données, Zindi aide les organisations à repousser leurs limites créatives à un coût abordable.</p><p>Et oui!! 😎😎nous avons notre propre <strong><em>kaggle </em></strong>africain il suffit juste de faire un tour via se <a href="https://zindi.africa/">lien</a></p><h3>Comment ça marche ?</h3><p>lorsque vous parcourez pour la première fois cette plateforme vous devez tout d’abord vous créer un compte dans lequel vous allez entrer des informations propre à vous même comme dans l’image qui suit :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*zuZU29xJr0cTZ3GHUdp1cA.png" /><figcaption>my profile</figcaption></figure><p>comme vous pouvez le voir ,chacun a un pseudo (le mien <strong><em>outlier</em></strong> ). Ceci étant fait, vous êtes <strong>set</strong> pour une première compétition 🥳🥳🥳. Très souvent il est difficile de savoir par quelle compétition commencé dès notre première entrer sur la plateforme. il est conseiller par des compétitions d’entrainement dénommer <strong>KNOWLEDGE</strong>, pour les débutant (les plus coriaces peuvent se lancer directement…😎).</p><p>Sur la page d’accueil, cliquer sur <strong>competition </strong>vous pouvez ensuite cliquer sur la competition de votre choix</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1jPg_qkp3GEP_oPeWipAlQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4rmLGYQfgLy2b8jmJ3Pnaw.png" /></figure><p>chaque compétition a un intitule, un délai et une catégorie selon que vous faite du deeplearning, machine learning, reinforecement learning…. vous avez aussi remarquer certaines compétitons sont rémunérer 😀😀 pas mal comme motivation non !</p><p>Par la suite, lorsque vous cliquez sur une d’entre elles, vous ouvrez une autre page semblable à celle ci-dessous:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xbvdJ0BmPUbfeAxlB_H7LA.png" /></figure><ul><li><strong>Leaderboard</strong>: c’est le panneaux de classement des participant à la compétion il varie lors de la compétition jusqu’à la date limite de compet</li><li><strong>Data:</strong> les données indispensable pour concourir généralement sous formes csv(comma seperated values) télechargable une fois que vous avez accepter de compétir (<strong>join compétition</strong>)</li><li><strong>evaluation</strong>: la métrique d’évaluation du modèle que vous allez utilisez</li><li><strong>prizes</strong>: les différents prix allouer aux 3 premiers de la compet</li></ul><p>il est très important de noter que lorsque vous accepter de participer à l’une d’entre elle, vous pouvez désormais soumettre vos modèle via le boutton <strong><em>submission</em></strong> ,pour une éventuelle évaluation et un classement immédiat bien évidement</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rOMZS1Olnd3OZVWEj5NiRw.png" /></figure><p>Et voilà on à fait le tour et à présent vous êtes ready pour apprendre et compétir alors <strong><em>go Zindians !</em></strong><em>!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=371d2b145434" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[L’intelligence artificielle et la médecine]]></title>
            <link>https://tchangmenaa.medium.com/lintelligence-artificielle-et-la-m%C3%A9decine-1abf81b5438c?source=rss-1fba06c54fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/1abf81b5438c</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[medicine]]></category>
            <dc:creator><![CDATA[Nken Allassan]]></dc:creator>
            <pubDate>Fri, 29 May 2020 19:46:57 GMT</pubDate>
            <atom:updated>2020-05-29T19:46:57.209Z</atom:updated>
            <content:encoded><![CDATA[<p>A la base, j’ai voulu être un médecin, mais DIEU en a décidé autrement. Depuis le début de mon cursus académique au secondaire, je rêvais d’entrer dans le corps médical.Galvaniser par des series telles que <strong><em>“Greys Anatomy”,”Doctor House”</em></strong> et bien d’autres, je me voyais être le meilleur médecin de tous les temps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*9LaFNr5-KYLdSe1wRdPp4Q.jpeg" /><figcaption>l’élite de la médecine :)</figcaption></figure><p>A cette époque, j’ai présenté deux concours: celui de médecine et celui de l’ingenieurie oui comme tout jeune, j’étais ambitieux ! 😎Le concours d’ingenieurie m’a été favorable par la grâce de Dieu , j’ai alors décidé de choisir la filière robotique.Pourquoi? parceque pour moi je voulais faire une spécialité qui me semblait être très difficile…😁 “les systèmes intélligents” ,qui avaient un rapport direct avec l’intelligence artificielle. L’intelligence artificielle (IA) est très vite devenue une passion pour moi; l’ambition de créer des machines capable de mimer l’intelligence humaine a commencé à se développer en moi (c’est vrai je ne l’ai pas encore conçues mais un jour j’y arriverais!💪💪). L’IA cherche à produire des machines dotées de capacités de compréhension, de perception et parfois de décision à même de simplifier, voire de remplacer l’intervention humaine.</p><p>Je me suis alors posé cette question : est-ce possible de relier l’intelligence artificielle à la médecine? Google m’a très vite repondu…oui! c’est bien possible. Dans le monde de la médecine, l’IA est cantonnée dans le diagnostic et les recommandations pour des raisons évidentes. Contrairement aux applications médicales basées sur des méthodes de programmation exclusivement statistiques et probabilistes, les programmes d’IA médicale sont basés sur des modèles symboliques pour chaque maladie sur le rapport entre ces données et les signes cliniques que présentent les patients.</p><p>Déployée dans la sphère médicale, l’intélligence artificielle présente de multiples avantages:</p><p><em>Moins d’erreur: grâce à sa précision, l’intégration de l’intelligence artificielle présente le principal avantage de réduire les risques d’erreur. L’assistance d’IBM WATSON peut par exemple analyser toutes les données du patient comme les symptômes, les consultations médicales,les antécedents familiaux et bien d’autres.En outre, il peut échanger avec l’humain une discussion collaborative afin de l’accompagner dans une prise de décision.</em></p><p><em>Un parfait outil en oncologie(cancérologie): grâce à son immense capacité à compiler une masse gigantèsque de données, à comparer des images radiologiques avec des millions d’autres et à émmettre des hypothèses diagnostiques et thérapeutiques pertinentes</em></p><p><em>Des outils infatiguables: contrairement aux humains, les machines ne nécessitent pas de pauses fréquentes ni de rafraichissement! Elles sont programmées pour de longues heures peuvent fonctionner de facon continue.</em></p><p>Plusieurs applications existent en ce jour. L’application de l’IA dans le domaine médical est vraiment très diverse et très vaste, partant des assistances médicales telles que YOUR.MD, aux puissants algorithmes de création des antidotes de virus.</p><p>C’est alors là que je me suis rendu compte de l’immense possibilité que DIEU m’a offerte. En effet, il est encore possible pour moi de travailler comme un médecin mais grâce à de l’intelligence artificielle. Pour cette fin je dirais que l’IA est une possibilité pour une amélioration des performances dans le domaine médical. Une attention doit être apportée à ce domaine qui est un alliage des mathématiques, les statistiques ainsi que l’informatique, pour être des “good doctors” 👨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1abf81b5438c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple Statistics From Stock Data]]></title>
            <link>https://tchangmenaa.medium.com/simple-statistics-from-stock-data-f89ea5a81de3?source=rss-1fba06c54fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/f89ea5a81de3</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[stock-data]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Nken Allassan]]></dc:creator>
            <pubDate>Mon, 16 Mar 2020 20:53:16 GMT</pubDate>
            <atom:updated>2020-03-16T20:53:16.474Z</atom:updated>
            <content:encoded><![CDATA[<p>Giants of technology such as GOOGLE, APPLE or AMAZON have large scale data about stocks. This data reveals useful informations which could improve revenue of industries.For example the informations could be:<strong><em>”how do the demand for umbrellas affects its price during the raining season”</em></strong>Inorder to extract useful insights from this data, we need to do some statistical analysis. This starts with simple knowledge of statistics.</p><p>In this brief post we will try to describe basic statistics of stocks from amazon,apple and google,downloaded from yahoo finance in a <strong><em>csv </em></strong>format (comma seperated values) we will be using the <a href="https://pandas.pydata.org/docs/"><strong>Pandas</strong></a> package build untop of <a href="https://numpy.org/"><strong>numpy</strong></a> package, to best deal with our data.</p><p><em>here we go lets get started</em> 😊😊.…!</p><p>firstly we start by importing the pandas package inorder to load our data as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*2wGU9b5xSl7nFN16cpuGwQ.png" /><figcaption>loading the google dataset as shown above</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*_9GeYj4vvrBZgYmnQpohcA.png" /><figcaption>5 first columns from the google dataset</figcaption></figure><p>We clearly see that the Dataframe has automatically labeled the row indices using integers and has labeled the columns of the DataFrame using the names of the columns in the CSV files.Thesame way we load up the data from the order datasets<strong><em>(from the apple and amazon dataset) </em></strong>but in our case, we will<strong><em> </em></strong>do some studies on the <strong><em>date</em></strong> and the <strong><em>Adj close(the adj close represents the adjusted closing price for a stock before the closing of the market)</em></strong>columns</p><h4>what to do?</h4><p>inorder to do some stats about those columns, we start by creating an empty dataframe with index dates from year <strong><em>2000–01–01 </em></strong>to year <strong><em>2016–12–31</em></strong> in which we join the different adj close’s columns from the different stocks. Lets do that :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*_NguKBUOWBylF91wAsF4aQ.png" /><figcaption>1) loading the data from the different stocks only the dates and the Adj Close</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*evisk5ujNgOWfZfRW2srog.png" /><figcaption>2) creating our empty dataframe containing only as index the dates</figcaption></figure><p>next we join all the three columns, check it out 😉...</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*imj4Fj5xldUQkM3w-Bya9w.png" /><figcaption>3)joining the different columns</figcaption></figure><p>know that they are all bounded together, we can do some simple statistics such as calculating the mean and the spread of the different stocks values.We can also calculate the correlation as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*MOJbOJJ1uuC-Ld7ZlnaOuQ.png" /></figure><ul><li>The mean in this case represents the average value of the stocks for the entire years for example the average value of adj close of Google is approximately <strong><em>347.42</em></strong></li><li>The standard deviation determines the measure of spread of our data (the variation of our data).In our case we are calculating its variation against time(Date).For the google stock the standard deviation is <strong><em>187.67 </em></strong>this implies a very high variation of the values</li><li>the correlation between the stocks can also be determine it represents the relationship between each columns in the frame. The higher its value the higher the relationship is.If the correlation is positive,we talk of a positive relationship if the correlation is negative we talk of a negative relationship</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*IJru96MerdgUoE4Vy8uJMw.png" /><figcaption>correlation between each stock</figcaption></figure><p>Finally we can decide to plot the stock data against the different dates to see its variation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*6Ah7vO9GpZIg2McwBsinSQ.png" /></figure><p>the graph shows the variation of the google stock data’s adj close column with the year. It is obvious that it looks like a <strong><em>time series data</em></strong> as the adjusted close price value<strong><em> </em></strong>, changes<strong><em> strongly </em></strong>with time we can further gets insights from this column though.But the post is just to give a brief introduction to descriptive statistics from our data.</p><p>the main post was inspired from the udacity tutorial lab and the entire code can be found in<a href="https://github.com/matzolla/stark/blob/master/Statistics%20from%20Stock%20Data.ipynb"><strong><em> my github repository</em></strong></a><strong><em>.</em></strong> Thanks for the attention and stay<strong><em> </em></strong>tuned for the next post 😎😎</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f89ea5a81de3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple Linear regression model]]></title>
            <link>https://tchangmenaa.medium.com/simple-linear-regression-model-635714e913d3?source=rss-1fba06c54fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/635714e913d3</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Nken Allassan]]></dc:creator>
            <pubDate>Fri, 08 Nov 2019 21:40:42 GMT</pubDate>
            <atom:updated>2019-11-08T21:40:42.011Z</atom:updated>
            <content:encoded><![CDATA[<h3>Simple linear regression model</h3><p>artificial intelligence has been an ever growing land field in the world as well as in Africa. The particular case of linear regression is the “hello world” of the domain, a simple based algorithm which can solve many encountered problems such as:</p><ul><li><em>Predict whether a tumor is malignant or benign, in real-estate domain, weather predictions, and so on..lets dive into the issue</em> :)</li></ul><p>firstly we need to know what is regression. <strong>regression</strong> is simply modeling an output(target) in function of independent inputs called <strong>predictors. </strong>In the<strong> </strong>case of<strong> simple linear regression, we only have one independent variable (x) and a dependent variable (y).</strong></p><p>we only talk of linear regression when we have a straight line which best fit the distribution of our data as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*8JVWIepbrwXMxBeufRiOnA.png" /><figcaption><a href="https://www.google.com/search?q=regression&amp;sxsrf=ACYBGNQUQbpNgYF5K5KZYdz2CRhZ2rzChQ:1572892050532&amp;tbm=isch&amp;source=iu&amp;ictx=1&amp;fir=p0EVBEYkS5O-8M%253A%252CVrLTniJD4shEpM%252C%252Fm%252F03f9cn&amp;vet=1&amp;usg=AI4_-kS_zIUSuib81ZfJkHkkUWQmOxs2TQ&amp;sa=X&amp;ved=2ahUKEwiAmMS_l9HlAhXhDWMBHflDBCwQ_B0wHHoECAMQAw#imgrc=M20iHS1DcKJNkM:&amp;vet=1"><strong>linear model</strong></a></figcaption></figure><p>The general equation of a simple linear model is:</p><p><strong><em>Y=aX + b</em></strong></p><p>The objective is to<strong> find the values of a and b which best fits our data</strong> , these variables are some <a href="http://pavelbazin.com/post/linear-regression-hyperparameters/"><strong><em>hyperparameters</em></strong></a> of our model. before diving into the algorithm, lets look at some basic concepts:</p><h4>Lost function:</h4><p>Our linear model predict a target known as y_pred the lost function is the <strong>square difference</strong> between the predicted value,<strong><em> y_predict</em></strong><em> </em>and the real value <strong><em>y_truth</em></strong><em> </em>of a training example , mathematically we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*l5hIG4xd76gXfqgY_rndYg.png" /></figure><p>with <strong>y_pred=<em>aX + b</em></strong></p><h4>Cost function:</h4><p>For the entire training set we calculate the cost function as :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*gxhSS_9HujG1lHOybHCL1w.png" /></figure><p>also known as the mean square error function <a href="https://www.oreilly.com/library/view/machine-learning-with/9781785889936/669125cc-ce5c-4507-a28e-065ebfda8f86.xhtml">(MSE)</a> . Inorder to get the best line which fits the most our data we convert the cost function into a minimisation problem:</p><p><strong>determine the values of a and b for which<em> j(a,b) is a minimum.</em></strong> Using the MSE, we are going to update the values of a and b.Lets look at how to update the hyperparameters:</p><h4><strong>Gradient descent:</strong></h4><p>The main idea is to randomly pick up the hyper-parameters a and b and then try to update it insuch a way as to reduce the cost function to its minima.As an anology to gradient descent, consider a man moving down a slope such as to reach its minima. If the man makes small steps, it is obvious that the man will reach down the slope <em>it will just take much more time to get there!. </em>If on the other hand, if the man makes much larger steps, he will probably miss the bottom. So it is important to have an apropriate step rate this step is called the <strong>learning rate</strong> , and it define how fast the algorithm converges to it minima</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*lYpF8xJ3TiDoq461I0AcOQ.jpeg" /><figcaption><a href="https://www.google.com/search?q=gradient+descent+machine+learning&amp;sxsrf=ACYBGNSd_ioW5j6QE1dKTxSG-9TelRNpYA:1572901557813&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;ved=0ahUKEwiz0Pr0utHlAhWOlhQKHQfTBxwQ_AUIEygC#imgrc=KkiA0RikIR-SIM:">gradient descent curve</a></figcaption></figure><p>the question now is how to <strong>calculate the different updates?</strong></p><p>Short and simple :) we simply substract the derivative of the cost function with respect to each of the hyper-parameters to their respective initial values.Mathematically, we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*IA0f--LgFRLx5s9r0h2T1g.png" /></figure><p>we can therefore update the variables as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/202/1*--B8-A61j9NfedWYk8L39g.png" /></figure><p>The partial derivatives are the gradients and they are used to update a and b. Alpha is the <strong><em>learning rate</em></strong> which is a hyper-parameter that you must specify.So aplha has to be tuned to let the cost function to reach its minimum with a learning rate not too small nor too large. So that’s it for the theorie, let’s go directly into practice</p><h4>coding time</h4><p>We will build one model from scratch by simply using <a href="http://cs231n.github.io/python-numpy-tutorial/"><strong><em>numpy</em></strong></a> ,in our<a href="https://jupyter.org/"><strong><em> jupyter notebook</em></strong></a></p><p>we are going to determine the best hyper-parameters which fits the most our linear regression model</p><h4>the simple linear regressionfunction:</h4><p>we’re going to build one from scratch and update our parameters</p><p>the function takes as input the data , the learning rate, the number of <strong>epoch , and the initial values of the parameters ( as a=0, b=0) in our case:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*tN1CDacuctOIJcM6lMbmtQ.png" /><figcaption>our linear regression function</figcaption></figure><p>it helps us determine the cost function using the mean square error, and also the parameters a ,b, now if we use the sckitlearn python library for a basic simple linear regression model</p><ul><li>we start by importing the libraries and the dataset, and drop empty training examples</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*jMmZRD-mpyv8cTI9VoFq_w.png" /></figure><ul><li>next we try to visualize the data</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*Wn47VQ5Y60xXGg0fB0gYmA.png" /></figure><ul><li>we get the data visualization above , now lets observe the relationship between the data that is the x and y components of the training example</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*rupZuxCVhTp32hEJQScBQw.png" /></figure><ul><li>the graph below shows how correlated the values are</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*LYCM4L0riDyLBnWTVn07vA.png" /></figure><ul><li>we then build our linear regression model using the linear regression function in scikit learn</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*rkwAK5x7wiftYSukyiLGcA.png" /></figure><ul><li>we then determine the accuracy of our model by simply testing it with the test data</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*Ej1Zcp8bYcuuU0q20zgSaw.png" /></figure><ul><li>our model predict values with an <strong><em>98.88% </em></strong>accuracy, pretty good huh !</li><li>So that was a small tutorial for newbies in the domain and want to embrace the world of machine learning i hope it was intresting, stay tuned for more tips</li></ul><p>useful links</p><ul><li><a href="https://www.kaggle.com/ashteotia/simple-linear-regression/data">Simple Linear Regression</a></li><li><a href="https://towardsdatascience.com/@grohith327">Rohith Gandhi - Towards Data Science</a></li></ul><p><a href="https://www.google.com/search?q=kaggle+data+set+for+simple+linear+regression+with+train+and+test+set&amp;oq=ka&amp;aqs=chrome.0.69i59l2j69i60l4.3163j0j7&amp;sourceid=chrome&amp;ie=UTF-8">https://www.google.com/search?q=kaggle+data+set+for+simple+linear+regression+with+train+and+test+set&amp;oq=ka&amp;aqs=chrome.0.69i59l2j69i60l4.3163j0j7&amp;sourceid=chrome&amp;ie=UTF-8</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=635714e913d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>