Data
From 2004 to date, 115 million prescriptions have been registered at the Iranian Ministry of Health, Food and Drug Administration that Non-communicable Disease Research Center of Tehran University attempts to get a copy of this data for researching purposes. In October 2013 the Ministry gave the non-communicable Disease Research Center a sample of 1412 prescriptions to check the data. These prescriptions are related to Babol University of Medical Sciences clinics that have been administered in June 2010 and all of prescriptions are insured by Social Security Organization and Health Insurance Organization. In this paper we used this sample to develop a model for diagnosing the diseases of prescriptions.
There are no data on the age and the gender and all of prescriptions are prescribed by general physicians. For this reason, only the names of drugs are used for disease detection. Overall, there are 414 different drugs in this data that are used as decision attributes. Due to the limited number of samples and large number of attributes, medications are grouped based on pharmaceutical classifications written in pharmacology books. The designed drug group is approved by a number of physicians and pharmacists. Finally, pharmaceutical drugs are categorized in 60 groups. Then prescriptions are tagged by physicians and pharmacists. The results show that prescriptions are prescribed for 27 different diseases but we decide to focus on ten important diseases and to put the samples of remaining 17 diseases in a class apart. The data is presented in the form of a 1412 * 60 table in which rows represent the prescriptions and columns show drug groups. The data presented in the table is used for the detection of related diseases which are marked by a physician as numbers 1 to 11. In this table, number one is placed in the cells associated with drug groups of each prescription. If a drug fits to two drug groups, number one is placed in the cells of both groups. Also, if two drugs of a prescription belong to a group, in the related cell we place number two.
| Other diseases | Hypothyroidism | Hyperthyroidism | Migraine | Anemia | H. pylori infection | Epilepsy and Seizure | Hypertension | Diabetes | Osteoporosis and calcium deficiency | Asthma | Diseases | |
|---|
| 94 | 100 | 100 | 93.7 | 95.4 | 98.3 | 91.1 | 92 | 99 | 93.9 | 81 | Decision Tree | Sensitivity |
| 96.2 | 100 | 100 | 94.9 | 93.8 | 98.3 | 93.1 | 95.5 | 99 | 94.9 | 85.7 | Support Vector Machine |
| 95.8 | 100 | 100 | 94.9 | 95.4 | 96.6 | 93.1 | 95.5 | 99 | 94.9 | 85.7 | Neural Network | |
| 88.9 | 98.4 | 95.2 | 86.1 | 89.2 | 96.6 | 93.1 | 89.3 | 92.8 | 91.9 | 81.7 | Naïve Bayes | |
| 95.8 | 100 | 100 | 97.5 | 95.4 | 96.6 | 93.1 | 94.6 | 99 | 94.9 | 81 | Logistic Regression | |
| 92.2 | 96.9 | 95.2 | 78.5 | 89.2 | 98.3 | 92.1 | 85.7 | 87.6 | 88.9 | 77 | K-Nearest Neighbor | |
| 96.3 | 99.9 | 99.9 | 99.8 | 99.2 | 99.9 | 98.9 | 99.4 | 100 | 99.98 | 98.6 | Decision Tree | Specificity |
| 96.8 | 100 | 100 | 99.99 | 99.2 | 100 | 99.5 | 99.5 | 100 | 99.8 | 99.2 | Support Vector Machine |
| 96.6 | 100 | 99.9 | 99.9 | 99.3 | 99.9 | 99.6 | 99.6 | 100 | 99.9 | 99.1 | Neural Network | |
| 95.1 | 100 | 99.9 | 98.9 | 99.3 | 98.7 | 98.6 | 99.1 | 99.8 | 99.5 | 98.4 | Naïve Bayes | |
| 95.9 | 100 | 99.9 | 99.4 | 99.3 | 99.9 | 99.7 | 99.8 | 100 | 99.7 | 99.3 | Logistic Regression | |
| 92.1 | 99.9 | 99.9 | 99.5 | 99.1 | 99.8 | 99.2 | 98.9 | 99.8 | 99.5 | 98.1 | K-Nearest Neighbor | |
| 94.1 | 98.5 | 98.4 | 97.4 | 84.9 | 98.3 | 86.8 | 92.8 | 100 | 96.9 | 85 | Decision Tree | |
| 95 | 100 | 100 | 98.7 | 84.7 | 100 | 94 | 93.9 | 100 | 96.9 | 91.5 | Support Vector Machine | Precision |
| 94.8 | 100 | 98.4 | 98.7 | 86.1 | 96.6 | 94.9 | 95.5 | 100 | 98.9 | 90.8 | Neural Network |
| 92.1 | 100 | 98.3 | 81.9 | 86.6 | 77 | 83.9 | 89.3 | 97.8 | 93.8 | 83.7 | Naïve Bayes | |
| 93.8 | 100 | 100 | 90.6 | 87.3 | 98.3 | 95.9 | 98.1 | 100 | 95.9 | 91.9 | Logistic Regression | |
| 88.1 | 98.4 | 98.3 | 91.2 | 82.9 | 95.1 | 84.9 | 87.3 | 97.7 | 92.6 | 80.2 | K-Nearest Neighbor | |
Classification techniques
Decision Tree
Decision Tree is a simple and fast way for classification. Decision Tree consists of nodes in which attributes are tested. At the end of each branch, the final nodes represent different classes (
16). Basic algorithm of Decision Tree is ID3. ID3 algorithm begins with this question: which attribute must be selected for development? A statistical test is used to determine how much each attribute alone is able to classify samples. This statistical test is called Information Gain. For obtaining Information Gain, entropy must be calculated. Entropy specifies the homogeneity or lack of homogeneity of the sample set. With entropy, as a tool for measuring the degree of homogeneity of a set of training examples, we can obtain Information Gain. ID3 continues until all samples belonging to a class or the best Information Gain would not exceed zero. But sometimes noisy data and the low number of samples may lead to over fitting. The C4.5 algorithm is the new version of ID3 algorithm which is a pruning based method to avoid over fitting. This method not only prevents over fitting but also is able to manage missing values (
17).
Support Vector Machine (SVM)
SVM is basically a binary classifier that separates two classes using a linear boundary. This method is less prone to over-fitting and is suitable for high-dimension data (
16). The SVM uses an optimization algorithm to determine the samples that form the boundaries of classes. These samples are called Support Vectors. A number of training samples that have the shortest distance from the decision boundary can be considered as a subset to define decision boundaries and Support Vectors. When classes overlap, separating them via linear decision boundaries will result in some errors. To solve this problem, SVM uses a nonlinear transformation to move data from the original space to a new space with more dimensions. So, in the new space, there are less confrontation between classes (
18).
As previously mentioned, Support Vector Machine is a binary classifier. So when there are more than two classes, it cannot be used directly. In general, for using binary classifiers in multiclass cases several binary classifiers must be designed. The final classifier is achieved by merging single binary classifiers (
19).
Logistic Regression
Logistic Regression is a linear function for binary classification. This model is similar to linear regression, however, instead of using parameter estimation method, it uses the maximum likelihood estimation method to minimize errors. In addition, in linear regression the answer is achieved by linear combination of independent variables. Nevertheless, Logistic Regression uses linear combination of logit function (
1) to estimate the probability of classification in each category. (
1) It has always a value between 0 and 1. In this equation
indicates the parameters of the problem that are changed to fit the data and make the best predictions (
20).
As mentioned above, Logistic Regression is used for binary classification. Multinomial Logistic Regression is the generalized version of Logistic Regression that is used to predict the probability of more than two modes. To calculate Polynomial Logistic Regression, it is assumed that there are separate binary regressions as many as the likely outcomes (
21).
Neural Networks
The main idea of Neural Network is derived from the performance of the human brain. Each Neural Network consists of a number of neurons that are connected to each other. These neurons and communications between them determine the behavior of the network. Selecting the type of network depends on the nature of the problem. The most common type of Neural Network is Gradient-based Back Propagation network. This network consists of three or more layers of neurons: an input layer, an output layer, and hidden layers. In most cases only a hidden layer is used to reduce the time of computation, especially when the results are satisfying. In these networks, all the neurons of a layer are connected to the neurons of the next layer by a line of communication. A weight ratio is given to any line of communication between neurons. These weights changes by repeating learning process based on inputs and outputs of each step. In each training time, weights change to minimize the response error. Training continues until the sum of error squares reach the minimum (
22).
Neural Network is a suitable method for noisy and incomplete data set and it has the capability of managing missing values. This method can generalize obtained rules to similar cases even when there is a little information about features and classes (
16).
Naïve Bayes
Bayesian networks are graphical models that show the relationship between a set of attributes. This method calculates the probability of the membership of a sample in a class using Bayes theory. One of the benefits of this method is its computing speed. Furthermore, there is no special parameter to optimize or repeat simulations. In addition, its concepts are easily understandable. This method is suitable for large datasets (
16).
Naïve Bayes classifier is a simple Bayesian network which assumes the attributes involved in decision making are independent. That is why it is called Naïve. In other words, the Naïve Bayes theory assumes that the impact of the value of an attribute on a class is independent of the value of the other attributes. This assumption is called the conditional independence and has been set to simplify the calculations (
23).
Theoretically the error rate of Bayesian classifier is less than the other classification methods. But in practice, because of the conditional independence assumption, it is not always true. In general, Bayesian methods are less accurate than the other methods (
16).
Nearest Neighbor: The Nearest Neighbor algorithm is one of the simplest methods of data. This method assumes that objects that are close to each other can be in the same category. K-Nearest Neighbor (KNN) is one of the Nearest Neighbor methods that use
K adjacent neighbors to determine the new object class. Firstly, in this algorithm
K is determined. Then, the distance of inputting sample from all training samples is calculated. After this, training samples are sorted based on their distance and
K -Nearest Neighbors are selected. Finally, output of the new sample is determined based on majority vote of
K nearest samples (
24).
Nearest Neighbor algorithm is easy to understand and implement and has a good speed. Moreover, it is suitable for a data with a high class number. But, with increasing the number of Nearest Neighbors involved in classification, the computational cost of this method increases. This method gives the same weight to all attributes. This may lead to confusion and reduce the accuracy when unrelated attributes exist in the data. To avoid this problem weighted attributes can be used or the noisy samples can be eliminated. In this method, the correct classification of a sample depends on the structure of the local data. On the other hand this method needs large memories. Also due to the lack of a certain method to determine
K, a validation method is used and this issue leads to an increased computational cost (
16).
Naïve method
Naïve methods are usually used to evaluate the results of sophisticated methods. We develop a Naïve method that operated based on shared drug groups between each prescription and diseases. To implement the desired Naïve method, first, a table with a dimension of 11×60 is created in which rows show the diseases and columns represent the drug groups. In each row we wrote number 1 in the cells of drug groups that are related to a specific disease, and in the remaining cells we place 0. Then, all prescriptions are read in turn and the numbers of shared drug groups between prescriptions and each disease are obtained based on the designed table. Since there is different numbers of effective drug groups in identifying diseases, comparing the number of shared drug groups did not help to diagnose the correct disease. Therefore, we decide to normalize numbers via Eq. (
2). In this equation
represents the number of shared drug groups between prescription
i and disease
j,
is the number of drug groups of prescription
i and
is the number of drug groups of disease
j.
After obtaining the normalized numbers, the prescription is tagged with the disease with the largest average.
Combining Techniques
In recent years, researchers have tried to figure out what is the best method of combining a group of classifiers to obtain better estimations. In fact, the most important result obtained from the integrity of the data mining algorithms is to increase the precision. Another important advantage of combining data mining algorithms is that the results achieved from combining a few simple algorithms is usually better than a single sophisticated data mining algorithm.
Voting: Voting is one of the easiest and most common ways to combine the output of various data mining algorithms. According to this method, to classify a new instance:
first, the class of instances is determined separately using each classifier
Then, the final class is determined by majority vote of classifiers.
In weighted voting, a weight is given to each classifiers according to its accuracy (
25).
Figure 1 shows how a weighted voting algorithm works (
26).
Stacking: Stacking is another combining method that uses an additional layer to combine the outputs of classifiers (
27). Suppose
D is the data and
is a set of
N learning algorithms. During the
J-Fold cross validation process,
D is randomly divided into
J different part
with the same size. At every stage
J,
N data mining algorithm are trained with
sample and training results are tested.
The prediction of each algorithm along with actual class of each sample (
) form the next layer of stacking algorithm. At the end of cross validation process forms the complete data of the next layer. This data is given to the data mining algorithm
for determining the final classes of the data.
can be one of the previous layer algorithms or a different algorithm (
25).
Weighted Voting algorithm