# Novel Cuckoo Search-Based Metaheuristic Approach for Deep Learning Prediction of Depression
## 3 Methods Used
### Proposed Method
### PS-CS Update Equation

During the optimization process, the PS-CS update equation is utilized to update the velocity and position of each particle in the swarm. It involves three components: the particle's current velocity, its distance from its personal best solution, and its distance from the global best solution found by the swarm. \[\text{\small{\it V_{i}(t+1)=w\times V_{i}(t)+c1\times rand1\times(pbest_{i}-X_ {i}(t))+c2\times rand2\times(gbest-X_{i}(t))}} \tag{1}\]

\[\text{\small{\it X_{i}(t+1)=V_{i}(t)+V_{i}(t+1)}} \tag{2}\]

In Equation (1) \(\text{\small{\it V_{i}}}\) is the velocity of particle i at time t, in Equation (2) \(\text{\small{\it X_{i}}}\) is the position of particle i at time t, \(\text{\small{\it pbest_{i}}}\) is the personal best solution found by particle i so far, gbest is the global best solution found by the swarm so far, \"c1\" and \"c2\" are the cognitive and social parameters, which control the influence of the particle's personal best and the swarm's global best on the update, \"rand1\" and \"rand2\" are random values drawn from a uniform distribution between 0 and 1. Figure 2: Flowchart for proposed optimization algorithm. ## 4 Experimental Setup

### Dataset

Our deployed model was trained on a rich dataset sourced from Reddit--one of the largest and most diverse social media platforms in the world. Specifically, we utilized the Reddit depression dataset, which can be accessed via Kaggle ([[https://www.kaggle.com/datasets/infamouscoder/depression-reddit-cleaned](https://www.kaggle.com/datasets/infamouscoder/depression-reddit-cleaned)]([https://www.kaggle.com/datasets/infamouscoder/depression-reddit-cleaned](https://www.kaggle.com/datasets/infamouscoder/depression-reddit-cleaned)) (accessed on 26 March 2023)). To compile this dataset, we employed the Push Shift API ([[https://github.com/pushshift/api](https://github.com/pushshift/api)]([https://github.com/pushshift/api](https://github.com/pushshift/api)) (accessed on 26 March 2023)) to collect posts from a total of 28 subreddits, including 15 dedicated to mental health. For our study, we utilized the Push Shift API to collect posts from a variety of subreddits related to mental health, depression, and other relevant topics. This allowed us to gather a diverse and comprehensive dataset for use in training and testing our model. This allowed us to gather a comprehensive range of posts related to depression and other mental health issues from a variety of perspectives and sources. In order to facilitate an effective assessment of our model's performance, we utilized a more streamlined dataset consisting of 232,074 distinct posts, including 116,037 suicidal posts and 116,037 non-suicidal posts. Each post is accompanied by a corresponding depressed or non-depressive diagnosis, providing valuable context and insight into the mental health status of the user. There are several special characters in the data. The data source for this study is a CSV file. The purpose is to classify the kind of depression based on patient replies to a questionnaire. These responses will be used to train a model that can identify the kind of depression. Table 1 shows experimental setup that was used in this research. ### Preprocessing of Dataset

#### 4.2.1 Tokenization

Tokenization is the process of dividing a written document into smaller components called tokens. Words, word fragments, and even single characters such as punctuation can be considered as tokens. Because each piece of data is treated separately, tokenization analysis allows us to better understand the text's meaning. This procedure can help us hone our model's comprehension and processing of the content. Using the NLTK package, we tokenized the input data, dividing it up into an array of tokens. The Natural Language Toolkit (NLTK) is a widely used Python package for natural language processing (NLP) tasks. In our study, we utilized the NLTK package extensively to preprocess and clean the Reddit depression dataset.