Dengue Fever Prediction Using Naive Bayes Algorithm

Nirsal1, a) Suhardi2,b Heliawaty Hamrul3, c)

Author Affiliations 
1Universitas Cokroaminoto Palopo 
(Jalan Latammacelling Number 19,Indonesia).
 2Universitas Cokroaminoto Palopo. 
3Universitas Sulawesi Barat.

Author Emails
a) nirsal@uncp.ac.id 
b) suhardi@uncp.ac.id
c) heliawatyhamrul@uncp.ac.id

Abstract. This study aims to applying the Naive Bayes algorithm to predict patients with Dengue Fever based on patient data taken from Majene Hospital. The research method used is to classify patient data into positive and negative classes based on the calculation of probability values. 9 variables used and symbolized in the form X1 to X9. This variable represents the symptoms of Dengue Fever disease. The results showed that the Naive Bayes algorithm can be used to predict Dengue Fever. This can be proven from the results of the dataset test which was carried out three times. The results of the first trial were 70 data training and 30 data testing with 90% test results. The results of the second trial were 50 data training and 50 data testing with 88% test results and the third trial results were 40 data training 60 data testing with 88.3% test results.
INTRODUCTION
Dengue Fever is a health problem in Indonesia, where the number of sufferers tends to increase from year to year and its spread is very wide. In 2016 there were 204,171 cases of dengue fever with 1,598 deaths. The number of cases of dengue fever in 2016 increased compared to the number of cases in 2015 (129,650 cases)[1]. Numerous studies have been done that have focus on diagnosis of Dengue Fever. They have applied different data mining techniques for diagnosis & achieved different probabilities for different methods. Naive Bayes is one of the successful classification techniques used in the diagnosis of heart disease patients.[2]. Naive Bayes or Bayes Rule is the basis for many machine-learning and data mining methods. The rule (algorithm) is used to create models with predictive capabilities. It provides new ways of exploring and understanding data. [3].  Naive Bayes has several advantages, namely fast calculation, simple algorithm and high accuracy. The Naive Bayes Classifier is more appropriate to apply to large data and can handle incomplete data (missing value) and strong against irrelevant attributes and noise in data[4]. This is also supported by the results of research which show that the accuracy level of the Naive Bayes algorithm is better after feature selection is carried out[5]

METHOD
The research method is shown in figure 1.

FIGURE 1. Research stages

The method used in this study was to collect data on patients who have symptoms of dengue fever from Majene Hospital and serve as a dataset. Furthermore, the dataset is grouped into training data and testing data. To avoid bias, the dataset is randomly selected. The variables were expressed as symptoms and labeled 0 if they had symptoms and 1 if they had no symptoms. Next, calculate the probability value and classify it into positive and negative classes.

RESULT AND DISCUSSION
This study used data from patients at Majene Hospital who were taken randomly. Furthermore, the data is used as training data and testing data. The training data consists of 9 attributes that represent the symptoms of Dengue Fever. The variables and attributes are shown in table 1.

TABLE  1.  Research Atribut and Variables
Variable	Atribut	Values	
X1	Fever 4-7 days up to 40 degrees Celsius 	1	
		0	
X2	Redness face 	1	
		0	
X3	Body aches	1	
		0	
X4	Headache	1	
		0	
X5	Nausea 	1	
		0	
X6	Throat infection	1	
		0	
X7	Pain around the eyes	1	
		0	
X8	trombosit ≤ 100.000/mcl	1	
		0	
X9	Hematocrit increases up to 20%	1	
		0	
Y	diagnosis	1	
		0	
Table Information:
1: if the patient has Dengue Fever symptoms
0 : 1 if the patient has not DHF symptoms

Table 1 explains that the variable X represents the symptoms experienced by the patient. The number of patients who were used as training data was 10. Data training is shown in table 2

TABLE 2. Data Training 
Pasien	X1	X2	X3	X4	X5	X6	X7	X8	X9	Label	
1	1	1	1	1	1	1	1	70.2	68.9	Positive 	
2	1	1	1	1	1	0	1	66.4	87.4	Positive 	
3	1	1	0	1	0	1	0	178.2	41.6	Negative	
4	1	1	1	1	1	1	1	60.9	88.3	Positive 	
5	1	1	0	1	1	1	1	56.5	67.9	Positive	
6	1	1	0	1	0	1	0	190.2	50.9	Negative	
7	1 	0	1	1	1	1	1	80.0	77.2	Positive	
8	1	1	0	1	0	0	1	160.6	40.8	Negative 	
9	1	1	1	1	1	1	1	46.3	60.4	Positive	
10	1	0	0	1	1	0	1	153.8	52.5	Negative 	

Table 2 shows as many as 10 training data used. The negative class is 4 (four) data and the positive class is 6 data. The formula for calculating positive and negative likelihood prior probabilities uses equation 1.
 	(1)

si is the amount of data training from Ci. s is the total amount of data training.
Negative Probability Calculation is :

P(C0) =  4/10 =  0.4
Positive probability calculations is: 
P(C1) = 6/10 = 0.6

The calculation of posterior probability is carried out on 10 data training with the equation:
                                           (2)
Information :
F (Xkj | Ci) is the value of the frequency of occurrence of Xkj data in the Ci category
F (Ci) is the number of data occurrences in the Ci category
| W | is the total number of data attributes used

So that the probability value is obtained. This values is shown in table 3 and 4.

TABLE 3. Probability Values
Label	Amount of Data	Amount of All data	Result	
Positif 	6	10	0,6	
Negatif 	4	10	0,4	
	
TABLE 4. Probability Values
Variable/Symtoms	Number of Cases	Probability	
X1	6/6	1/4	1	0.25	
X2	5/6	4/4	0.83	0.25	
X3	5/6	4/4	0.83	1	
X4	6/6	4/4	1	1	
X5	6/6	3/4	1	0.75	
X6	5/6	2/4	0.83	0.5	
X7	6/6	2/4	1	0.5	
X8	6/6	4/4	1	1	
X9	6/6	4/4	1	1	

Based on 50 data patient from Majene Hospital, data on dengue fever patients were obtained with a positive class is 35 and a negative class is 15. The data is shown in table 5.

TABLE 5. Data Testing
No	X1	X2	X3	X4	X5	X6	X7	X8	X9	DBD	
1	1	1	1	1	1	1	1	88.6	60.7	Positive	
2	1	0	1	1	1	1	1	120.7	56.1	Positive	
3	1	1	1	1	1	1	0	92.3	59.2	Positve	
4	0	1	1	1	0	1	1	182.0	40.3	Negative	
5	0	1	1	1	1	1	0	52.6	71.5	Positive	
6	1	0	1	1	1	1	1	76.3	62.8	Positive	
7	1	1	1	1	1	1	1	47.9	64.3	Positive	
8	1	   0	1	1	1	1	0	160.3	40.0	Negative	
9	1	1	1	1	1	0	1	56.8	56.8	Positive	
10	1	1	0	1	1	1	1	84.3	63.7	Positive	
11	1	1	1	1	0	1	1	54.4	74.9	Positive	
12	0	1	1	0	1	1	0	120.4	42.5	Negative	
13	0	1	1	1	1	0	0	170.3	39.3	Negative	
14	1	1	1	1	1	1	1	45.9	52.4	Positive	
15	1	1	1	1	1	1	0	52.4	62.2	Positive	
16	1	1	1	1	1	1	0	53.2	70.9	Positive	
17	0	0	0	1	1	0	1	170.3	40.1	Negative	
18	1	1	0	1	1	1	1	36.4	74.5	Positive	
19	1	1	1	1	1	1	1	51.2	71.8	Positive	
20	1	1	1	0	1	1	1	39.3	64.9	Positive	
21	0	1	1	0	1	1	0	164.1	50.2	Negative	
22	1	1	1	1	1	1	0	45.6	75.4	Positive	
23	1	1	0	1	1	1	0	57.5	60.2	Positive	
24	1	1	1	1	0	1	1	34.6	69.8	Positive	
25	0	1	0	1	1	0	1	78.3	52.5	Negative	
26	1	0	1	1	1	1	0	56.4	60.9	Positive	
27	1	1	1	1	1	1	1	72.3	80.1	Positive	
28	1	1	1	1	0	1	1	45.8	79.0	Positive	
29	0	1	1	1	0	1	0	184.3	45.5	Negative	
30	1	1	0	1	1	1	1	56.3	77.3	Positive	
31	1	0	1	1	1	1	1	54.4	61.1	Positive	
32	1	0	1	1	1	0	1	45.5	66.3	Positive	
33	0	0	1	1	0	1	1	140.4	40.4	Negative	
34	0	0	1	0	1	1	0	56.6	50.6	Negative	
35	1	1	1	1	1	1	0	52.3	58.4	Positive	
36	1	1	1	1	1	1	1	56.7	60.9	Positive	
37	1	1	0	1	0	0	1	109.3	45.0	Positive	
38	1	0	1	1	1	1	1	65.4	90.5	Positive	
39	0	1	1	1	1	1	0	145.4	39.8	Negative	
40	0	1	0	0	1	1	0	178.5	43.4	Negative	
41	1	1	1	1	0	1	1	85.4	86.7	Positive	
42	0	1	1	0	0	1	0	67.5	60.8	Negative	
43	1	1	1	1	1	0	1	45.4	90.1	Positive	
44	1	1	1	1	1	0	0	44.7	67.2	Positive	
45	0	1	1	0	0	0	0	63.6	46.0	Negative	
46	0	1	1	1	1	0	1	155.5	79.0	Positive	
47	1	0	1	1	0	1	1	34.5	88.5	Positive
	
48	0	1	1	1	0	0	1	187.3	40.3	Negative	
49	1	1	1	1	1	1	0	67.5	91.1	Positive	
50	1	1	1	1	1	1	1	44.6	43.2	Positive	

The testing data is randomly selected based on patient data and then tested to find out the accuracy results. A total of 100 patient data were used to predict a new data whose label or class was not yet known based on previous knowledge and learning (training data). The 100 data are divided into 50 testing data and 50 training data.

TABLE 6.  First Trial Results
Data	Data Training	Data Testing	Prediction Result	Accuracy	
100	70	30	1,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1	90 %	

Table 6 shows that of the 100 data divided into 70 training data and 30 testing data with 9 selected parameters, the resulting predictions from 30 data are 1,1,1,0,1,1,1,1,1.1, 1,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1.  A value of 0 represents Negative Dengue Fever and a value of 1 represents Positive  Dengue Fever with an accuracy value of 90%.

TABLE 7. Second Trial Results
Data	Data Training	Data Testing	Prediction Result	Accuracy	
100	50	50	1,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1,0,1,0,0,1,0,1,10,0,1,0,1,0	88 %	

Table 7 shows that from 100 data divided into 50 data training and 50 data testing with 9 parameters then the resulting predictions from 50 data are 1,1,1,0,1,1,1,1,1,1, 1,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1, 0,1,1,1,0,0,1, 1,0,1,0,01,0,1,10,0,1,0,1,0 A value of 0 represents Negative Dengue Fever and a value of  1 represents Positive  Dengue Fever with an accuracy value of  88%.

TABLE 8. Third Trial Result
Data	Data Training	Data Testing	Prediction Result	Accuracy	
100	40	60	1,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0	88,3%	

Table 7 shows that from 100 data divided into 40 data training  and 60 data testing with 9 parameters then the resulting predictions from 50 data are 1,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0  A value of 0 represents Negative Dengue Fever and a value of  1 represents Positive  Dengue Fever with an accuracy value of  88,3%.
CONCLUTION
The results showed that the Naïve Bayes algorithm can be used to predict dengue hemorrhagic fever. This is can be proven from the results of testing the dataset which was carried out three times. The first trial of 70 data training and 30 data testing yields a probability value with an accuracy of 90%. The second trial of 50 data training and 50 data testing yields a probability value with an accuracy of 88%. The third trial of 40 data training 60 data testing yields a probability value with an accuracy of 88.3%. 

ACKNOWLEDGMENTS
Thank you to The Universitas Sulawesi Barat  as an institution that has collaborated in this research.

REFERENCES
[1]	K. Fatmawati and A. P. Windarto, “Data Mining: Penerapan Rapidminer Dengan K-Means Cluster Pada Daerah Terjangkit Demam Berdarah Dengue (Dbd) Berdasarkan Provinsi,” Comput. Eng. Sci. Syst. J., vol. 3, no. 2, p. 173, 2018, doi: 10.24114/cess.v3i2.9661.
[2]	R. Bhuvaneswari and K. Kalaiselvi, “Naive Bayesian Classification Approach in Healthcare Applications,” Int. J. Comput. Sci. Telecommun., vol. 3, no. 1, pp. 106–112, 2012.
[3]	M. Langarizadeh and F. Moghbeli, “Applying naive bayesian networks to disease prediction: A systematic review,” Acta Inform. Medica, vol. 24, no. 5, pp. 364–369, 2016, doi: 10.5455/aim.2016.24.364-369.
[4]	T. Arifin and D. Ariesta, “PREDIKSI PENYAKIT GINJAL KRONIS MENGGUNAKAN ALGORITMA NAIVE BAYES CLASSIFIER BERBASIS PARTICLE SWARM OPTIMIZATION,” J. Tekno Insentif, vol. 13, no. 1, pp. 26–30, Apr. 2019, doi: 10.36787/jti.v13i1.97.
[5]	Duwi Cahya Putri Buani, “Prediksi Penyakit Hepatitis Menggunakan Algoritma Naïve Bayes Dengan Seleksi Fitur Algoritma Genetika,” Evolusi  J. Sains dan Manaj., vol. 6, no. 2, pp. 1–5, 2018, doi: 10.31294/evolusi.v6i2.4381.

Where to Find Further Information 
We warmly invite you to visit our online platform, Scitation, where you can find further help/advice and publishing policies for AIP Conference Proceedings: 
•	For authors:		https://aip.scitation.org/apc/authors/preppapers
•	For conference organizers:	https://aip.scitation.org/apc/organizers/abstracts

Summary: Points to Consider when Preparing Your Paper 

1-	Articles should use 8.5 x 11 single column template.
2-	Use Times New Roman font, the point size will vary by section.
3-	DO NOT alter the margins of our templates. They are carefully designed for AIP’s production process: Altering them can cause significant delays. Paper size should be 8 ½ x 11 with margins set at:Top – 1 inch, Left – 1 inch, Bottom – 1.18 inch, Right – 1 inch.
4-	DO NOT display the title in ALL CAPS (initial cap only)
5-	DO NOT include any headers, footers, or page numbers in your document. They will be added to your article PDF by AIP Publishing, so please do not amend this template to add them to your paper.
6-	Line spacing should be 1.0 throughout the entire article, no double spacing.
7-	Make sure all author affiliation associations are correct.  This means author vs. affiliation and author vs. email address.  If there is only one affiliation for all authors, association is not needed.  Author names should be listed in First name Surname format.
8-	Use clear, legible graphics and diagrams. Readers of your paper will be grateful. If they cannot read it, they are unlikely to cite it.
9-	DO NOT use copyrighted material without permission. Papers using copyrighted material without appropriate permission and acknowledgment will be excluded from the proceedings.
10-	No 1-page papers please. 1-page, abstract-only contributions are not acceptable and will be excluded from the proceedings.
11-	Prepare and format references with care. References should be numbered using Arabic numerals followed by a period (.).
12-	Embed all fonts into your article PDF. The importance of font embedding is discussed in the section Font Embedding (above). PDFs supplied without embedded fonts are often completely unusable for printing or publication purposes. In such cases, we must return those PDFs to the proceedings editors for font embedding. Failure to embed fonts can cause unnecessary inconvenience to your proceedings editor(s) and publication delays for other authors. Failure to provide a replacement paper in a timely fashion may result in an article being removed from the proceedings.
13-	Check your article PDF file! It is not uncommon for errors to appear in PDFs generated from Microsoft Word – corrupted math, figures reflowing, etc. It is essential to very carefully check your article PDF file before sending it to the proceedings editor(s).
14-	Avoid large PDF files (10 MB maximum, ideally). For the benefit of your readers, we recommend keeping your article PDF file below 10 MB. This is a recommendation, not a requirement.