Commit 950ebf2b authored by IT20161538's avatar IT20161538

new commit

parent 54021086
This source diff could not be displayed because it is too large. You can view the blob instead.
# -*- coding: utf-8 -*-
"""SideEffects_Treatments.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1i7L4_HLgoGTfkpr9SIQUSVN8I2bLhfuG
"""
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
from google.colab import drive
drive.mount('/content/drive/')
# Load the dataset into a Pandas DataFrame
df = pd.read_csv("/content/drive/MyDrive/RPDatasetFinal.csv")
# Import the dataset
#df=pd.read_csv('RPDatasetFinal.csv')
# Check the dimensions of the dataset
print("Dataset dimensions:", df.shape)
# Display column names and data types
print(df.info())
# Check for missing values
print(df.isnull().sum())
# remove rows with missing values
df = df.dropna()
#sum of missing values for each column
print(df.isnull().sum())
# Check for duplicate rows
duplicate_rows = df.duplicated()
# Print the duplicate rows
print(df[duplicate_rows])
# Remove duplicate rows
df = df.drop_duplicates()
# Verify that duplicates have been removed
print(df.duplicated().sum())
#Removing unwanted Columns
useless_col = ['district_name', 'marital_status']
df.drop(useless_col, axis = 1, inplace = True)
# Display column names and data types
print(df.info())
# Calculate summary statistics
print(df.describe())
# Preprocessing Categorical Variables
df = df.replace({'gender': {'Male': 1,
'Female': 2}})
df = df.replace({'drug_type': { 'Heroin': 1,
'Cannabis': 2,
'Opium': 3,
'Hashish': 4,
'Cocaine': 5,
'Methamphetamine': 6}})
df = df.replace({'taking_co-occurring_substances': { 'Yes': 1,
'No': 2}})
df = df.replace({'co-occurring_substances': { 'Cannabis': 1,
'Cocaine': 2,
'Hashish': 3,
'Heroin': 4,
'Methamphetamine': 5,
'Alcohol': 6,
'No': 7}})
df = df.replace({'route_of_administration': { 'Inhalation': 1,
'Injection': 2,
'Smoking': 3}})
df = df.replace({'pre-existing_condision': { 'Yes': 1,
'No': 2}})
df = df.replace({'diseasers_or_side_effects_1': {'Addiction': 1,
'Agitation and restlessness': 2,
'Anxiety and paranoia': 3,
'Cardiovascular effects': 4,
'Cognitive impairments': 5,
'Constipation': 6,
'Decreased appetite': 7,
'Dental issues': 8,
'Dizziness': 9,
'Drowsiness and sedation': 10,
'Dry mouth and throat': 11,
'Elevated body temperature': 12,
'Gastrointestinal problems': 13,
'Headaches': 14,
'Heart attack': 15,
'Hormonal imbalances': 16,
'Hypotension': 17,
'Insomnia': 18,
'Itching and skin infections': 19,
'Liver and kidney damage': 20,
'Mental confusion': 21,
'Muscle spasms': 22,
'Nausea and vomiting': 23,
'Neurological effects': 24,
'Red eyes': 25,
'Respiratory problems': 26}})
df = df.replace({'diseasers_or_side_effects_2': {'Addiction': 1,
'Agitation and restlessness': 2,
'Anxiety and paranoia': 3,
'Cardiovascular effects': 4,
'Cognitive impairments': 5,
'Constipation': 6,
'Decreased appetite': 7,
'Dental issues': 8,
'Dizziness': 9,
'Drowsiness and sedation': 10,
'Dry mouth and throat': 11,
'Elevated body temperature': 12,
'Gastrointestinal problems': 13,
'Headaches': 14,
'Heart attack': 15,
'Hormonal imbalances': 16,
'Hypotension': 17,
'Insomnia': 18,
'Itching and skin infections': 19,
'Liver and kidney damage': 20,
'Mental confusion': 21,
'Muscle spasms': 22,
'Nausea and vomiting': 23,
'Neurological effects': 24,
'Red eyes': 25,
'Respiratory problems': 26}})
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,
'Using remediation techniques, compensatory strategies, adaptive approaches': 5,
'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,
'Fluoride treatments, Tooth extractions, Fillings, Crowns, Root canals': 8,
'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,
'Clot-dissolving drugs (thrombolysis), balloon angioplasty (PCI), surgery': 15,
'Hormone replacement therapy, take oral medication (pills) or injection medication': 16,
'Use more salt, Drink more water, Wear compression stockings': 17,
'Stimulus control therapy, Relaxation techniques, Sleep restriction, Remaining passively awake, Light therapy': 18,
'Antibiotics, Antifungal medications, Moisturizers, Cool compresses, Avoiding triggers': 19,
'Liver transplant': 20,
'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,
'Using remediation techniques, compensatory strategies, adaptive approaches': 5,
'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,
'Fluoride treatments, Tooth extractions, Fillings, Crowns, Root canals': 8,
'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,
'Clot-dissolving drugs (thrombolysis), balloon angioplasty (PCI), surgery': 15,
'Hormone replacement therapy, take oral medication (pills) or injection medication': 16,
'Use more salt, Drink more water, Wear compression stockings': 17,
'Stimulus control therapy, Relaxation techniques, Sleep restriction, Remaining passively awake, Light therapy': 18,
'Antibiotics, Antifungal medications, Moisturizers, Cool compresses, Avoiding triggers': 19,
'Liver transplant': 20,
'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}})
df
import pandas as pd
from sklearn.feature_selection import SelectKBest, chi2, f_classif
#Separate the features and target variables
features = df.drop(columns=['diseasers_or_side_effects_1', 'diseasers_or_side_effects_2', 'treatments_1', 'treatments_2'])
target_diseasers_or_side_effects_1 = df['diseasers_or_side_effects_1']
target_diseasers_or_side_effects_2 = df['diseasers_or_side_effects_2']
target_treatments_1 = df['treatments_1']
target_treatments_2 = df['treatments_2']
#Perform feature selection for 'diseasers_or_side_effects_1'
kbest_diseasers_or_side_effects_1 = SelectKBest(score_func=chi2, k=9) # Select the top 9 features
X_selected_diseasers_or_side_effects_1 = kbest_diseasers_or_side_effects_1.fit_transform(features, target_diseasers_or_side_effects_1)
# Get the selected feature indices for 'diseasers_or_side_effects_1'
selected_feature_indices_diseasers_or_side_effects_1 = kbest_diseasers_or_side_effects_1.get_support(indices=True)
selected_feature_names_diseasers_or_side_effects_1 = features.columns[selected_feature_indices_diseasers_or_side_effects_1]
#Perform feature selection for 'diseasers_or_side_effects_2'
kbest_diseasers_or_side_effects_2 = SelectKBest(score_func=chi2, k=9) # Select the top 9 features
X_selected_diseasers_or_side_effects_2 = kbest_diseasers_or_side_effects_2.fit_transform(features, target_diseasers_or_side_effects_2)
# Get the selected feature indices for 'diseasers_or_side_effects_1'
selected_feature_indices_diseasers_or_side_effects_2 = kbest_diseasers_or_side_effects_2.get_support(indices=True)
selected_feature_names_diseasers_or_side_effects_2 = features.columns[selected_feature_indices_diseasers_or_side_effects_2]
#Perform feature selection for 'treatments_1'
kbest_treatments_1 = SelectKBest(score_func=f_classif, k=9) # Select the top 9 features
X_selected_treatments_1 = kbest_treatments_1.fit_transform(features, target_treatments_1)
# Get the selected feature indices for 'treatments_1'
selected_feature_indices_target_treatments_1 = kbest_treatments_1.get_support(indices=True)
selected_feature_names_target_treatments_1 = features.columns[selected_feature_indices_target_treatments_1]
#Perform feature selection for 'treatments_2'
kbest_treatments_2 = SelectKBest(score_func=f_classif, k=9) # Select the top 9 features
X_selected_treatments_2 = kbest_treatments_2.fit_transform(features, target_treatments_2)
# Get the selected feature indices for 'treatments_2'
selected_feature_indices_target_treatments_2 = kbest_treatments_2.get_support(indices=True)
selected_feature_names_target_treatments_2 = features.columns[selected_feature_indices_target_treatments_2]
# Print the selected feature names for 'diseasers_or_side_effects_1'
print("Selected Features for 'diseasers_or_side_effects_1':")
for feature in selected_feature_names_diseasers_or_side_effects_1:
print(feature)
# Print the selected feature names for 'diseasers_or_side_effects_2'
print("\nSelected Features for 'diseasers_or_side_effects_2':")
for feature in selected_feature_names_diseasers_or_side_effects_2:
print(feature)
# Print the selected feature names for 'treatments_1'
print("Selected Features for 'treatments_1':")
for feature in selected_feature_names_target_treatments_1:
print(feature)
# Print the selected feature names for 'treatments_2'
print("\nSelected Features for 'treatments_2':")
for feature in selected_feature_names_target_treatments_2:
print(feature)
from sklearn.model_selection import train_test_split
# Separate the features and target variables
features_1 = df[['age', 'gender', 'drug_type', 'measures_of_drug_used_per_day(mg)', 'time_used(Month)', 'taking_co-occurring_substances', 'co-occurring_substances', 'route_of_administration', 'pre-existing_condision']]
target_diseasers_or_side_effects_1 = df['diseasers_or_side_effects_1']
target_diseasers_or_side_effects_2 = df['diseasers_or_side_effects_2']
features_2 = df[['age', 'gender', 'drug_type', 'measures_of_drug_used_per_day(mg)', 'time_used(Month)', 'taking_co-occurring_substances', 'co-occurring_substances', 'route_of_administration', 'pre-existing_condision']]
target_treatments_1 = df['treatments_1']
target_treatments_2 = df['treatments_2']
# Split the data for diseasers_or_side_effects_1 prediction
X_train_diseasers_or_side_effects_1, X_test_diseasers_or_side_effects_1, y_train_diseasers_or_side_effects_1, y_test_diseasers_or_side_effects_1 = train_test_split(features_1, target_diseasers_or_side_effects_1, test_size=0.2, random_state=42)
# Split the data for diseasers_or_side_effects_2 prediction
X_train_diseasers_or_side_effects_2, X_test_diseasers_or_side_effects_2, y_train_diseasers_or_side_effects_2, y_test_diseasers_or_side_effects_2 = train_test_split(features_1, target_diseasers_or_side_effects_1, test_size=0.2, random_state=42)
# Split the data for treatments_1 prediction
X_train_treatments_1, X_test_treatments_1, y_train_treatments_1, y_test_treatments_1 = train_test_split(features_2, target_treatments_1, test_size=0.2, random_state=42)
# Split the data for treatments_2 prediction
X_train_treatments_2, X_test_treatments_2, y_train_treatments_2, y_test_treatments_2 = train_test_split(features_2, target_treatments_2, test_size=0.2, random_state=42)
# 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
X = df[['age', 'gender', 'drug_type', 'measures_of_drug_used_per_day(mg)', 'time_used(Month)', 'taking_co-occurring_substances', 'co-occurring_substances', 'route_of_administration', 'pre-existing_condision']]
# represents the target variables
y_diseasers_or_side_effects_1 = df['diseasers_or_side_effects_1']
y_diseasers_or_side_effects_2 = df['diseasers_or_side_effects_2']
y_treatments_1 = df['treatments_1']
y_treatments_2 = df['treatments_2']
# splitting the dataset into training and testing sets for diseasers or side_effects 1 prediction
X_train, X_test, y_train_diseasers_or_side_effects_1, y_test_diseasers_or_side_effects_1 = train_test_split(X, y_diseasers_or_side_effects_1, test_size=0.2, random_state=42)
# splitting the dataset into training and testing sets for diseasers or side_effects 2 prediction
X_train, X_test, y_train_diseasers_or_side_effects_2, y_test_diseasers_or_side_effects_2 = train_test_split(X, y_diseasers_or_side_effects_2, test_size=0.2, random_state=42)
# splitting the dataset into training and testing sets for treatments 1 prediction
X_train, X_test, y_train_treatments_1, y_test_treatments_1 = train_test_split(X, y_treatments_1, test_size=0.2, random_state=42)
# splitting the dataset into training and testing sets for treatments 2 prediction
X_train, X_test, y_train_treatments_2, y_test_treatments_2 = train_test_split(X, y_treatments_2, test_size=0.2, random_state=42)
# Importing the DecisionTreeClassifier class
from sklearn.tree import DecisionTreeClassifier
# Create decision tree classifier
dt_classifier = DecisionTreeClassifier()
# Train the model
# For diseasers_or_side_effects_1 prediction
diseasers_or_side_effects_1_model = DecisionTreeClassifier()
# For diseasers_or_side_effects_2 prediction
diseasers_or_side_effects_2_model = DecisionTreeClassifier()
# For treatments_1 prediction
treatments_1_model = DecisionTreeClassifier()
# For treatments_2 prediction
treatments_2_model = DecisionTreeClassifier()
# 2. Train the models
diseasers_or_side_effects_1_model.fit(X_train, y_train_diseasers_or_side_effects_1)
diseasers_or_side_effects_2_model.fit(X_train, y_train_diseasers_or_side_effects_2)
treatments_1_model.fit(X_train, y_train_treatments_1)
treatments_2_model.fit(X_train, y_train_treatments_2)
# 3. Make predictions
diseasers_or_side_effects_1_predictions = diseasers_or_side_effects_1_model.predict(X_test)
diseasers_or_side_effects_2_predictions = diseasers_or_side_effects_2_model.predict(X_test)
treatments_1_predictions = treatments_1_model.predict(X_test)
treatments_2_predictions = treatments_2_model.predict(X_test)
diseasers_or_side_effects_2_predictions = diseasers_or_side_effects_2_predictions.astype(y_test_diseasers_or_side_effects_2)
treatments_2_predictions = treatments_2_predictions.astype(y_test_treatments_2)
# Example evaluation for diseasers_or_side_effects_1 prediction (classification)
from sklearn.metrics import accuracy_score, precision_score, recall_score
diseasers_or_side_effects_1_accuracy = accuracy_score(y_test_diseasers_or_side_effects_1, diseasers_or_side_effects_1_predictions)
diseasers_or_side_effects_1_precision = precision_score(y_test_diseasers_or_side_effects_1, diseasers_or_side_effects_1_predictions, average='micro')
diseasers_or_side_effects_1_recall = recall_score(y_test_diseasers_or_side_effects_1, diseasers_or_side_effects_1_predictions, average='micro')
# Example evaluation for diseasers_or_side_effects_2 prediction (classification)
diseasers_or_side_effects_2_accuracy = accuracy_score(y_test_diseasers_or_side_effects_2, diseasers_or_side_effects_2_predictions)
diseasers_or_side_effects_2_precision = precision_score(y_test_diseasers_or_side_effects_2, diseasers_or_side_effects_2_predictions, average='micro')
diseasers_or_side_effects_2_recall = recall_score(y_test_diseasers_or_side_effects_2, diseasers_or_side_effects_2_predictions, average='micro')
# Example evaluation for treatments_1 prediction (classification)
treatments_1_accuracy = accuracy_score(y_test_treatments_1, treatments_1_predictions)
treatments_1_precision = precision_score(y_test_treatments_1, treatments_1_predictions, average='micro')
treatments_1_recall = recall_score(y_test_treatments_1, treatments_1_predictions, average='micro')
# Example evaluation for treatments_2 prediction (classification)
treatments_2_accuracy = accuracy_score(y_test_treatments_2, treatments_2_predictions)
treatments_2_precision = precision_score(y_test_treatments_2, treatments_2_predictions, average='micro')
treatments_2_recall = recall_score(y_test_treatments_2, treatments_2_predictions, average='micro')
# Print the evaluation results
print("Diseasers_or_side_effects_1 Accuracy:", diseasers_or_side_effects_1_accuracy)
print("Diseasers_or_side_effects_1 Precision:", diseasers_or_side_effects_1_precision)
print("Diseasers_or_side_effects_1 Recall:", diseasers_or_side_effects_1_recall)
print("Diseasers_or_side_effects_2 Accuracy:", diseasers_or_side_effects_2_accuracy)
print("Diseasers_or_side_effects_2 Precision:", diseasers_or_side_effects_2_precision)
print("Diseasers_or_side_effects_2 Recall:", diseasers_or_side_effects_2_recall)
print("Treatments_1 Accuracy:", treatments_1_accuracy)
print("Treatments_1 Precision:", treatments_1_precision)
print("Treatments_1 Recall:", treatments_1_recall)
print("Treatments_2 Accuracy:", treatments_2_accuracy)
print("Treatments_2 Precision:", treatments_2_precision)
print("Treatments_2 Recall:", treatments_2_recall)
diseasers_or_side_effects_1_model.fit(X, y_diseasers_or_side_effects_1)
diseasers_or_side_effects_2_model.fit(X, y_diseasers_or_side_effects_2)
treatments_1_model.fit(X, y_treatments_1)
treatments_2_model.fit(X, y_treatments_2)
import pandas as pd
import pickle
import numpy as np
# Save the trained model
with open('/content/drive/MyDrive/Research/trained_model.pkl', 'wb') as file:
pickle.dump(diseasers_or_side_effects_1_model, file)
pickle.dump(diseasers_or_side_effects_2_model, file)
pickle.dump(treatments_1_model, file)
pickle.dump(treatments_2_model, file)
# Load the new data
new_person_data = pd.DataFrame({
'age': [45],
'gender': [2],
'drug_type': [1],
'measures_of_drug_used_per_day(mg)': [12],
'time_used(Month)': [15],
'taking_co-occurring_substances': [2],
'co-occurring_substances': [7],
'route_of_administration': [1],
'pre-existing_condision':[1]
})
# Load the trained model
with open('/content/drive/MyDrive/Research/trained_model.pkl', 'rb') as file:
diseasers_or_side_effects_1_model = pickle.load(file)
diseasers_or_side_effects_2_model = pickle.load(file)
treatments_1_model = pickle.load(file)
treatments_2_model = pickle.load(file)
# Make predictions for the new data
diseasers_or_side_effects_1_prediction = diseasers_or_side_effects_1_model.predict(new_person_data)
diseasers_or_side_effects_2_prediction = diseasers_or_side_effects_2_model.predict(new_person_data)
treatments_1_prediction = treatments_1_model.predict(new_person_data)
treatments_2_prediction = treatments_2_model.predict(new_person_data)
# Round the predictions
diseasers_or_side_effects_1_prediction = np.round(diseasers_or_side_effects_1_prediction)
diseasers_or_side_effects_2_prediction = np.round(diseasers_or_side_effects_2_prediction)
treatments_1_prediction = np.round(treatments_1_prediction)
treatments_2_prediction = np.round(treatments_2_prediction)
# Print the predicted Diseasers_or_side_effects
print('Predicted Diseasers or Side Effects 1:', diseasers_or_side_effects_1_prediction)
print('Predicted Diseasers or Side Effects 2:', diseasers_or_side_effects_2_prediction)
print('Predicted Treatments 1:', treatments_1_prediction)
print('Predicted Treatments 2:', treatments_2_prediction)
import pandas as pd
import pickle
# Save the trained model
with open('/content/drive/MyDrive/Research/trained_model.pkl', 'wb') as file:
pickle.dump(diseasers_or_side_effects_1_model, file)
# Load the new data
new_person_data = pd.DataFrame({
'age': [44],
'gender': [1],
'drug_type': [2],
'measures_of_drug_used_per_day(mg)': [2],
'time_used(Month)': [7],
'taking_co-occurring_substances': [1],
'co-occurring_substances': [6],
'route_of_administration': [3],
'pre-existing_condision':[2]
})
# Load the trained model
with open('/content/drive/MyDrive/Research/trained_model.pkl', 'rb') as file:
diseasers_or_side_effects_1_model = pickle.load(file)
# Make predictions for the new data
diseasers_or_side_effects_1_prediction = diseasers_or_side_effects_1_model.predict(new_person_data)
# Round the predictions
diseasers_or_side_effects_1_prediction = np.round(diseasers_or_side_effects_1_prediction)
if diseasers_or_side_effects_1_prediction == 1:
diseasers_or_side_effects_1 = 'Addiction'
elif diseasers_or_side_effects_1_prediction == 2:
diseasers_or_side_effects_1 = 'Agitation and restlessness'
elif diseasers_or_side_effects_1_prediction == 3:
diseasers_or_side_effects_1 = 'Anxiety and paranoia'
elif diseasers_or_side_effects_1_prediction == 4:
diseasers_or_side_effects_1 = 'Cardiovascular effects'
elif diseasers_or_side_effects_1_prediction == 5:
diseasers_or_side_effects_1 = 'Cognitive impairments'
elif diseasers_or_side_effects_1_prediction == 6:
diseasers_or_side_effects_1 = 'Constipation'
elif diseasers_or_side_effects_1_prediction == 7:
diseasers_or_side_effects_1 = 'Decreased appetite'
elif diseasers_or_side_effects_1_prediction == 8:
diseasers_or_side_effects_1 = 'Dental issues'
elif diseasers_or_side_effects_1_prediction == 9:
diseasers_or_side_effects_1 = 'Dizziness'
elif diseasers_or_side_effects_1_prediction == 10:
diseasers_or_side_effects_1 = 'Drowsiness and sedation'
elif diseasers_or_side_effects_1_prediction == 11:
diseasers_or_side_effects_1 = 'Dry mouth and throat'
elif diseasers_or_side_effects_1_prediction == 12:
diseasers_or_side_effects_1 = 'Elevated body temperature'
elif diseasers_or_side_effects_1_prediction == 13:
diseasers_or_side_effects_1 = 'Gastrointestinal problems'
elif diseasers_or_side_effects_1_prediction == 14:
diseasers_or_side_effects_1 = 'Headaches'
elif diseasers_or_side_effects_1_prediction == 15:
diseasers_or_side_effects_1 = 'Heart attak'
elif diseasers_or_side_effects_1_prediction == 16:
diseasers_or_side_effects_1 = 'Hormonal imbalances'
elif diseasers_or_side_effects_1_prediction == 17:
diseasers_or_side_effects_1 = 'Hypotension'
elif diseasers_or_side_effects_1_prediction == 18:
diseasers_or_side_effects_1 = 'Insomnia'
elif diseasers_or_side_effects_1_prediction == 19:
diseasers_or_side_effects_1 = 'Itching and skin infections'
elif diseasers_or_side_effects_1_prediction == 20:
diseasers_or_side_effects_1 = 'Liver and kidney damage'
elif diseasers_or_side_effects_1_prediction == 21:
diseasers_or_side_effects_1 = 'Mental confusion'
elif diseasers_or_side_effects_1_prediction == 22:
diseasers_or_side_effects_1 = 'Muscle spasms'
elif diseasers_or_side_effects_1_prediction == 23:
diseasers_or_side_effects_1 = 'Nausea and vomiting'
elif diseasers_or_side_effects_1_prediction == 24:
diseasers_or_side_effects_1 = 'Neurological effects'
elif diseasers_or_side_effects_1_prediction == 25:
diseasers_or_side_effects_1 = 'Red eyes'
else:
diseasers_or_side_effects_1 = 'Respiratory problems'
# Print the predicted Diseasers_or_side_effects 1
print('Predicted Diseasers or Side Effects 1:', diseasers_or_side_effects_1_prediction)
print(diseasers_or_side_effects_1)
import pandas as pd
import pickle
# Save the trained model
with open('/content/drive/MyDrive/Research/trained_model.pkl', 'wb') as file:
pickle.dump(diseasers_or_side_effects_2_model, file)
# Load the new data
new_person_data = pd.DataFrame({
'age': [44],
'gender': [1],
'drug_type': [2],
'measures_of_drug_used_per_day(mg)': [10],
'time_used(Month)': [12],
'taking_co-occurring_substances': [1],
'co-occurring_substances': [6],
'route_of_administration': [3],
'pre-existing_condision':[2]
})
# Load the trained model
with open('/content/drive/MyDrive/Research/trained_model.pkl', 'rb') as file:
diseasers_or_side_effects_2_model = pickle.load(file)
# Make predictions for the new person's data
diseasers_or_side_effects_2_prediction = diseasers_or_side_effects_2_model.predict(new_person_data)
# Round the predictions
diseasers_or_side_effects_2_prediction = np.round(diseasers_or_side_effects_2_prediction)
if diseasers_or_side_effects_2_prediction == 1:
diseasers_or_side_effects_2 = 'Addiction'
elif diseasers_or_side_effects_2_prediction == 2:
diseasers_or_side_effects_2 = 'Agitation and restlessness'
elif diseasers_or_side_effects_2_prediction == 3:
diseasers_or_side_effects_2 = 'Anxiety and paranoia'
elif diseasers_or_side_effects_2_prediction == 4:
diseasers_or_side_effects_2 = 'Cardiovascular effects'
elif diseasers_or_side_effects_2_prediction == 5:
diseasers_or_side_effects_2 = 'Cognitive impairments'
elif diseasers_or_side_effects_2_prediction == 6:
diseasers_or_side_effects_2 = 'Constipation'
elif diseasers_or_side_effects_1_prediction == 7:
diseasers_or_side_effects_2 = 'Decreased appetite'
elif diseasers_or_side_effects_2_prediction == 8:
diseasers_or_side_effects_2 = 'Dental issues'
elif diseasers_or_side_effects_2_prediction == 9:
diseasers_or_side_effects_2 = 'Dizziness'
elif diseasers_or_side_effects_2_prediction == 10:
diseasers_or_side_effects_2 = 'Drowsiness and sedation'
elif diseasers_or_side_effects_2_prediction == 11:
diseasers_or_side_effects_2 = 'Dry mouth and throat'
elif diseasers_or_side_effects_2_prediction == 12:
diseasers_or_side_effects_2 = 'Elevated body temperature'
elif diseasers_or_side_effects_2_prediction == 13:
diseasers_or_side_effects_2 = 'Gastrointestinal problems'
elif diseasers_or_side_effects_2_prediction == 14:
diseasers_or_side_effects_2 = 'Headaches'
elif diseasers_or_side_effects_2_prediction == 15:
diseasers_or_side_effects_2 = 'Heart attak'
elif diseasers_or_side_effects_2_prediction == 16:
diseasers_or_side_effects_2 = 'Hormonal imbalances'
elif diseasers_or_side_effects_2_prediction == 17:
diseasers_or_side_effects_2 = 'Hypotension'
elif diseasers_or_side_effects_2_prediction == 18:
diseasers_or_side_effects_2_model = 'Insomnia'
elif diseasers_or_side_effects_2_prediction == 19:
diseasers_or_side_effects_2 = 'Itching and skin infections'
elif diseasers_or_side_effects_2_prediction == 20:
diseasers_or_side_effects_2 = 'Liver and kidney damage'
elif diseasers_or_side_effects_2_prediction == 21:
diseasers_or_side_effects_2 = 'Mental confusion'
elif diseasers_or_side_effects_2_prediction == 22:
diseasers_or_side_effects_2 = 'Muscle spasms'
elif diseasers_or_side_effects_2_prediction == 23:
diseasers_or_side_effects_2 = 'Nausea and vomiting'
elif diseasers_or_side_effects_2_prediction == 24:
diseasers_or_side_effects_2 = 'Neurological effects'
elif diseasers_or_side_effects_2_prediction == 25:
diseasers_or_side_effects_2 = 'Red eyes'
else:
diseasers_or_side_effects_2 = 'Respiratory problems'
# Print the predicted Diseasers_or_side_effects 2
print('Predicted Diseasers or Side Effects 2:', diseasers_or_side_effects_2_prediction)
print(diseasers_or_side_effects_2)
import pandas as pd
import pickle
# Save the trained model
with open('/content/drive/MyDrive/Research/trained_model.pkl', 'wb') as file:
pickle.dump(treatments_1_model, file)
# Load the new data
new_person_data = pd.DataFrame({
'age': [44],
'gender': [1],
'drug_type': [2],
'measures_of_drug_used_per_day(mg)': [10],
'time_used(Month)': [12],
'taking_co-occurring_substances': [1],
'co-occurring_substances': [6],
'route_of_administration': [3],
'pre-existing_condision':[2]
})
# Load the trained model
with open('/content/drive/MyDrive/Research/trained_model.pkl', 'rb') as file:
treatments_1_model = pickle.load(file)
# Make predictions for the new data
treatments_1_prediction = treatments_1_model.predict(new_person_data)
treatments_1_prediction = np.round(treatments_1_prediction)
if treatments_1_prediction == 1:
treatments_1 = 'Behavioral Therapy, Medications, Support Groups, Inpatient Rehab,Outpatient Rehab'
elif treatments_1_prediction == 2:
treatments_1 = 'Antipsychotics,Talk therapy, If nothing else works, physical restraint may be needed'
elif treatments_1_prediction == 3:
treatments_1 = 'Cognitive behaviour therapy (CBT)'
elif treatments_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'
elif treatments_1_prediction == 5:
treatments_1 = 'Using remediation techniques, compensatory strategies, adaptive approaches'
elif treatments_1_prediction == 6:
treatments_1 = 'Gradually increase your daily fiber intake, make sure you drink plenty of fluids, and try to get more exercise'
elif treatments_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'
elif treatments_1_prediction == 8:
treatments_1 = 'Fluoride treatments, Tooth extractions, Fillings, Crowns, Root canals'
elif treatments_1_prediction == 9:
treatments_1 = 'Focus your attention on a distracting activity such as reading, singing, listening to music, gardening, or exercising'
elif treatments_1_prediction == 10:
treatments_1 = 'Treating underlying sleep disorders, Lifestyle changes, Address the underlying cause'
elif treatments_1_prediction == 11:
treatments_1 = 'Avoid alcohol (including alcohol-based mouthwashes), caffeine and smoking, suck on ice cubes'
elif treatments_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'
elif treatments_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'
elif treatments_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'
elif treatments_1_prediction == 15:
treatments_1 = 'Clot-dissolving drugs (thrombolysis), balloon angioplasty (PCI), surgery'
elif treatments_1_prediction == 16:
treatments_1 = 'Hormone replacement therapy, take oral medication (pills) or injection medication'
elif treatments_1_prediction == 17:
treatments_1 = 'Use more salt, Drink more water, Wear compression stockings'
elif treatments_1_prediction == 18:
treatments_1 = 'Stimulus control therapy, Relaxation techniques, Sleep restriction, Remaining passively awake, Light therapy'
elif treatments_1_prediction == 19:
treatments_1 = 'Antibiotics, Antifungal medications, Moisturizers, Cool compresses, Avoiding triggers'
elif treatments_1_prediction == 20:
treatments_1 = 'Liver transplant'
elif treatments_1_prediction == 21:
treatments_1 = 'Find the source, Prioritize sleep, Make time to relax, Meditate, Feed yourself,Move your body'
elif treatments_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'
elif treatments_1_prediction == 23:
treatments_1 = 'Drinking gradually larger amounts of clear liquids, Avoiding solid food until the vomiting episode has passed, Resting'
elif treatments_1_prediction == 24:
treatments_1 = 'Deep brain stimulation, Spinal cord stimulation, Rehabilitation/physical therapy after brain injury or stroke, Spinal surgery'
elif treatments_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'
# Print the predicted Treatments 1
print('Predicted Treatments 1:', treatments_1_prediction)
print(treatments_1)
import pandas as pd
import pickle
# Save the trained model
with open('/content/drive/MyDrive/Research/trained_model.pkl', 'wb') as file:
pickle.dump(treatments_2_model, file)
# Load the new data
new_person_data = pd.DataFrame({
'age': [44],
'gender': [1],
'drug_type': [2],
'measures_of_drug_used_per_day(mg)': [10],
'time_used(Month)': [12],
'taking_co-occurring_substances': [1],
'co-occurring_substances': [6],
'route_of_administration': [3],
'pre-existing_condision':[2]
})
# Load the trained model
with open('/content/drive/MyDrive/Research/trained_model.pkl', 'rb') as file:
treatments_2_model = pickle.load(file)
# Make predictions for the new data
treatments_2_prediction = treatments_2_model.predict(new_person_data)
treatments_2_prediction = np.round(treatments_2_prediction)
if treatments_2_prediction == 1:
treatments_2 = 'Behavioral Therapy, Medications, Support Groups, Inpatient Rehab,Outpatient Rehab'
elif treatments_2_prediction == 2:
treatments_2 = 'Antipsychotics,Talk therapy, If nothing else works, physical restraint may be needed'
elif treatments_2_prediction == 3:
treatments_2 = 'Cognitive behaviour therapy (CBT)'
elif treatments_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'
elif treatments_2_prediction == 5:
treatments_2 = 'Using remediation techniques, compensatory strategies, adaptive approaches'
elif treatments_2_prediction == 6:
treatments_2 = 'Gradually increase your daily fiber intake, make sure you drink plenty of fluids, and try to get more exercise'
elif treatments_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'
elif treatments_2_prediction == 8:
treatments_2 = 'Fluoride treatments, Tooth extractions, Fillings, Crowns, Root canals'
elif treatments_2_prediction == 9:
treatments_2 = 'Focus your attention on a distracting activity such as reading, singing, listening to music, gardening, or exercising'
elif treatments_2_prediction == 10:
treatments_2 = 'Treating underlying sleep disorders, Lifestyle changes, Address the underlying cause'
elif treatments_2_prediction == 11:
treatments_2 = 'Avoid alcohol (including alcohol-based mouthwashes), caffeine and smoking, suck on ice cubes'
elif treatments_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'
elif treatments_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'
elif treatments_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'
elif treatments_2_prediction == 15:
treatments_2 = 'Clot-dissolving drugs (thrombolysis), balloon angioplasty (PCI), surgery'
elif treatments_2_prediction == 16:
treatments_2 = 'Hormone replacement therapy, take oral medication (pills) or injection medication'
elif treatments_2_prediction == 17:
treatments_2 = 'Use more salt, Drink more water, Wear compression stockings'
elif treatments_2_prediction == 18:
treatments_2 = 'Stimulus control therapy, Relaxation techniques, Sleep restriction, Remaining passively awake, Light therapy'
elif treatments_2_prediction == 19:
treatments_2 = 'Antibiotics, Antifungal medications, Moisturizers, Cool compresses, Avoiding triggers'
elif treatments_2_prediction == 20:
treatments_2 = 'Liver transplant'
elif treatments_2_prediction == 21:
treatments_2 = 'Find the source, Prioritize sleep, Make time to relax, Meditate, Feed yourself,Move your body'
elif treatments_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'
elif treatments_2_prediction == 23:
treatments_2 = 'Drinking gradually larger amounts of clear liquids, Avoiding solid food until the vomiting episode has passed, Resting'
elif treatments_2_prediction == 24:
treatments_2 = 'Deep brain stimulation, Spinal cord stimulation, Rehabilitation/physical therapy after brain injury or stroke, Spinal surgery'
elif treatments_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'
# Print the predicted Treatments 2
print('Predicted Treatments 2:', treatments_2_prediction)
print(treatments_2)
\ No newline at end of file
.form-container{
margin: 5rem 6rem;
color: #2a2a2a;
.side-effect-wrapper{
width: 95vw;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.form-container form{
width:820px;
height:850px;
padding:20px;
.side-effect-form{
padding: 10px;
margin: 10px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius:6px;
background:#FFF;
box-shadow:0 0 8px #696969;
margin-left:330px;
padding-block: 10px;
width: 45vw;
margin-top: 80px;
}
.form-container label{
text-align: left;
margin-left:50px;
.title{
margin-bottom: 20px;
}
.form-container input{
height: 2rem;
padding: 0 1rem ;
margin-bottom: 2rem;
border-radius: .3rem;
border: 1px solid #2a2a2a ;
.form{
width: 35vw;
height: 750px;
display: flex;
flex-direction: column;
justify-content: start;
gap: 19px;
padding: 5px;
}
.form-container select {
width: 50%;
padding: 6px 20px;
border: none;
border-radius: 2px;
background-color: white;
margin-right: 2px;
border: 1px solid #2a2a2a ;
.input-group{
display: flex;
flex-direction: row;
gap: 10px;
align-items: center;
padding: 5px;
}
.l-radio {
display: inline-block;
margin-right: 2px;
select{
padding: 5px;
}
.gender-radio {
display: inline-block;
margin-right: 2px;
input{
padding: 5px;
}
.gender-container {
.btn-area{
display: flex;
align-items: center;
flex-direction: row;
justify-content: end;
}
.form-container button{
border:0;
outline:0;
height:50px;
width:200px;
border-radius:50px;
color:white;
font-weight:bold;
font-size:0.9rem;
cursor:pointer;
background:black;
margin-left:530px;
.btn{
color: whitesmoke;
background-color: black;
padding-inline: 40px;
padding-block: 10px;
border-radius: 50px;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
-ms-border-radius: 50px;
-o-border-radius: 50px;
cursor: pointer;
margin-right:400px;
}
@media screen and (max-width: 850px){
.form-container{
margin: 4rem 2rem;
color: #2a2a2a;
}
.form-container form{
padding-top: 2rem;
width: 90%;
}
.input-group1{
display: flex;
flex-direction: row;
gap: 10px;
align-items: center;
padding: 5px;
}
\ No newline at end of file
import React from 'react';
import React, { useState } from 'react'
import './SideEffectsAndTreatments.css';
export default function SideEffectsAndTreatments() {
return (
<div className='form-container'>
<form>
<h1>Side Effects & Treatments</h1>
<br/><br/>
<label>Age : <input placeholder='Age'/></label>
<label for="methods">Gender :
<label class="gender-radio">
<input type="radio" name="gender" value="male"/> Male
</label>
<label class="gender-radio">
<input type="radio" name="gender" value="female"/> Female
</label>
</label>
const [age, setAge] = useState('');
const [drugUsageMg, setDrugUsageMg] = useState('');
const [months, setMonths] = useState('');
const [takingCooccurringSubstances, setTakingCooccurringSubstances] = useState('');
const [preExistingmedicalcondition, setPreExistingmedicalcondition] = useState('');
<label>Drug Type :
return (
<div className='side-effect-wrapper'><div className='side-effect-form'><br/>
<h1 className='title'>Side Effect & Treatments</h1><br/>
<form className='form'>
<div className='input-group'>
<label>Age: </label>
<input type='number' placeholder='Age' value={age} onChange={(e)=>{setAge(e.target.value)}}/>
</div>
<div className='input-group'>
<label>Gender: </label>
<input type='radio' name='gender' value='male'/>
<span>Male</span>
<input type='radio' name='gender' value='female'/>
<span>Female</span>
</div>
<div className='input-group'>
<label>Drug Type: </label>
<select name="drugtype">
<option>Choose a Drug Type</option>
<option>Heroin</option>
......@@ -28,24 +33,34 @@ export default function SideEffectsAndTreatments() {
<option>Hashish</option>
<option>Cocaine</option>
<option>Methamphetamine</option>
</select></label>
<br/>
<label>Measures of drug used per day(mg) : <input placeholder='mg'/></label>
<label>Time Used(Month) : <input placeholder='No of months'/></label>
<label>Route of Administration :
</select>
</div>
<div className='input-group'>
<label>Measures of drug used per day(mg): </label>
<input type='number' placeholder='mg' value={drugUsageMg} onChange={(e)=>{setDrugUsageMg(e.target.value)}}/>
</div>
<div className='input-group'>
<label>Time Used(Month): </label>
<input type='number' placeholder='No of months' value={months} onChange={(e)=>{setMonths(e.target.value)}}/>
</div>
<div className='input-group'>
<label>Route of Administration: </label>
<select name="route_of_administration ">
<option>Choose a Route of Administration</option>
<option>Inhalation</option>
<option>Injection</option>
<option>Smoking</option>
</select></label>
<br/>
<label>Taking Co-occurring Substances : <input placeholder=''/></label>
<label>Co-occurring Substances :
</select>
</div>
<div className='input-group'>
<label>Taking Co-occurring Substances: </label>
<input type='radio' name='takingCooccurringSubstances' value='yes' checked={takingCooccurringSubstances === 'yes'} onChange={() => setTakingCooccurringSubstances('yes')}/>
<span>Yes</span>
<input type='radio' name='takingCooccurringSubstances' value='no' checked={takingCooccurringSubstances === 'no'} onChange={() => setTakingCooccurringSubstances('no')}/>
<span>No</span>
</div>
<div className='input-group'>
<label>Co-occurring Substances: </label>
<select name="co-occurringsubstances ">
<option>Choose a Co-occurring Substances</option>
<option>Cannabis</option>
......@@ -55,20 +70,24 @@ export default function SideEffectsAndTreatments() {
<option>Methamphetamine</option>
<option>Alcohol</option>
<option>No</option>
</select></label>
<br/>
</select>
</div>
<div className='input-group'>
<label>Any pre-existing medical conditions?: </label>
<input type='radio' name='preExistingmedicalcondition' value='yes' checked={preExistingmedicalcondition === 'yes'} onChange={() => setPreExistingmedicalcondition('yes')}/>
<span>Yes</span>
<input type='radio' name='preExistingmedicalcondition' value='no' checked={preExistingmedicalcondition === 'no'} onChange={() => setPreExistingmedicalcondition('no')}/>
<span>No</span>
</div>
<label for="methods">Pre-existing medical condition :
<label class="gender-radio">
<input type="radio" name="gender" value="male"/> Yes
</label>
<label class="gender-radio">
<input type="radio" name="gender" value="female"/> No
</label>
</label>
<div className='btn-area'>
<div className='btn'>Predict</div>
</div>
<div className='input-group1'>
<h2>Predictions:</h2>
</div>
<button>Submit</button>
</form>
</div>
</div></div>
)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment