<?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 Adakole Emmanuel Audu on Medium]]></title>
        <description><![CDATA[Stories by Adakole Emmanuel Audu on Medium]]></description>
        <link>https://medium.com/@kole-audu?source=rss-e501190a4207------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GvdaW79QEwwKZ5JYShwJeg@2x.jpeg</url>
            <title>Stories by Adakole Emmanuel Audu on Medium</title>
            <link>https://medium.com/@kole-audu?source=rss-e501190a4207------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 21:25:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kole-audu/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[How To Master Your Emotions]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://kole-audu.medium.com/how-to-master-your-emotions-d6fb1f9a3cde?source=rss-e501190a4207------2"><img src="https://cdn-images-1.medium.com/max/1024/1*0NLsTXhYmlWcpS2ZlSuoYw.png" width="1024"></a></p><p class="medium-feed-snippet">Introduction: The Purpose Behind Negative Emotions</p><p class="medium-feed-link"><a href="https://kole-audu.medium.com/how-to-master-your-emotions-d6fb1f9a3cde?source=rss-e501190a4207------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://kole-audu.medium.com/how-to-master-your-emotions-d6fb1f9a3cde?source=rss-e501190a4207------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6fb1f9a3cde</guid>
            <category><![CDATA[emotions]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[emotional-intelligence]]></category>
            <dc:creator><![CDATA[Adakole Emmanuel Audu]]></dc:creator>
            <pubDate>Mon, 25 Dec 2023 18:07:47 GMT</pubDate>
            <atom:updated>2023-12-25T18:07:47.863Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Using Amazon Lambda function with Amazon Lex to create a chatbot]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://kole-audu.medium.com/using-amazon-lambda-function-with-amazon-lex-to-create-a-chatbot-f0f8975fc8bb?source=rss-e501190a4207------2"><img src="https://cdn-images-1.medium.com/max/900/0*4n_KKIwSweGCn6iL.png" width="900"></a></p><p class="medium-feed-snippet">Amazon Lex is a managed artificial intelligence service with advanced natural language processing models for building conversational&#x2026;</p><p class="medium-feed-link"><a href="https://kole-audu.medium.com/using-amazon-lambda-function-with-amazon-lex-to-create-a-chatbot-f0f8975fc8bb?source=rss-e501190a4207------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://kole-audu.medium.com/using-amazon-lambda-function-with-amazon-lex-to-create-a-chatbot-f0f8975fc8bb?source=rss-e501190a4207------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0f8975fc8bb</guid>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Adakole Emmanuel Audu]]></dc:creator>
            <pubDate>Fri, 25 Mar 2022 10:45:27 GMT</pubDate>
            <atom:updated>2022-03-25T10:45:27.004Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Build an OCR App with Django]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://kole-audu.medium.com/build-an-ocr-app-with-django-2637f7c969c?source=rss-e501190a4207------2"><img src="https://cdn-images-1.medium.com/max/1200/0*sUoJ-qZtIbyJk2E-.jpeg" width="1200"></a></p><p class="medium-feed-snippet">Object Character Recognition (OCR) is the process of extracting data from a scanned document or an image file and converting it to&#x2026;</p><p class="medium-feed-link"><a href="https://kole-audu.medium.com/build-an-ocr-app-with-django-2637f7c969c?source=rss-e501190a4207------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://kole-audu.medium.com/build-an-ocr-app-with-django-2637f7c969c?source=rss-e501190a4207------2</link>
            <guid isPermaLink="false">https://medium.com/p/2637f7c969c</guid>
            <category><![CDATA[ocr-tesseract]]></category>
            <category><![CDATA[ocr]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[django]]></category>
            <dc:creator><![CDATA[Adakole Emmanuel Audu]]></dc:creator>
            <pubDate>Fri, 11 Mar 2022 12:22:23 GMT</pubDate>
            <atom:updated>2022-03-11T12:22:23.978Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Gatsby with Cockpit Headless CMS]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://kole-audu.medium.com/gatsby-with-cockpit-headless-cms-9b20a52f8743?source=rss-e501190a4207------2"><img src="https://cdn-images-1.medium.com/max/762/1*YK_dBIA7EZ1RnbQCKAUluA.png" width="762"></a></p><p class="medium-feed-snippet">Headless CMS is a concept and tool that has been around for some time now, since about 2018. It makes life really easy for developers and&#x2026;</p><p class="medium-feed-link"><a href="https://kole-audu.medium.com/gatsby-with-cockpit-headless-cms-9b20a52f8743?source=rss-e501190a4207------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://kole-audu.medium.com/gatsby-with-cockpit-headless-cms-9b20a52f8743?source=rss-e501190a4207------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b20a52f8743</guid>
            <category><![CDATA[blog-development]]></category>
            <category><![CDATA[gatsbyjs]]></category>
            <category><![CDATA[cockpit-headless-cms]]></category>
            <category><![CDATA[headless-cms]]></category>
            <dc:creator><![CDATA[Adakole Emmanuel Audu]]></dc:creator>
            <pubDate>Tue, 07 Sep 2021 08:25:56 GMT</pubDate>
            <atom:updated>2021-09-08T19:33:19.117Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Transaction Fraud Detection with Classification Models]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/geekculture/transaction-fraud-detection-with-classification-models-e32cf075f13a?source=rss-e501190a4207------2"><img src="https://cdn-images-1.medium.com/max/1920/1*NIyxUbUt5x44tKPBpAcPOg.png" width="1920"></a></p><p class="medium-feed-snippet">INTRODUCTION:</p><p class="medium-feed-link"><a href="https://medium.com/geekculture/transaction-fraud-detection-with-classification-models-e32cf075f13a?source=rss-e501190a4207------2">Continue reading on Geek Culture »</a></p></div>]]></description>
            <link>https://medium.com/geekculture/transaction-fraud-detection-with-classification-models-e32cf075f13a?source=rss-e501190a4207------2</link>
            <guid isPermaLink="false">https://medium.com/p/e32cf075f13a</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[classification-models]]></category>
            <category><![CDATA[fraud-detection]]></category>
            <category><![CDATA[classification-algorithms]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Adakole Emmanuel Audu]]></dc:creator>
            <pubDate>Thu, 19 Aug 2021 10:12:27 GMT</pubDate>
            <atom:updated>2021-08-27T11:01:41.582Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Topic Modelling for Amazon Reviews]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/geekculture/topic-modelling-for-amazon-review-9a06327f105a?source=rss-e501190a4207------2"><img src="https://cdn-images-1.medium.com/max/1962/1*S91p7Qz26X2XpLLiBztG8A.png" width="1962"></a></p><p class="medium-feed-snippet">INTRODUCTION:</p><p class="medium-feed-link"><a href="https://medium.com/geekculture/topic-modelling-for-amazon-review-9a06327f105a?source=rss-e501190a4207------2">Continue reading on Geek Culture »</a></p></div>]]></description>
            <link>https://medium.com/geekculture/topic-modelling-for-amazon-review-9a06327f105a?source=rss-e501190a4207------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a06327f105a</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[topic-modeling]]></category>
            <category><![CDATA[amazon-reviews]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Adakole Emmanuel Audu]]></dc:creator>
            <pubDate>Mon, 09 Aug 2021 18:33:31 GMT</pubDate>
            <atom:updated>2021-08-25T07:32:18.688Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Scraping Google Image Search Result]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/geekculture/scraping-google-image-search-result-dfe01bcbc610?source=rss-e501190a4207------2"><img src="https://cdn-images-1.medium.com/max/1920/1*_r0enwrmbDWR12LZqZBycw.png" width="1920"></a></p><p class="medium-feed-snippet">We may need to create our own image dataset and Google provides a very easy medium for that, but it may prove difficult to scrape at&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/geekculture/scraping-google-image-search-result-dfe01bcbc610?source=rss-e501190a4207------2">Continue reading on Geek Culture »</a></p></div>]]></description>
            <link>https://medium.com/geekculture/scraping-google-image-search-result-dfe01bcbc610?source=rss-e501190a4207------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfe01bcbc610</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[python-coding]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[selenium-webdriver]]></category>
            <dc:creator><![CDATA[Adakole Emmanuel Audu]]></dc:creator>
            <pubDate>Sat, 17 Apr 2021 17:32:29 GMT</pubDate>
            <atom:updated>2021-09-08T14:47:48.006Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Medical Insurance Charge Using Machine Learning]]></title>
            <link>https://medium.com/codex/medical-insurance-charge-using-machine-learning-896719a5cccb?source=rss-e501190a4207------2</link>
            <guid isPermaLink="false">https://medium.com/p/896719a5cccb</guid>
            <category><![CDATA[insurance]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-mining]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Adakole Emmanuel Audu]]></dc:creator>
            <pubDate>Sat, 27 Mar 2021 11:11:25 GMT</pubDate>
            <atom:updated>2021-08-25T01:00:52.209Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Predicting Medical Insurance Charge Using Machine Learning</strong></h3><p><strong>Background:</strong></p><p>As the years have gone by, most people are now aware of the necessity of a medical insurance for themselves and their family. Depending on the medical care, an insurance company collects yearly premiums, but it is very difficult to estimate the medical expenses due to various health conditions of payees and other factors contributing to the payees health.</p><p>Some conditions are, however, more prevalent for certain segments of the population. An example of this is throat cancer which is more likely among smokers than non-smokers, and heart diseases such as cardiomyopathy may be more likely among the obese.</p><p>As a result, insurers invest a great deal of time and money to develop models that accurately predict medical expenses.</p><p><strong>Objectives:</strong></p><p>The objective of this project is as follows:</p><ol><li>To create a regression model to predict the medical expenses of payees for insurance companies</li></ol><p><strong>Dataset: <br></strong>The dataset for this project consists of 7 different columns; age, sex, BMI(body mass index), Children, smokers, region and charges. The table below describes the dataset columns better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*IZhgBij6k3M39LYjeOK_qg.png" /></figure><p><strong>Data Pre-processing: <br></strong>Before we can apply our regression algorithms on our dataset, we first need to pre-process it and make sure it is in a format where our algorithms will produce the best result.</p><p>First we check for null values using the isnull function and sum function as shown in the code snippet below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*j3h033hKjJREW9C_2T7vJQ.png" /></figure><p>Lucky for us, this returns a zero; hence we can start to handle our categorical data.</p><p><strong>Handle Categorical Data with Dummy Data:</strong></p><p>Categorical Data require special actions in linear regression; unlike continuous data they cannot be directly entered into the regression algorithm. There are various ways to handle categorical data; in this situation, we create a function which uses the pandas get_dummies function. It creates a different column for each categorical value i.e. if we use a gender column with only male and female values; it would create a single column like is_male which could either receive a 1 or 0 value.</p><p>The code below describes how we can achieve this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L5R9dERwS_0MX_-h_s0Jig.png" /></figure><p>The handle_cat_data function accepts the categorical features and the entire dataset as parameters. It uses a loop to go through each of these columns in the datasets, using the pandas get_dummies function to convert each value of each respective categorical values to a column i.e. in the case of gender_male or gender_female. It also allows us to pass the drop_first as an argument which tells the get_dummies function to drop the first value i.e. if the value is not a female, in this dataset, it’s definitely a male.</p><p>Now that we have handled our categorical data, it’s time to standardise or normalise our large numerical values.</p><p><strong>Standardize to Handle Large Numerical Values:</strong></p><p>Having large values like age and smaller values like children is a bad idea before regression or classification. This is because the large values would tilt the resulting models and have an unfair effect due to the difference in size; hence it is a good idea to standardise or normalise the values which is basically converting the values to be between 0 and 1 and hence ultimately reducing the difference. We can standardize with the code snippet shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J_Ngp6waoA_dE3bEBYsMKA.png" /></figure><p>Most regression algorithms built into Sci-kit learner have in-built normalisation methods so in most cases we would not need to use the function shown above.</p><p><strong>Randomly Split The Dataset into 80% Training &amp; 20% Testing Data:</strong></p><p>In order to avoid overfitting or to make a model that’s always a 100% accurate, it’s necessary to split our dataset into training and testing data where we use the training dataset to train our model and then we use the testing dataset to test the accuracy of our model. The code snippet below shows how it’s done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i5Ogx2NCMGIUZVW2m03Zxg.png" /></figure><p>In the code snippet above we select all the other columns except the label column and pass them to the X dataset and then pass only the label to the Y dataset. Afterwards we hot encode our datasets to further handle the categorical data. We Hot encode so our classifier doesn’t mistake our dummy data to be numerical where when it the &gt; and &lt; or = don’t apply to them. Afterwards we use the Pandas train_test_split function to split our dataset into 80% training and 20% testing.</p><p><strong>Apply Regression Algorithms:</strong></p><p>Here we create a function that runs the different algorithms and outputs the results for each with the option of saving the model or retrieving a saved model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HW5rmJxiwdVS1OLPXYI_yw.png" /></figure><p>The custom run_reg_model function takes an array of estimators and estimator names as shown above. It also takes the dataset and a value if to save or not and the index of the estimator to change. It fits each model and outputs its results and then visualizes the result, comparing both the test result and the predicted results in a grouped bar chart.</p><p><strong>Results:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8y3Q638VMwmY1Oi9uDKdGQ.png" /></figure><p>The most interesting thing to notice from the regression is how our training dataset gives a slightly lower accuracy score than our testing dataset. This is strange as we would expect the dataset used for training to be more accurate than that used for testing. I’m guessing it’s as a result of the training dataset being larger hence the reason for more errors. If both were of the same size, it would give the accuracy and error rate.</p><p>The difference in performance for the different estimators wasn’t much with both linear regression, ridge regression and lasso regression giving the same accuracy rate of 76% and elastic net regression and the orthogonal matching pursuit CV gave different results. The Elastic Net Regression gave the lowest result. It’s interesting because tuning the hyper parameters for Elastic Net Regression, if I normalized the dataset; it even reduced the performance more to about 0.02 accuracy rate. Tuning the Hyperparameters for the linear and ridge regression made little or no difference.</p><p>Something else that was interesting is that feature selection makes no significant positive difference to the performance of our estimators; I tested this with the RFE feature selection method and with all the selected estimators. The next phase is to visualize the results of our estimators with the testing data.</p><p><strong>Visualise Models with Training &amp; Testing Data:</strong></p><p>The custom made function run_reg_models already calls the visualize function after it’s done with the estimation. The code snippet below shows how the visualise function works:</p><p>The code snippet below describes how we visualise the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHC3OXzTf3lSBTWf30h0Qg.png" /></figure><p>The histogram plots below describe the differences in performance for all the resulting models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rl-CtJd_uLDOjanGccqIzA.png" /></figure><p><strong>Conclusion on Selected Estimator:</strong></p><p>My final selected estimator is the linear regression which is the simplest amongst all the other estimators. It involves finding the correlation and the best line that fits the correlation between attributes. I choose this at it produced the highest score, along with the ridge regression for the investigation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=896719a5cccb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/medical-insurance-charge-using-machine-learning-896719a5cccb">Medical Insurance Charge Using Machine Learning</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Predicting High School Students Grades with Machine Learning (Regression)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/geekculture/predicting-high-school-students-grades-with-machine-learning-regression-3479781c185c?source=rss-e501190a4207------2"><img src="https://cdn-images-1.medium.com/max/850/1*ZdZ9WpNC8HWZMy3gtuu2FQ.png" width="850"></a></p><p class="medium-feed-snippet">Introduction:&#xA0;
The applications of machine learning range from games to autonomous vehicles; one very interesting application is with&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/geekculture/predicting-high-school-students-grades-with-machine-learning-regression-3479781c185c?source=rss-e501190a4207------2">Continue reading on Geek Culture »</a></p></div>]]></description>
            <link>https://medium.com/geekculture/predicting-high-school-students-grades-with-machine-learning-regression-3479781c185c?source=rss-e501190a4207------2</link>
            <guid isPermaLink="false">https://medium.com/p/3479781c185c</guid>
            <category><![CDATA[data-scienc]]></category>
            <category><![CDATA[educational-data-mining]]></category>
            <category><![CDATA[data-mining]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Adakole Emmanuel Audu]]></dc:creator>
            <pubDate>Mon, 14 Sep 2020 23:09:07 GMT</pubDate>
            <atom:updated>2021-08-25T07:31:59.923Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Educational Data Mining: Predicting Students Decision To Go To Go Into University]]></title>
            <link>https://medium.com/codex/educational-data-mining-predicting-students-decision-to-go-to-go-into-university-6ee807f33f1c?source=rss-e501190a4207------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ee807f33f1c</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[educational-data-mining]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[classification-algorithms]]></category>
            <dc:creator><![CDATA[Adakole Emmanuel Audu]]></dc:creator>
            <pubDate>Thu, 16 Jul 2020 23:06:01 GMT</pubDate>
            <atom:updated>2021-08-25T01:55:07.659Z</atom:updated>
            <content:encoded><![CDATA[<h3>Predicting Students Decision To Go Into University</h3><h3>Introduction</h3><p>Educational Data Mining is the analysis of students’ data with machine learning algorithms in order to infer information to further aid students with their education. It is a field with enormous potential benefits and it has received a lot of interest from researchers and some educational institutions over the years.</p><h3>Objective</h3><p>One very common application of machine learning to educational data is to predict students grades ( I will cover this in a different article ). In this project though, our objective is clearly stated as follows:</p><ul><li><strong>To Predict A Students final decision to further their education by enrolling into universities.</strong></li></ul><p>With this information, it’s possible for school administrators to understand the right approach to take for each group of students. To either encourage students by explaining to them the importance of tertiary education, or showing them viable alternatives and how to pursue these alternatives.</p><h3><strong>Dataset</strong></h3><p>To create our model for classification, we need to feed our algorithms with data. We need to find this data and in this project, we will make use of a publicly available Portuguese school dataset. It can be found with this url:<a href="https://github.com/Emmanuel96/Higher_edu_dec_prediction/blob/master/Dataset/student.csv">https://github.com/Emmanuel96/Higher_edu_dec_prediction/blob/master/Dataset/student.csv</a></p><p>The figure below explains the features present in the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*gOyw-sQosoB6LzFkvRK8ig.png" /><figcaption>Dataset features briefly explained</figcaption></figure><h3>Implementation</h3><p>To achieve the objective explained earlier, we will use three different classification algorithms (Multi-layered Perceptron Classifier, K-Nearest neighbor and Adaboost Ensemble) to classify students according to their decision</p><p>Once our environment is set up, we first import our Panda Libraries as follow:</p><pre>import pandas as pd<br>import numpy as np<br>import seaborn as sns</pre><p>Please note that you would have to install these libraries either with pip or conda, if you do not already have them installed.</p><p>Next, we import the necessary scikit-learn libraries:</p><pre><strong># sklearn imports</strong><br>from sklearn.metrics import mean_squared_error<br>from sklearn.metrics import r2_score<br>from sklearn.model_selection import train_test_split<br>from sklearn.preprocessing import LabelEncoder<br>from sklearn import metrics</pre><pre><strong># classifiers</strong><br>from sklearn.neural_network import MLPClassifier<br>from sklearn.ensemble import AdaBoostClassifier<br>from sklearn.neighbors import KNeighborsClassifier</pre><h3>Classification</h3><p>Machine learning algorithms mostly belong to either the category of supervised or unsupervised learning. Classification is a type of supervised learning which we used to classify a set of data into two or more classes.</p><p>To achieve this in our case, firstly, we read our csv file, create a dataframe out of it and drop our null values as follows:</p><pre>data = pd.read_csv(<br>    r&#39;C:/Users/Emmanuel/Documents/projects/Python/Students Data Analysis/Dataset/student.csv&#39;)<br>student_data = pd.DataFrame(data)</pre><pre><strong># drop all null data</strong><br>student_data.dropna(inplace=True)</pre><h4>Handle Categorical Values</h4><p>Classification algorithms don’t work well with categorical values, we need to convert them to binary values. In this case we use Pandas dummy_data function with our custom made function as follows:</p><pre><strong># function to convert categorical data to binary data</strong><br>def handle_cat_data(cat_feats, data):<br>    for f in cat_feats:<br>        to_add = pd.get_dummies(data[f], prefix=f, drop_first=True)<br>        merged_list = data.join(<br>            to_add, how=&#39;left&#39;, lsuffix=&#39;_left&#39;, rsuffix=&#39;_right&#39;)<br>        data = merged_list</pre><pre>    <strong># then drop the categorical features</strong><br>    data.drop(cat_feats, axis=1, inplace=True)</pre><pre>    return data</pre><pre><strong># drop all null data</strong><br>student_data.dropna(inplace=True)</pre><pre><strong># array of categorical values</strong><br>cat_data = [&#39;school&#39;, &#39;sex&#39;, &#39;address&#39;, &#39;famsize&#39;, &#39;Mjob&#39;, &#39;Fjob&#39;, &#39;reason&#39;, &#39;guardian&#39;, &#39;schoolsup&#39;, &#39;activities&#39;, &#39;nursery&#39;, &#39;fatherd&#39;, &#39;Pstatus&#39;, &#39;higher&#39;, &#39;internet&#39;, &#39;romantic&#39;, &#39;famrel&#39;,<br>            &#39;freetime&#39;, &#39;goout&#39;, &#39;Dalc&#39;, &#39;Walc&#39;, &#39;health&#39;, &#39;Medu&#39;, &#39;famsup&#39;]</pre><pre>student_data = handle_cat_data(cat_data, student_data)</pre><h4>Split Dataset To Test and Train Data</h4><p>We cannot use the same data for both training and testing purposes because our models are already familiar with the training datasets, hence to test its accuracy and robustness, we need a test dataset in which our model is not familiar with.</p><p>We can’t use our entire dataset directly for both training and testing, hence we split it into 80% for training and 20% for testing with the train_test_split method. We select our higher column as our target column and leave the other columns, except the target column to train our model with. We achieve this with the code snippet below:</p><pre><strong># divide data into training and testing data</strong><br>X_train, X_test, y_train, y_test = train_test_split(student_data.drop(<br>&#39;failures&#39;, axis=1), student_data.failures, test_size=0.25, stratify=student_data.failures)</pre><pre><strong># classifier names for run model function</strong><br>classifier_names = [&quot;K Nearest Neighbour&quot;,<br>&quot;Neural Networks&quot;, &quot;Adaboost Classifier&quot;]</pre><pre><strong># classifiers</strong><br>classifiers = [<br>KNeighborsClassifier(),<br>MLPClassifier(),<br>AdaBoostClassifier(),<br>]</pre><p>Finally we run our model by calling the run_models function as shown below:</p><pre><strong># run classification model</strong><br>run_models(classifier_names, classifiers, X_train, X_test, y_train, y_test)</pre><h3>Results And Model Evaluation</h3><p>The table below shows the accuracy of the different algorithms used. These values may vary slightly from what you get based on different factors i.e. your machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*dY7B1LkAdlfjeJk-t3fFAA.png" /><figcaption>Accuracy Of Classification Models</figcaption></figure><p>To evaluate a model, we could use different factors, but in this case we chose the accuracy and the time taken in seconds to train the model.</p><p>MLP is a neural network classifier; it usually requires a large dataset and can be very complex. Here we used a simple version with the default 200 iterations and 5 layers. As expected, because of its complexity, it took the longest time. I expected the accuracy to be high, but if fine tuned, it would give a better accuracy.</p><p>The last classification algorithm used here is Adaboost. Its is an ensemble classifier i.e. combination of two or more classification algorithms. In most cases, they give better results, but not in our case here. In this situation it fell a bit short of the KNN classifier. I am also confident with hyper parameter fine tuning, we would have better accuracy</p><p>We can easily see that the K Nearest Neighbour gave the best accuracy; this is very interesting as it is relatively the simplest algorithm used here giving an accuracy of 82.76% while also taking the shortest time to run.</p><h3><strong>Future Work:</strong></h3><p>Although, we would need to test our model with larger dataset, we can currently use it to predict students decisions. To make it more robust,we will need to fine tune the hyper parameters and see what difference this makes to the accuracies.</p><p>Thank you for reading my article and please feel free to reach out to me if you have any questions or comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ee807f33f1c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/educational-data-mining-predicting-students-decision-to-go-to-go-into-university-6ee807f33f1c">Educational Data Mining: Predicting Students Decision To Go To Go Into University</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>