# Deep Learning-Based Sentimental Analysis for Large-Scale Imbalanced Twitter Data
## 3 Proposed Methodology
### Deep Learning with TensorFlow Framework and Keras  
The TensorFlow is an open-source machine learning framework which is designed for large-scale training and prediction purposes. Users can easily design and deploy new algorithms using the same server architecture and APIs. It makes it easier to extend different machine and deep learning models with out of the box integration facilities. Primarily, it works in three phases: First, processing the data, and then configuring the required deep learning algorithm. After that, it trains and evaluates the configured algorithm [30; 31]. A TensorFlow-based algorithm presents computations on every node in a dataflow visualized graph. It gathers each node's information from a cluster of nodes by using different devices, i.e., Graphical Processing Units (GPUs), and multicore Central Processing Units (CPUs). It executes the designed algorithm in a multidimensional array, i.e., tensors. These tensors are base data types which offer a generalization concept to output. The queue feature is used to compute tensors asynchronously. It provides multithreading processing to speed up the operation [32; 33]. We designed a complex deep learning approach based on TensorFlow and Keras Application Programming Interface (API) for the classification of tweets' emotions. The normalized uncorrelated PC features are further used as input into the deep learning algorithm. The input reader accepts data and reads it in the same format, as shown in Figure 2. After that, the queue and the preprocessing phase receive the data. The preprocessing section preprocessed the PC data and made it available for queuing process. The queue phase provides a multithreading facility to tweets features. Further, the features are trained using the back and forward step. Also, it uses a cycle to train and fine-tune the parameters. The fine-tuning process is used to predict emotions with better accuracy. We fine-tuned the designed algorithm with dropout layers, activation function, number of neurons, each dense layer, and activation function.  
It receives tensor and generates tensor based on the same shape as output. The optimization function contributes to predictions. The Adam optimizer is used to compile and optimize the proposed model. It is also called stochastic descent gradient. It works in iteration to compute and renovate the network weights. It calculates the discrete adaptive learning rates for every parameter  
\begin{table}
\begin{tabular}{l c c c c c c c c c c c} \hline \hline
**Statistical** & **PC1** & **PC2** & **PC3** & **PC4** & **PC5** & **PC6** & **PC7** & **PC8** & **PC9** & **PC10** & **PC11** & **PC12** \\ \hline
**Standard** & & & & & & & & & & & \\
**Deviation** & 1.6253 & 1.2234 & 1.1529 & 1.09513 & 1.02088 & 0.94565 & 0.93161 & 0.88161 & 0.84315 & 0.79726 & 0.63662 & \(2.43\times 10^{-16}\) \\ \hline
**Proportion** & & & & & & & & & & & \\
**Variance** & & & & & & & & & & & \\ \hline
**Cumulative** & & & & & & & & & & & \\
**Proportion** & & & & & & & & & & & \\ \hline \hline \end{tabular}
\end{table}
Table 1: Principal Components with Standard Deviation, Proportion of Variance, and Cumulative Proportion.  
in the deep learning network [34; 35]. The decaying means of pas squared gradients are shown in Equations (5) and (6) [36].  
\[m_{t}=\beta_{1}m_{t-1}+(1-\beta_{1})g_{t} \tag{5}\]  
\[v_{t}=\beta_{2}v_{t-1}+(1-\beta_{2}){g_{t}}^{2} \tag{6}\]  
where \(m_{t}\) and \(v_{t}\) are the estimated means of the first and second moment gradients, respectively. The \(g\) denotes respective gradient for each moment.