Patient diagnosis using Predictive Analytics
In previous post we discussed different levels of Analytics, here we show a practical example of Predictive Analytics. What if Doctors and Patients could not just get a second opinion, but a third and fourth, and fifth, and so on? We believe that our doctors are all medical experts but patient diagnosis using Predictive Analytics can help them to make more informed decisions based on current and historical data.
“Misdiagnosis accounts for about one-third of all medical error. Autopsy studies show that doctors seriously misdiagnose fatal illnesses about 20 percent of the time. “If you look at settled malpractice claims,” Britto said, “diagnosis error is about twice or three times as common as prescription error”.
Ian Ayres; Super Crunchers, How anything can be predicted, page 97
As explained by Ian Ayres, the Doctor’s diagnosis phase by doctors is the most important step in defining the patient’s journey based on the individual patient’s symptoms. When Predictive Analytics are involved in this decision, then additional historical data of similar patient’s symptoms would help the doctors to make more insightful decisions.
In the latest version of FlexRule, we added a new sample project called patient diagnosis using Predictive Analytics. This project demonstrates how a patient’s history at the same medical centre (city area) in a particular time frame would help doctors to make an informed decision for a new patient with a similar list of current symptoms.
The model has three main steps: read historical data, use the Naive Bayes (NB) algorithm to train the model, and, of course, predict the diagnosis.
Reading Patients History
The patient observation dataset has been read from a DataSheet (.CSV file). The dataset contains 20 patients with different symptoms and final diagnoses confirmed by their doctors and through lab tests. For example, the first row, which is patient one, had symptoms like sneezing and a sore throat and therefore was diagnosed with cold. The second row, which is patient two, had symptoms like fatigue, stuffy nose and sneezing, which was also found to be a cold.
Building a Trained Model
In the second step, we train (or reload an existing) predictive model using the Naive Bayes algorithm (NB), which is one of the scalable classification algorithms for these types of dataset. This algorithm has been successfully applied to many medical problems with large amounts of data and features. Now our model is ready to predict the diagnosis for the next patient based on his current symptoms.
Predicting a New Situation
In this step we pass the data of our new patient’s current symptoms to the predictive model. Patient 21 has not been diagnosed by a doctor yet and he has stuffy nose, sneezing, and sore throat:
{
"Fatigue": null,
"Stuffy Nose": "T",
"Sneezing": "T",
"Sore Throat": "T"
}
Based on historical data and the current patient’s symptoms, our predictive model calculates the percentage probability of each disease as shown below:
Conclusion
As the result clearly shows, patient 21 is likely to have a cold with a probability of 74.81%.
The probability of a flu and allergies are 8.76% and 16.41% respectively, which are much lower than the probability of the patient having a cold.
This is a simple example, but it shows how FlexRule and predictive modelling can help a doctor make better quality patient diagnosis.