df=df.replace({'treatments_1':{'Behavioral Therapy, Medications, Support Groups, Inpatient Rehab,Outpatient Rehab':1,
'Antipsychotics,Talk therapy, If nothing else works, physical restraint may be needed':2,
'Cognitive behaviour therapy (CBT)':3,
'Do not smoke, Eat healthy foods, Control blood pressure, Get a cholesterol test, Manage diabetes, Exercise, Maintain a healthy weight, Manage stress':4,
'Gradually increase your daily fiber intake, make sure you drink plenty of fluids, and try to get more exercise':6,
'Eating small meals regularly throughout the day, Managing any illnesses, infections or underlying conditions, Receiving IV nutrients which are liquid vitamins and minerals that you receive through a needle into your vein, Talking with a mental health specialist about your eating habits if they are irregular':7,
'Focus your attention on a distracting activity such as reading, singing, listening to music, gardening, or exercising':9,
'Treating underlying sleep disorders, Lifestyle changes, Address the underlying cause':10,
'Avoid alcohol (including alcohol-based mouthwashes), caffeine and smoking, suck on ice cubes':11,
'Take paracetamol or ibuprofen in appropriate doses to help bring your temperature down, Drink plenty of fluids, particularly water, Avoid alcohol, tea and coffee, Avoid taking cold baths or showers':12,
'Taking rest and drinking plenty of healthy liquids, Eating easily digestible foods, Avoiding spices, carbonated drinks, fried foods, alcohol, and other foods that are gastric irritants, Taking prescribed gastrointestinal medications':13,
'Drink water, Inadequate hydration may lead you to develop a headache,Limit alcohol, Get adequate sleep, Avoid foods high in histamine, Soothe pain with a cold compress':14,
'Find the source, Prioritize sleep, Make time to relax, Meditate, Feed yourself,Move your body':21,
'Stretch the affected area, Massage the affected area with your hands or a massage roller, Stand up and walk around, Apply heat or ice, Put an ice pack together or apply a heating pad, or take a nice warm bath, Take painkillers such as ibuprofen and acetaminophen':22,
'Drinking gradually larger amounts of clear liquids, Avoiding solid food until the vomiting episode has passed, Resting':23,
'Deep brain stimulation, Spinal cord stimulation, Rehabilitation/physical therapy after brain injury or stroke, Spinal surgery':24,
'Rest, Cool compresses over closed eyes, Lightly massaging your eyelids, Gently washing your eyelids':25,
'Oxygen therapy, fluid therapy, pulmonary rehabilitation, Breathing exercises and surgery':26}})
df=df.replace({'treatments_2':{'Behavioral Therapy, Medications, Support Groups, Inpatient Rehab,Outpatient Rehab':1,
'Antipsychotics,Talk therapy, If nothing else works, physical restraint may be needed':2,
'Cognitive behaviour therapy (CBT)':3,
'Do not smoke, Eat healthy foods, Control blood pressure, Get a cholesterol test, Manage diabetes, Exercise, Maintain a healthy weight, Manage stress':4,
'Gradually increase your daily fiber intake, make sure you drink plenty of fluids, and try to get more exercise':6,
'Eating small meals regularly throughout the day, Managing any illnesses, infections or underlying conditions, Receiving IV nutrients which are liquid vitamins and minerals that you receive through a needle into your vein, Talking with a mental health specialist about your eating habits if they are irregular':7,
'Lie down until the dizziness passes, then get up slowly,move slowly and carefully, get plenty of rest, drink plenty of fluids, especially water, avoid coffee, cigarettes, alcohol and drugs':9,
'Treating underlying sleep disorders, Lifestyle changes, Address the underlying cause':10,
'Avoid alcohol (including alcohol-based mouthwashes), caffeine and smoking, suck on ice cubes':11,
'Take paracetamol or ibuprofen in appropriate doses to help bring your temperature down, Drink plenty of fluids, particularly water, Avoid alcohol, tea and coffee, Avoid taking cold baths or showers':12,
'Taking rest and drinking plenty of healthy liquids, Eating easily digestible foods, Avoiding spices, carbonated drinks, fried foods, alcohol, and other foods that are gastric irritants, Taking prescribed gastrointestinal medications':13,
'Drink water, Inadequate hydration may lead you to develop a headache,Limit alcohol, Get adequate sleep, Avoid foods high in histamine, Soothe pain with a cold compress':14,
'Find the source, Prioritize sleep, Make time to relax, Meditate, Feed yourself,Move your body':21,
'Stretch the affected area, Massage the affected area with your hands or a massage roller, Stand up and walk around, Apply heat or ice, Put an ice pack together or apply a heating pad, or take a nice warm bath, Take painkillers such as ibuprofen and acetaminophen':22,
'Drinking gradually larger amounts of clear liquids, Avoiding solid food until the vomiting episode has passed, Resting':23,
'Deep brain stimulation, Spinal cord stimulation, Rehabilitation/physical therapy after brain injury or stroke, Spinal surgery':24,
'Rest, Cool compresses over closed eyes, Lightly massaging your eyelids, Gently washing your eyelids':26,
'Oxygen therapy, fluid therapy, pulmonary rehabilitation, Breathing exercises and surgery':26}})
# Print the shapes of the training and testing sets
print("Training set shape for diseasers_or_side_effects_1 prediction:",X_train_diseasers_or_side_effects_1.shape,y_train_diseasers_or_side_effects_1.shape)
print("Testing set shape for diseasers_or_side_effects_1 prediction:",X_test_diseasers_or_side_effects_1.shape,y_test_diseasers_or_side_effects_1.shape)
print("Training set shape for diseasers_or_side_effects_2 prediction:",X_train_diseasers_or_side_effects_2.shape,y_train_diseasers_or_side_effects_2.shape)
print("Testing set shape for diseasers_or_side_effects_2 prediction:",X_test_diseasers_or_side_effects_2.shape,y_test_diseasers_or_side_effects_2.shape)
print("Training set shape for treatments_1 prediction:",X_train_treatments_1.shape,y_train_treatments_1.shape)
print("Testing set shape for treatments_1 prediction:",X_test_treatments_1.shape,y_test_treatments_1.shape)
print("Training set shape for treatments_2 prediction:",X_train_treatments_2.shape,y_train_treatments_2.shape)
print("Testing set shape for treatments_2 prediction:",X_test_treatments_2.shape,y_test_treatments_2.shape)
# represent the features that will be used to train the models
treatments_1='Behavioral Therapy, Medications, Support Groups, Inpatient Rehab,Outpatient Rehab'
eliftreatments_1_prediction==2:
treatments_1='Antipsychotics,Talk therapy, If nothing else works, physical restraint may be needed'
eliftreatments_1_prediction==3:
treatments_1='Cognitive behaviour therapy (CBT)'
eliftreatments_1_prediction==4:
treatments_1='Do not smoke, Eat healthy foods, Control blood pressure, Get a cholesterol test, Manage diabetes, Exercise, Maintain a healthy weight, Manage stress'
treatments_1='Gradually increase your daily fiber intake, make sure you drink plenty of fluids, and try to get more exercise'
eliftreatments_1_prediction==7:
treatments_1='Eating small meals regularly throughout the day, Managing any illnesses, infections or underlying conditions, Receiving IV nutrients which are liquid vitamins and minerals that you receive through a needle into your vein, Talking with a mental health specialist about your eating habits if they are irregular'
treatments_1='Focus your attention on a distracting activity such as reading, singing, listening to music, gardening, or exercising'
eliftreatments_1_prediction==10:
treatments_1='Treating underlying sleep disorders, Lifestyle changes, Address the underlying cause'
eliftreatments_1_prediction==11:
treatments_1='Avoid alcohol (including alcohol-based mouthwashes), caffeine and smoking, suck on ice cubes'
eliftreatments_1_prediction==12:
treatments_1='Take paracetamol or ibuprofen in appropriate doses to help bring your temperature down, Drink plenty of fluids, particularly water, Avoid alcohol, tea and coffee, Avoid taking cold baths or showers'
eliftreatments_1_prediction==13:
treatments_1='Taking rest and drinking plenty of healthy liquids, Eating easily digestible foods, Avoiding spices, carbonated drinks, fried foods, alcohol, and other foods that are gastric irritants, Taking prescribed gastrointestinal medications'
eliftreatments_1_prediction==14:
treatments_1='Drink water, Inadequate hydration may lead you to develop a headache,Limit alcohol, Get adequate sleep, Avoid foods high in histamine, Soothe pain with a cold compress'
treatments_1='Find the source, Prioritize sleep, Make time to relax, Meditate, Feed yourself,Move your body'
eliftreatments_1_prediction==22:
treatments_1='Stretch the affected area, Massage the affected area with your hands or a massage roller, Stand up and walk around, Apply heat or ice, Put an ice pack together or apply a heating pad, or take a nice warm bath, Take painkillers such as ibuprofen and acetaminophen'
eliftreatments_1_prediction==23:
treatments_1='Drinking gradually larger amounts of clear liquids, Avoiding solid food until the vomiting episode has passed, Resting'
eliftreatments_1_prediction==24:
treatments_1='Deep brain stimulation, Spinal cord stimulation, Rehabilitation/physical therapy after brain injury or stroke, Spinal surgery'
eliftreatments_1_prediction==25:
treatments_1='Rest, Cool compresses over closed eyes, Lightly massaging your eyelids, Gently washing your eyelids'
else:
treatments_1='Oxygen therapy, fluid therapy, pulmonary rehabilitation, Breathing exercises and surgery'
treatments_2='Behavioral Therapy, Medications, Support Groups, Inpatient Rehab,Outpatient Rehab'
eliftreatments_2_prediction==2:
treatments_2='Antipsychotics,Talk therapy, If nothing else works, physical restraint may be needed'
eliftreatments_2_prediction==3:
treatments_2='Cognitive behaviour therapy (CBT)'
eliftreatments_2_prediction==4:
treatments_2='Do not smoke, Eat healthy foods, Control blood pressure, Get a cholesterol test, Manage diabetes, Exercise, Maintain a healthy weight, Manage stress'
treatments_2='Gradually increase your daily fiber intake, make sure you drink plenty of fluids, and try to get more exercise'
eliftreatments_2_prediction==7:
treatments_2='Eating small meals regularly throughout the day, Managing any illnesses, infections or underlying conditions, Receiving IV nutrients which are liquid vitamins and minerals that you receive through a needle into your vein, Talking with a mental health specialist about your eating habits if they are irregular'
treatments_2='Focus your attention on a distracting activity such as reading, singing, listening to music, gardening, or exercising'
eliftreatments_2_prediction==10:
treatments_2='Treating underlying sleep disorders, Lifestyle changes, Address the underlying cause'
eliftreatments_2_prediction==11:
treatments_2='Avoid alcohol (including alcohol-based mouthwashes), caffeine and smoking, suck on ice cubes'
eliftreatments_2_prediction==12:
treatments_2='Take paracetamol or ibuprofen in appropriate doses to help bring your temperature down, Drink plenty of fluids, particularly water, Avoid alcohol, tea and coffee, Avoid taking cold baths or showers'
eliftreatments_2_prediction==13:
treatments_2='Taking rest and drinking plenty of healthy liquids, Eating easily digestible foods, Avoiding spices, carbonated drinks, fried foods, alcohol, and other foods that are gastric irritants, Taking prescribed gastrointestinal medications'
eliftreatments_2_prediction==14:
treatments_2='Drink water, Inadequate hydration may lead you to develop a headache,Limit alcohol, Get adequate sleep, Avoid foods high in histamine, Soothe pain with a cold compress'
treatments_2='Find the source, Prioritize sleep, Make time to relax, Meditate, Feed yourself,Move your body'
eliftreatments_2_prediction==22:
treatments_2='Stretch the affected area, Massage the affected area with your hands or a massage roller, Stand up and walk around, Apply heat or ice, Put an ice pack together or apply a heating pad, or take a nice warm bath, Take painkillers such as ibuprofen and acetaminophen'
eliftreatments_2_prediction==23:
treatments_2='Drinking gradually larger amounts of clear liquids, Avoiding solid food until the vomiting episode has passed, Resting'
eliftreatments_2_prediction==24:
treatments_2='Deep brain stimulation, Spinal cord stimulation, Rehabilitation/physical therapy after brain injury or stroke, Spinal surgery'
eliftreatments_2_prediction==25:
treatments_2='Rest, Cool compresses over closed eyes, Lightly massaging your eyelids, Gently washing your eyelids'
else:
treatments_2='Oxygen therapy, fluid therapy, pulmonary rehabilitation, Breathing exercises and surgery'