Prediction of Future Mood Using Majority Vote Based on Certainty Factor

When students feel depressed, their performance will decline, and they will not attend the university. To prevent non-attendance in the university, we propose a system of mood prediction using the majority vote based on a certainty factor (MVCF). When part of the data cannot be obtained, MVCF predicts the future mood from available data. Moreover, MVCF predicts four types of mood, namely, excitement, relaxedness, depression, and nervousness. Experimental results show that MVCF can predict moods from the next day until two weeks with 0.7 ± 0.1 accuracy. We clarified that weather and scheduled events contribute to predicting the future mood. MVCF predicts more types of mood than the existing system. Moreover, the accuracy of MVCF is equal to that of the existing system.


Introduction
When students feel depressed, their grade point average decreases (1) and they will not attend the university. (2,3) The mood maintains a positive or negative value for a long time. (4) People who have depression in their youth are more likely to suffer depression after getting a job. (5) Therefore, it is important that school doctors discover the early depression risks of students and treat depression. However, it is difficult to discover early the depression risks of students, because the number of school doctors is small. Therefore, students should take care of their mental state so that they maintain a positive mood.
Kim et al. (6) asked students to answer a questionnaire via the Internet and grasp the state of their mind. Grasping the current mood helps transform a negative mood to a positive mood. However, it is difficult to completely prevent depression simply by grasping the current mood, because students may feel a negative mood in the future owing to scheduled events and changes in the environment. In addition to grasping their current mood, students need to predict their future mood on the basis of scheduled events and changes in the environment. However, since there are many scheduled events and changes in the environment, it is not easy for students to predict their future mood.
To solve the problem, previous research studies (7,8) predicted the future mood and visualize it. Such studies (7,8) clarified that the number of sunlight hours is an important variable for predicting the future mood. The previous research study (8) predicted positive and negative moods with 0.7 accuracy from the next day until two weeks by inputting yesterday's mood, weather, and vital signs into deep neural networks (DNNs). However, even though there are many types of mood, the previous studies only predicted two types of mood, namely, positive and negative moods. Moreover, when part of the data cannot be obtained, the previous system (7,8) cannot predict the future mood. The students often forget to measure mood and vital signs such as pulse and blood pressure. In addition, they often forget to charge the battery of the measurement device. In the above case, we lose some data.
We propose the use of the majority vote based on a certainty factor (MVCF). MVCF predicts the future mood from the majority vote of prediction candidates. When the certainty factor of the prediction result is large, the prediction result is selected as a prediction candidate. The prediction results are outputted by many DNNs. DNNs learn pulse, scheduled events, weather, or the current mood. When we lose some data, MVCF can predict the future mood from available data. When the number of prediction candidates is large, MVCF outputs the future mood from the next day until 14 days. Otherwise, MVCF does not predict the future mood as the unpredictable data. When the unpredictable data is outputted, we cannot grasp the mood of that day. When the prediction system outputs incorrect prediction results, it loses reliability. When the prediction system outputs many unpredictable data, it loses practicability. Therefore, MVCF predicts the future mood by maximizing the certainty factor calculated from the accuracy of prediction and the percentage of predictable data. Experimental results show that MVCF predicts four types of mood, namely, excitement, relaxedness, depression, and nervousness from the next day until two weeks. It also predicts more types of mood than the existing system. The accuracy of MVCF is equal to that of the existing system. (7,8) When there is a missing value in the measurement data, MVCF can still predict the future mood.
In Sect. 2, we explain how to obtain data, how to calculate feature vectors, and how to construct MVCF. In Sect. 3, experimental results show that MVCF works properly and effectively. In Sect. 4, we discuss the accuracy of the prediction and percentage of unpredictable data when thresholds of certainty factor change. In Sect. 5, we present our future works.

Prediction of Future Mood
A user treats a negative mood by considering his/her current mood and maintains a positive mood by considering his/her future mood predicted by MVCF (Fig. 1). First, the user uploads the pulse, current mood, and scheduled events to the cloud. The pulse is obtained from the pulse monitor attached to the user. The current mood is obtained by the user by inputting it to the interface on a smartphone. Second, weather is obtained for free from the Japan Meteorological Agency website. (9) Third, the user treats his/her mental state on the basis of his/her current mood. Fourth, MVCF predicts the future mood. Fifth, the user treats his/her mental state by considering the future mood before feeling a negative mood and maintains his/ her mental health.
MVCF is composed of many DNNs (Fig. 2). First, each feature vector is calculated from the pulse, scheduled events, current mood, or weather. Second, DNN v,α (h,w) (v = γ, Ω, η, ζ) learns the feature vectors of a user. h ∈ ℕ is the number of hidden layers in DNNs, w ∈ ℕ is the number of units in the hidden layers, and α in qualitative variables is the type of activation function in DNNs. DNN v,α (h,w) outputs a class probability. The class probability implies the difficulty in prediction. When the class probability is greater than the threshold, MVCF outputs a prediction candidate. Otherwise, MVCF rejects the prediction of DNN v,α (h,w). Third, MVCF outputs the future mood or unpredictable data. MVCF votes the predictable candidates for each objective variable. When the number of prediction candidates is large, MVCF outputs a future mood after s day. Otherwise, MVCF does not predict the future mood after s day as the unpredictable data. We define the future day as s ∈ ℕ.
The reason for selecting DNNs as a predictor is that various hyperplanes can be described by changing parameters. In this research study, many machine learnings learn each feature vector, predicting the future mood through MVCF that machine learning outputted. To predict the future mood with large accuracy from the majority vote, many prediction candidates are necessary. However, we cannot stably evaluate reliability and practicability from the certainty factor when we combine predictors with different machine learning models such as classification and regression tree (CART), C4.5, RandomForest, and support vector machine (SVM), because machine learning models differently calculate the class probability of the prediction result. Therefore, we use DNNs that can describe various hyperplanes. In addition, we often lose some data by unmounting and recharging the wearable device. When DNNs input noisy and missing data, the prediction accuracy decreases.
MVCF does not necessarily predict the future mood from noisy data. MVCF copes with noisy data by setting the threshold to the f-measure of DNN v,α (h,w). MVCF copes with the missing data by voting the prediction candidates. With this process, MVCF predicts moods with greater accuracy than previously reported systems. Fig. 1. A user treats a negative mood considering his/her current mood and maintains a positive mood considering his/her future mood that is predicted by MVCF.

Input data
The previous research studies (7,8) predicted the future mood by inputting the vital signs, weather, and current mood to a machine learning model. According to the National Institute for Occupational Safety and Health (NIOSH) model of job stress, (10) the mood of the worker is changed by events such as workload, the quality of the work, relationship, and rest. Therefore, MVCF predicts the future mood by inputting the pulse, the current mood, scheduled events, and the weather to DNNs. A user wears a wristwatch-type pulse monitor and measures the pulse. The pulse is sent to a smartphone via wireless networks. A user inputs his/her current mood into the input interface on the smartphone. We implement the input interface on the basis of the circumplex model of affect (11) (Fig. 3). The circumplex model of affect is composed of the pleasant and activation axes. The two axes classify the type of mood as excitement, relaxedness, depression, or nervousness. The input interface is displayed on the touch screen of the smartphone. A user can easily input his/her current mood by tapping on the excitement, relaxedness, depression, or nervousness. The input interface obtains the coordinates on the circumplex model. The pulse and his/her current mood are uploaded to the cloud via the smartphone. Scheduled events are obtained with an application on the cloud. University students usually experience events in daily lives. The types of event are mainly studying, participating in club activities, working part time, and rest. The studying, club activities, and working are equivalent to the workload in the NIOSH model. Therefore, we obtain the studying, club activities, working, and rest. Weather is obtained for free from the Japan Meteorological Agency website. (9)

Feature vector
Each feature vector is calculated from the pulse, weather, scheduled events, or current mood. The pulse vector is a state transition matrix. The state transition matrix is outputted by the hidden Markov model (HMM). HMM inputs the pulse obtained the day before. (12) HMM converts time series data into the transition of steady states using the Baum Welch and Viterbi algorithms. The Baum Welch algorithm (13) estimates the parameters of HMM. The Viterbi algorithm (14) calculates the state transition matrix on the basis of the parameters of HMM. The pulse in the daily lives changes according to rapid eye movement (REM) sleep, non-REM (NREM) sleep, activity state, and resting state. Therefore, the number of steady states is set to four. The pulse vector is a 4 × 4 state transition matrix. The weather vector is an average of the weather from the s day until the s − 1 day. The event vector is the number of each of the events from the s − 5 day until the s − 1 day. The mood vector is the current mood of the coordinates on the circumplex model.

Prediction of future mood
Each feature vector is inputted to DNN v,α (h,w). DNN v,α (h,w) outputs the class probability of objective variables. The objective variables are excitement, relaxedness, depression, and nervousness after the s day. The class probability implies the difficulty in prediction. DNN is composed of hidden layers. Each hidden layer has some units. Each unit has an activation function. The activation function describes various hyperplanes with linearity or nonlinearity. First, DNN learns explanatory variables by pretraining in unsupervised learning with an autoencoder. Second, DNN is adjusted by fine-tuning in supervised learning with dropout.
where c v,α,y (h,w) ∈ ℝ is the class probability in DNN v,α (h,w), and y is an objective variable. The prediction candidate is selected as where ,α c v y (h,w) outputs the prediction candidate. The prediction candidate is the estimated objective variable. Each DNN has a different parameter. The number of DNNs is equal to that of parameter combinations. Therefore, the maximum number of prediction candidates is attached as H × W × (number of activation functions) × (number of feature vectors).
According to the following formula, MVCF selects reliable prediction candidates by threshold processing and from the voting for each objective variable.
where , According to the following formula, MVCF selects the reliability vote by threshold processing for q y .
where y vote is the result of prediction, d y ∈ ℤ is the percentage of votes for each objective variable, and T d ∈ ℝ is the threshold of d y . When y vote is 0, MVCF outputs the unpredictable data. Otherwise, MVCF outputs the future mood.

Determination of threshold
where , where , where , When the f-measure decreases, system reliability decreases, because the system often outputs an incorrect prediction. When the system outputs a lot of unpredictable data, the system loses practicability. Therefore, MVCF should be evaluated on the basis of the f-measure and percentage of unpredictable data. T u , T f , and T d are determined such that the certainty factor maximizes as , , , where E( f vote ,N vote ) ∈ ℝ is the evaluation function of the certainty factor. f vote (T u ,T f ,T d ) is the f-measure in applying T u , T f , and T d .
where o vote (T u ,T f ,T d ) is the number of predictable data in applying T u , T f , and T d .
is the number of unpredictable data in applying T u , T f , and T d .

Evaluation of MVCF
The number of subjects was four. The subjects were undergraduate students. The experiment period was from October 27, 2015 to December 27, 2015. The subjects measured their pulse with a pulse monitor (Epson Company, PS-100BL). The number of steady states was four. Therefore, the pulse vector was 16-dimensional. We ordered the subjects to wear the pulse monitor always. The subjects measured their current mood with the smartphone (Sony Company, Xperia z3 compact). The types of mood considered were excitement (EX), relaxedness (RX), nervousness (NV), and depression (DP). The input interface on the smartphone obtained the coordinates of the circumplex model based on the pleasant and activation axes. Therefore, the mood vector was 2-dimensional. The subjects responded to mood during 13:00 and 17:00. The subjects inputted their scheduled events to the Google calendar. The event vector was the number of events such as studying, working, club activities, and rest. Therefore, the event vector was 4-dimensional. The event during the experiment was inputted before the experiment. When an event was added after the experiment started, the subjects updated the Google calendar every time. We obtained the weather by considering the maximum temperature (MXT), minimum temperature (MNT), precipitation (PN), snowfall (SF), snow depth (SD), number of sunshine hours (SH), maximum wind speed (MW), relative humidity (RH), mean cloudiness (MC), air pressure (AP), and vapor pressure (VP). Therefore, the weather vector was 11-dimensional. The weather of Hikone was obtained from the Meteorological Agency after the experiment. MVCF predicted the mood from the next day until 14 days (s = 1, 2, …, 14). The objective variables considered were excitement, relaxedness, depression, and nervousness after s day. Table 1 shows the sample pulse size, current mood, scheduled events, and weather. Table 2 shows the sample mood size. H and W were set to 4 and 5, respectively. The activation functions considered were maxout, maxout with dropout, rectifier, Table 1 Number of days that input data was obtained.
A B  C  D  Pulse  40  17  6  12  Mood  42  22  33  22  Event  62  62  62  62  Weather  62  62  62  62   Table 2 Sample mood size in each of the subjects. Subject  EX  NV  DP  RX  A  5  5  20  12  B  9  2  2  9  C  3  24  2  4  D  7  2  0  13 rectifier with dropout, tanh, and tanh with dropout. The number of activation functions was six. The feature vectors considered were the pulse, event, mood, and weather vectors. The number of feature vectors was four. Therefore, the maximum number of votes was 480. The performance of MVCF was evaluated by leave-one-out cross-validation (LOOCV), (15) where the f-measure was calculated. f avg (T u ,T f ,T d ) was defined as the average f MVCF (s,T u ,T f ,T d ) from the next day until 14 days when T u , T f , and T d were set as where n MVCF (s,T u ,T f ,T d ) is the percentage of predictable data of MVCF when predicting the mood after s day. Table 3 shows the parameters of the steady state in HMM. MVCF was set to the same parameters of DNN. There are few days when the weather, event, pulse, and mood could be measured. Therefore, we could not describe the result of inputting all feature vectors into DNNs. We compared MVCF with classifiers with the highest accuracy among the accuracies of DNN v,α (h,w). Figures 4-6 show the average (T u ,T f ,T d ), f avg (T u ,T f ,T d ), and N avg (T u ,T f ,T d ).
T u , T f , and T d were set as the thresholds when Eq. (12) was maximum. The error bars in Figs. 4-6 indicate the standard deviation. As indicated in Fig. 4, when T u , T f , and T d were set to about 0.5, 0.5, and 0.1, respectively, f avg and N avg were maximized. As indicated in Fig. 5, MVCF predicted four types of mood with 0.7 ± 0.1 accuracy. The f-measure of MVCF is about 0.1 higher than DNN v,α (h,w). As indicated in Fig. 6, the average N avg was determined to be 0.05. Figures 5 and 6 show that subjects with large f avg values have small N avg values. Figure  7 shows the f avg of each mood. The f avg of DP in subject D was zero because subject D did not have DP. Table 2 and Fig. 7 show that f avg is large in descending order of the number of predictable data in Fig. 8.     Table 4 shows the sample sizes of M-2, M-1, and M-0. Figures 9 and 10 showed that, as the number of missing values increases, f avg and N av decrease. The weather and event vectors contribute to the accuracy because f avg in M-2 is greater than the random value. The pulse and mood vectors contribute to the accuracy because f avg in M-0 is greater than that in M-2. Therefore, MVCF with the pulse, weather, scheduled events, and current mood is proven to work properly and effectively. MVCF predicts more types of mood than the existing system. (7,8) Moreover, MVCF can cope with missing values by voting a predictable candidate.

Discussion
We discuss the effects of T u , T f , and T d on f avg and N avg . When T u was set to large values, , c v f α (T c ,h,w) increased (Fig. 11). However, , c v n α (T c ,h,w) decreased. Therefore, T u selected reliable results in DNN v,α (h,w) as prediction candidates. Figures 12 and 13 show the effects of T f and T u on f avg and N avg when T d was changed from 0 to 1. When T f and T u were set to large values, f avg increased and N avg decreased. Therefore, MVCF increased the reliability and decreased the usability by setting T f and T u to large values. Figures 14 and 15 show the effects T f and T d on f avg and N avg when T u was changed from 0 to 1. When T d was set to large values, f avg was not changed and N avg decreased. Figures 16 and 17 show the effects of T u and T d on f avg and N avg when T f was changed from 0 to 1. When T d was set to large values, f avg was not changed and N avg decreased. Therefore, MVCF was proven to be highly reliable and useful when T u and T f were set to intermediate values and T d was set to small values.

Conclusions and Future Works
We proposed MVCF. Even when there were missing values, MVCF predicted four types of mood, namely, excitement, relaxedness, depression, and nervousness with 0.7 ± 0.13 accuracy. MVCF predicts more types of mood than the existing system. Moreover, the accuracy of MVCF is equal to that of the existing system. (7,8) As a result of analysis, scheduled events and weather are considered important variables for predicting the future mood. We showed that the f-measure and the percentage of unpredictable data can be adjusted by changing the thresholds T u , T f , and T d . Students can easily maintain a positive mood by self-control on the basis of the visualized mood using MVCF. The physical burden on the students was small because we used wearable devices to measure the pulse. Even when the pulse and current mood were not measured, MVCF predicted the mood from the next day until two weeks with 0.6 ± 0.9 accuracy by considering the scheduled events and weather. Therefore, experimental results show that MVCF works properly and effectively. On the other hand, the mood prediction system used the observation value of weather, but not the weather forecast. In addition, MVCF is a personal adaptive system. As future work, we will predict future moods from the weather forecast. Moreover, we would like to develop a method that predicts the mood of an unknown user.
year. After becoming a lecturer at Kanawaza Woman's College in 1980, he became an associate professor at the School of Economics, Kanazawa University, in 1984. He was a professor at the Graduate School of Natural Science and Technology, Kanazawa University. Currently, he is a professor of the Department of Production Systems Engineering and Sciences, Komatsu University. His research interests include applications of softcomputing. He is a member of the Japanese Society for Artificial Intelligence and the Information Processing Society of Japan.