Priority Pill: A Classification Model Without Machine Learning

Jaival Patel
6 min readJun 6, 2021

Over the past few weeks, I have participated in various hackathons varying from different themes, such as medical transportation to digitalizing farming. Luckily, I was able to come top three with my team in these hackathons! For sure, our solution and our pitch might be great, which is why we came top three, but as I was participating in more and more of these hackathons, I started to see a common theme within them. All the judges from different hackathons love machine learning and seem very fond of it. You might be thinking, “I don’t think that’s true, there’s much more than just machine learning that the judges look at right?” and don’t worry, I thought of the same as well until the results came from all the hackathons I participated in.

I had noticed that most of the projects that won (including us), had a machine learning model integrated within (including ours), more specifically, a classification model. I also saw other projects just for curiosity of how other people did, which to be honest, were really good as well, even though they did not seem to have a machine learning model integrated within. At times, I thought those projects should have won instead of some of the projects that came top three because of their innovation and their real-life applicability. After the hackathons, I got the chance to talk to some of the judges to really understand how the marking scheme in hacakthons work since I was really interested after the results. As the conversation progressed, I asked them about their opinions on machine learning and what advantages a project with a machine learning model has, compared to another project that doesn’t. Surprisingly, most of the answers were very similar to each other; using a machine learning model makes the project's technical side more efficient and, overall, more applicable to real-world situations and applications. Those answers got me thinking a little bit, is it really necessary to always have a machine learning model to do complex tasks, such as classifying, and etc? Is machine learning the only efficient and effective way to create solutions to such complex tasks?

To find an answer, I challenged myself to create a classification model without using machine learning and make it as efficient as a typical machine learning classification model. Hence, I thought that the easiest way to find an answer to my inquiry would be to make a classification model for the healthcare industry, specifically, a model that classified diseases and injuries based its on danger to the patient’s health. The reason why I chose healthcare and more specifically, a classification model that classifies “danger” based on injuries and diseases is because these are the types of typical machine learning classification models that are always present in hackathons. Surprisingly, over the past few hackathons I have been present at, they seem to be very successful despite not being as innovative compared to various other projects that did not receive much success. I figured that by using healthcare as an example; there are many machine learning models that I can compare my model to for performance and accuracy as a reference to get a prominent answer of seeing if there really is an alternative to machine learning models.

Therefore, after completing my hackathons, I spent a week creating a medical software for doctors called Priority Pill.

Priority Pill

Priority Pill is essentially a medical database that allows doctors to track the number of patients that need to be seen. However, sometimes, as a doctor, it can be hard to keep track of all the patients that need to be seen, especially during this COVID-19 crisis. Thus, Priority Pill uses a Priority Queue that automatically classifies and sorts the doctor’s patient order based on the danger of the patient’s injury, disease, and etc.

The Priority Queue is essentially a Max Heap that takes in values ranging from any natural number to infinity. Based on the knowledge of the doctor, the doctor will give a value based on the “danger” of the disease or injury of the patient, and the heap will add the patient to the doctor’s order and will sort and classify the order based on the comparison of the patient’s danger value to the rest of the patients automatically. Moreover, the sorting and classifying will happen every time the doctor either adds a new patient to his order or removes the visited patient to keep the order as accurate as possible because since we are dealing with an underlying array, the order of indices in both the array and the heap are physically different from each other (especially at the start), hence, if the heap is not sorted after every change in the order based on the way the array is sorted, it may remove the wrong patient when the doctor prompts the software to as the software refers to the array to remove the patient, not the heap, thus needing an update of the order of the heap. In other words, the heap is essentially made for the removal of a patient that the doctor has met and the addition of a new patient. All the sorting and classification is done by referencing an array in which the patients’ danger values are present. The software then analyzes and compares patient’s values, which will result in an output from the heap every iteration.

Underlying Heap Data Structure (Priority Queue) (Priority Pill)

Additionally, this software allows doctors to keep track of patients from 9 different hospitals! With the use of the HashMap, doctors can add, view, and remove an order specified to that very Hospital, which can be indicated with just the name they save their patients’ order by (most probably the name of the hospital). With the use of the hash codes, all the doctor’s patient orders are encrypted, making it theoretically almost impossible for other users to access the orders set by the main user. Furthermore, the time complexity of adding, viewing, and removing hospitals are all O(1) making it a very efficient process for the computer, especially for the future as the software will become more powerful with several future updates (for ex, increasing the amount of hospitals the Hashmap can store, and etc). Though, in terms of the overal complexity of the commands and the functions (helper functions not taken into consideration), when it comes to the heap and the user-interaction with the software in general, the time complexity of the software becomes linear.

Hashmap that supports different Hospitals for doctors (Priority Pill)

If you want to more information or want to check out the project yourself, here is the link to my project: https://github.com/GEEGABYTE1/Priority-Pill

All-inclusively, now when I think about this as I am writing this blog, the attempt was really good. The results were great and the software worked just like a typical machine learning classification model. So yes, in reality, there are various different ways (such as, computer science data structures and algorithms) to create solutions to different complex tasks without the use of machine learning. However, when it comes to performance, for sure linear time is considerably a good time compared to other databases (when they are not using machine learning), but it is not as powerful and efficient when you compare it to other basic machine learning classification models. Especially since my classification model is solely based on user-inputs, for now with the current technology, when it comes to applicability to real-life situations and applications, machine learning is the best way to go, especially since machine learning models can take and handle much bigger amounts of inputs compared to both linear and advanced data structures. However, that doesn’t machine learning will be the only efficient and effective way to solve complex problems. With new algorithms and computer science concepts being discovered so frequently, it’s only a matter of time until we can replicate machine learning models with data structures with high accuracy. When we do, it will bring a whole new field of exploration and innovation into the world of technology.

--

--

Jaival Patel

16y/o Computer Scientist x Mathematics Enthusiast. I love to share my research and interest in these two topics so you will see a lot of my blogs about my work!