<?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 Ogbeide Aghahowa (Marvel) on Medium]]></title>
        <description><![CDATA[Stories by Ogbeide Aghahowa (Marvel) on Medium]]></description>
        <link>https://medium.com/@ogbeideaghahowa?source=rss-95e1a3a5d8dc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DKCdiaB4USWB9nq_CkXkNQ.jpeg</url>
            <title>Stories by Ogbeide Aghahowa (Marvel) on Medium</title>
            <link>https://medium.com/@ogbeideaghahowa?source=rss-95e1a3a5d8dc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 08:32:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ogbeideaghahowa/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[ANALYZING AND PREDICTING DEPRESSION AMONG COLLEGE STUDENTS]]></title>
            <link>https://medium.com/@ogbeideaghahowa/analyzing-and-predicting-depression-among-college-students-f3c9ee5f95a9?source=rss-95e1a3a5d8dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3c9ee5f95a9</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ogbeide Aghahowa (Marvel)]]></dc:creator>
            <pubDate>Sun, 11 Sep 2022 17:08:21 GMT</pubDate>
            <atom:updated>2022-09-11T17:08:21.913Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Predictive Analysis project using Python and Power BI.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZInAEv5btYAb3TQszfIR9w.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/ja/@anthonytran?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Anthony Tran</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Depression is a mental health disorder characterized by a persistent feeling of sadness or loss of interest in activities once enjoyed, usually with no known cause. According to the <a href="https://www.who.int/news-room/fact-sheets/detail/depression">WHO</a>, approximately <strong>280 million</strong> people in the world are living with this illness, and <strong>over 700,000</strong> people die yearly from suicide linked to depression. If you ask me, these are huge numbers and should be of public health concern.</p><p>One of the causes of depression is chronic stress. Therefore, it is not surprising that this disorder is prevalent among college students, but:</p><ul><li><em>What proportion of students are depressed?</em></li><li><em>What are the factors that most likely indicate a student is depressed?</em></li><li><em>Are students of a particular gender more prone to this illness?</em></li><li><em>Can we predict if a student is depressed if we have some data?</em></li></ul><p>These questions, and many more, are what this analysis aimed to answer. This analysis was done with Python, and a one-page report was created with Power BI Desktop. You can check out the code documentation on github <a href="https://github.com/OgbeideAghahowa/PREDICTING-DEPRESSION-AMONG-COLLEGE-STUDENTS-WITH-PYTHON">here.</a></p><h4>About The Data</h4><p>The dataset used for this analysis was collected from Kaggle. It comprises survey results from over 700 students in the University of Lahore. You can read more about the data <a href="https://www.kaggle.com/datasets/shahzadahmad0402/depression-and-anxiety-data">here</a>, or check out a brief explanation of the variables used in this analysis <a href="https://github.com/OgbeideAghahowa/PREDICTING-DEPRESSION-AMONG-COLLEGE-STUDENTS-WITH-PYTHON/blob/main/Depression%20Analysis.ipynb">here</a>.</p><h4>Data Cleaning</h4><p>It is often said that data cleaning is the bread and butter of data science, and with that in mind, I sought to make my data as tidy as possible. The steps I took in ensuring my data was sparkling clean for analysis are outlined below:</p><ul><li>Using the pandas DataFrame isna().sum() chained method, I discovered that a maximum of 41 rows had missing data. Since this was less than 10% of the total, it was safe to remove the missing data.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9659e7b4140638f0adbf3bb645969a30/href">https://medium.com/media/9659e7b4140638f0adbf3bb645969a30/href</a></iframe><pre>id 0</pre><pre>school_year 0</pre><pre>age 0</pre><pre>gender 0</pre><pre>bmi 0</pre><pre>who_bmi 0</pre><pre>phq_score 0</pre><pre>depression_severity 4</pre><pre>depressiveness 3</pre><pre>suicidal 1</pre><pre>depression_diagnosis 1</pre><pre>depression_treatment 4</pre><pre>gad_score 0</pre><pre>anxiety_severity 0</pre><pre>anxiousness 6</pre><pre>anxiety_diagnosis 4</pre><pre>anxiety_treatment 2</pre><pre>epworth_score 8</pre><pre>sleepiness 8</pre><pre>dtype: int64</pre><ul><li>I checked the columns with categorical data to see if there were any wrong categories. I discovered that <em>epworth_score</em> contained out of range data, and <em>depression_severity</em> had a strange category, “none’’. I set the out of range <em>epworth score</em> to 20, and replaced all “none” categories in <em>depression_severity</em> to “None-minimal”. For ease of analysis, I reduced the number of <em>who_bmi</em> categories and grouped all obesity classes as “obese”.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/340576a4eefecb1fd46619396e572c6f/href">https://medium.com/media/340576a4eefecb1fd46619396e572c6f/href</a></iframe><pre>school_year: [1 2 3 4]</pre><pre>who_bmi: [‘Class I Obesity’ ‘Class II Obesity’ ‘Class III Obesity’ ‘Normal’</pre><pre>‘Not Availble’ ‘Overweight’ ‘Underweight’]</pre><pre>phq_score: [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 24]</pre><pre>depression_severity: [‘Mild’ ‘Moderate’ ‘Moderately severe’ ‘None-minimal’ ‘Severe’ ‘none’]</pre><pre>depressiveness: [False True]</pre><pre>suicidal: [False True]</pre><pre>depression_diagnosis: [False True]</pre><pre>depression_treatment: [False True]</pre><pre>gad_score: [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21]</pre><pre>anxiety_severity: [‘Mild’ ‘Moderate’ ‘None-minimal’ ‘Severe’]</pre><pre>anxiousness: [False True]</pre><pre>anxiety_diagnosis: [False True]</pre><pre>anxiety_treatment: [False True]</pre><pre>epworth_score: [ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17.</pre><pre>18. 19. 20. 24. 31. 32.]</pre><pre>sleepiness: [False True]</pre><ul><li>I converted <em>school_year</em>, <em>gender</em>,<em> who_bmi</em>, <em>depression_severity</em> and <em>anxiety_severity</em> variables into category data type using a custom-made function shown below.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/add17fe4777eb37d4f5eea4e05f2ae79/href">https://medium.com/media/add17fe4777eb37d4f5eea4e05f2ae79/href</a></iframe><ul><li>I removed all rows with outlier values for <em>bmi</em> and dropped all duplicate rows. There were 11 duplicates so it was okay to remove all of them.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/85f17f54b4af4eeb6ef81710980f4373/href">https://medium.com/media/85f17f54b4af4eeb6ef81710980f4373/href</a></iframe><ul><li>I resampled the dataset to obtain a stratified sample of <em>gender</em> and <em>school_year</em> to avoid biased statistical estimates.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b792323637dfac46f8b3daef81b69d66/href">https://medium.com/media/b792323637dfac46f8b3daef81b69d66/href</a></iframe><h4>Exploratory Data Analysis (EDA)</h4><p>In this section, I got to really dig into my data to understand a lot of things. This is undoubtedly one of the most exciting phases of the data science workflow — after Predictive Analysis of course. Most of what I did here was exploring univariate and bivariate relationships. For univariate relationships, I mainly used count plots since I dealt with categorical variables more, and bar plots mainly for bivariate relationships. The steps I took in this phase are summarized as follows:</p><ul><li>I used a correlation heatmap to get a bird’s eye view of the relationship between the numerical variables. From the heatmap, I observed that <em>phq_score</em> and <em>gad_score</em> have a <strong>strong positive correlation</strong> — meaning students with Generalized Anxiety Disorder (GAD) are also likely to be depressed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*if02vmKSTyRO3PdrweaNiA.png" /></figure><ul><li>Plotting the average <em>bmi</em> per <em>gender</em> revealed that male students have a slightly higher Body Mass Index (BMI) than female students.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a6me8ieZh0lGqSdO89oD3w.png" /></figure><ul><li>Using a heatmap to compare <em>depressiveness</em> and <em>depression_treatment</em>, I discovered that 25% of all college students are depressed and not receiving any treatment.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*crkcCK5I1dWue3usnMsIuw.png" /></figure><ul><li>Using a countplot to relate <em>depressiveness</em> and <em>gender</em>, I observed that female students are more likely to be depressed than male students.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*KSLKfdeKkgy5L1uKon17Dw.png" /></figure><ul><li>Using a countplot to relate <em>who_bmi</em> and <em>gender</em>, I discovered that male students are<strong> two times</strong> more likely to be overweight while female students are <strong>three times</strong> more likely to be underweight.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*ECNpK49KlEgBa9bwb-r8hQ.png" /></figure><ul><li>Plotting the count of students by <em>depression_severity</em> revealed that about <strong>2 out of 5</strong> students are suffering from mild depression.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*3fnWo8vZxqkwV0c6yW0VQw.png" /></figure><p>There are other wonderful insights from this analysis that may interest you. Kindly check out the code documentation <a href="https://github.com/OgbeideAghahowa/PREDICTING-DEPRESSION-AMONG-COLLEGE-STUDENTS-WITH-PYTHON">here</a> if you are curious to know more. The key insights from this analysis were used to design the one-page report below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YLUHeu7DjIMTFRLWOxToKQ.jpeg" /></figure><h4>Data Preprocessing For Modeling</h4><p>From the EDA, it is obvious that we can predict whether a student is depressed or not using features such as <em>gad_score</em>, <em>age</em>, <em>gender</em>, <em>bmi</em>, and <em>school_year</em>. The steps I took in preparing the data for modeling include:</p><ul><li>I removed features that were moderately/strongly correlated with one another and ended up with the selected features in the code snippet below.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d62dc433366f1910b2f825c8d7ebe70/href">https://medium.com/media/2d62dc433366f1910b2f825c8d7ebe70/href</a></iframe><ul><li>I performed one-hot encoding on the target variable (<em>depressiveness</em>) and <em>gender</em> using the pandas series map() method.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc4d59dab0a7ffb885bfbbbdaca00a96/href">https://medium.com/media/dc4d59dab0a7ffb885bfbbbdaca00a96/href</a></iframe><ul><li>I used Principal Component Analysis (PCA) to select the features of high importance. I used the two components with an explained variance of 88% in my PCA model, and selected the three most important features (<em>gad_score</em>, <em>bmi</em>, and <em>age</em>) for model training.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/add44e07be56302848266ed3629ced96/href">https://medium.com/media/add44e07be56302848266ed3629ced96/href</a></iframe><pre>gad_score 0.518993</pre><pre>bmi 0.515613</pre><pre>age 0.061953</pre><pre>gender 0.027197</pre><pre>school_year 0.023737</pre><pre>dtype: float64</pre><ul><li>I split the dataset into 80% training data and 20% test data making sure that there are equal proportions of target variables in both training and test sets.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f84f400820aad034022e24767a8dbaca/href">https://medium.com/media/f84f400820aad034022e24767a8dbaca/href</a></iframe><ul><li>Using sklearn’s StandardScaler(), I scaled the features of the dataset to ensure individual data points have equal spread. This was to prevent outliers from affecting my model’s predictive ability.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/02555c4a42148ea7a42a88633b4ce72d/href">https://medium.com/media/02555c4a42148ea7a42a88633b4ce72d/href</a></iframe><h4>Model Training And Testing</h4><p>Now that we are done with the relatively boring parts, the fun part begins :D. Since the target variable is categorical, a classifier model is appropriate for prediction. I used KFold Cross Validation to obtain the best classifier between a Logistic Regression model, K-Nearest Neighbor (KNN) classifier, and Decision Tree classifier. As shown in the image below, the best performing model was the Logistic Regression model.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3aa5c6e7c01288bc43eb71c0186fe1c7/href">https://medium.com/media/3aa5c6e7c01288bc43eb71c0186fe1c7/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*3U_VDJX68yF1DLu03N3nGQ.png" /></figure><p>Before fitting my model to the training set, I used Synthetic Minority Oversampling Technique (SMOTE) and Random Undersampling to handle class imbalance. I used the imblearn’s SMOTE() and RandomUnderSampler() models for this. Using a pipeline, I resampled the training set using SMOTE() and RandomUnderSampler(), and then fit the sampled data to the logistic regression model. To learn more about SMOTE() and RandomUnderSampler(), click <a href="https://machinelearningmastery.com/smote-oversampling-for-imbalanced-classification/">here</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6a5021258ac9407f945868e25991f13e/href">https://medium.com/media/6a5021258ac9407f945868e25991f13e/href</a></iframe><p>The Logistic Regression model predicted the labels of the test set with an accuracy of 82% and 70% sensitivity — meaning the model can predict 7 out of 10 depressed students correctly. The full classification report and roc_auc_score are shown below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/35870fdd9c697101cd71f3a9c53d4c81/href">https://medium.com/media/35870fdd9c697101cd71f3a9c53d4c81/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*4FYCOVCjljvCfvT_-E3-pw.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9267937179bf2a6b06a32d0740683bb8/href">https://medium.com/media/9267937179bf2a6b06a32d0740683bb8/href</a></iframe><pre>0.7851851851851852</pre><h4>Recommendations</h4><p>According to the <a href="https://www.nimh.nih.gov/health/statistics/suicide">National Institute of Mental Health</a>, suicide is the second leading cause of death for college students in the US. Approximately 1,100 suicides occur in college campuses per year. A machine learning model that can accurately predict whether a student is depressed or not can go a long way in reducing these numbers.</p><p>Further analyses are highly recommended on this topic. A major setback I experienced while exploring this topic was insufficient training data, accompanied with a non-representative sample. I believe training the model with more data will definitely improve its predictive accuracy and sensitivity.</p><h4>Conclusion</h4><p>Depression is a very common mental health issue that should be put in check. An even bigger issue is how hard it is for an ordinary individual to detect if someone is depressed, since most sufferers usually isolate themselves from others. Fortunately, with data such as age, BMI, and GAD scores, we can predict whether a student is depressed or not. This can help mental health professionals quickly identify patients who need them, thereby reducing fatalities.</p><blockquote>Contrary to what you may have seen in movies, A.I can actually save the world ;)</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3c9ee5f95a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>