Skip to content

To build Prescription model, which help in Prescribing the best drug based on given conditions and sentiment of patients.

Notifications You must be signed in to change notification settings

nihar-max/drug_prescription_using_reviews

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

💊Drugs Prescription using reviews

Since COVID-19 our medical fraternity is in distress, which results in numerous individuals demise. Due to unavailability, so people independently started taking medicines without proper consult which led to even worse condition. In such case Machine Learning can be useful to build the Prescription system that uses the reviews of patients using various NLP techniques and recommend the top drug for given disease.

Number of data points: 161,297
Number of unique drugs: 3,436
Number of disease: 884
Timespan: Apr 2008 - Sep 2017
Attributes: 7

Attribute Information:

  1. UniuqeID -
  2. DrugName - Drug Name
  3. Condition - Patient condition
  4. review - reviews given by patient after drug consumption
  5. ratings - ratings given by patient after drug consumption (0-10)
  6. date - Date when review given by patient
  7. UsefulCount - Number of patient marked it as useful

Target Var:

  1. Drug: Prescribe the best Drug based on sentiment of patients.

Objective:

To build Prescription model, which help in Prescribing the best drug based on given conditions and sentiment of patients.

2. Exploratory Data Analysis

2.1 Distribution of ratings

image

2.3 Number of Ratings per a Year

image Observation: There is a huge spike in ratings from 2014.

2.3 Univariate Analysis on condition using CDF

image Observation: By looking at CDF it seems that out of 800 unique conditions our 90% of data includes only top (50-75) conditions

Q1. What is the 6 most frequent illness condition?

image

Q2. What are 4 most frequently suggested drugs for those top 6 most frequent condition?

image

Q3. What is the 5 Highest Voted drugs by patients?

image

3. Reviews

3.1 Plot Word Clouds

  • Creating Word Cloud for Likes i.e (positive / negative reviews)
  • We can observe the most frequent occuring words for negative / positive reviews

1. Highly Satisfied

image

2.Satisfied

image

3.Highly Unsatisfied

image

Feature Engineering

  • So after loading the data we started with EDA process to understand the data through visualizations and also handles outliers and NaN values.In feature engineering we have created some of the features like rating per year,Last time prescribed drug,rating from 1-10.
  • With help of Natural language processing we tried to understand the sentiment of patient w.r.t.o drug for given condition and calculated sentiment score (0-1) with help of inbult library sentiment_analyzer in NLP.

Scoring Process

  • After EDA & Feature engineering we scaled the data using MinMax scaler and with important features we have applied scoring process by manually adding weights to each feature and calculated score.
  • After that we build the recommender system where by inserting the given condition it will provide top 5 best drugs with higher scores. image

About

To build Prescription model, which help in Prescribing the best drug based on given conditions and sentiment of patients.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published