Skip to content

Latest commit

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Drug Classification

Research

Data: Kaggle.

EDA

The data came from a pharmaceutical company that collected information about patients and the types of medications that ended up being used as treatment. Our task is to use this data to determine what type of medication would be appropriate for a person with a particular set of symptoms and characteristics.

Model Selection

Three machine learning methods were used for this task: KNN, Logistic Regression and Decision Tree. The macro-averaged F1-measure was used for estimate quality, hyperparameters were selected on cross-validation. After conducting a basic EDA, hypothesis and prediction, the following results were obtained:

ScoreKNNLogistic RegressionDecision Tree
CV0.800.950.93
Macro F10.910.940.97

The best quality was obtained using logistic regression and the decision tree. They showed approximately the same results on the cross-validation and on the test sample. For predictions on this data, I personally would use the decision tree, as it gave a higher performance on the macro-averaging of the F1-measure. Also, the tree almost perfectly selected the predicates, which confirmed the earlier hypothesis, indicating good interpretability.

Deployment

This model is designed as a server application. The server runs as a docker container.

How to run

  • Install and run Docker

  • Build Docker image from inside the server directory: docker build -t application .

  • Run Docker container using: docker run -p 5000:5000 -d application

  • Go to localhost:5000 to see the input form.

Input form

Input example:

Age (int)Na_to_K (float)BP_HIGH (binary)BP_LOW (binary)BP_NORMAL (binary)Cholesterol_HIGH (binary)Cholesterol_NORMAL (binary)
2325.35510010

Result:

PredictionProbability
drugY1.0

About

Drug classification model deployed with Docker and Flask

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages