Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -999,27 +999,25 @@ def imputer(filtered_data):
|
|
999 |
return ML(Ml_data, scaler, unscaled_data)
|
1000 |
|
1001 |
|
1002 |
-
filename_1 = "ML_DATA.parquet"
|
1003 |
|
1004 |
-
# Access the token
|
1005 |
-
token = os.environ["HUGGING_FACE_HUB_TOKEN"]
|
1006 |
|
1007 |
-
#
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
def fetch_data_1():
|
1012 |
-
data = pd.read_parquet(local_file_1)
|
1013 |
-
return data
|
1014 |
|
1015 |
|
1016 |
|
1017 |
if analysis_option == 'Machine Learning':
|
1018 |
-
|
1019 |
-
problem =
|
1020 |
st.subheader("_Select Disease_:sunglasses:")
|
1021 |
-
health_option = st.selectbox("_Select Disease_:sunglasses:",[
|
1022 |
-
|
|
|
|
|
|
|
|
|
1023 |
if filtered_data['key_lab2'].notna().any():
|
1024 |
column_list = ['PatientID', 'VisitID', 'GroupedICD'] + list(filtered_data['key_lab2'].iloc[0])
|
1025 |
pivot_data = pd.pivot_table(filtered_data, values='ComponentValue', index=['PatientID', 'VisitID', 'GroupedICD'], columns='ComponentName', aggfunc=lambda x: ', '.join(map(str, x)))
|
@@ -1185,65 +1183,66 @@ if analysis_option == 'Data':
|
|
1185 |
|
1186 |
st.dataframe(data.head(20).style.format({'PatientID': "{:.0f}"}))
|
1187 |
|
1188 |
-
if analysis_option == 'EDA':
|
1189 |
-
age_min = int(data['Age'].min())
|
1190 |
-
age_max = int(data['Age'].max())
|
1191 |
-
age_range = st.sidebar.slider('Select Age Range', age_min, age_max, (age_min, age_max))
|
1192 |
-
data = data[(data['Age'] >= age_range[0]) & (data['Age'] <= age_range[1])].copy()
|
1193 |
-
|
1194 |
-
problem = list(data['Description'].unique())
|
1195 |
st.subheader("_Select Disease_:sunglasses:")
|
1196 |
-
health_option = st.selectbox("_Select Disease_:sunglasses:",[
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1213 |
|
1214 |
-
|
1215 |
-
|
1216 |
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
|
1236 |
-
|
1237 |
-
|
1238 |
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
|
1248 |
|
1249 |
|
|
|
999 |
return ML(Ml_data, scaler, unscaled_data)
|
1000 |
|
1001 |
|
|
|
1002 |
|
|
|
|
|
1003 |
|
1004 |
+
# @st.cache_data()
|
1005 |
+
# def fetch_data_1():
|
1006 |
+
# data = pd.read_parquet(local_file_1)
|
1007 |
+
# return data
|
|
|
|
|
|
|
1008 |
|
1009 |
|
1010 |
|
1011 |
if analysis_option == 'Machine Learning':
|
1012 |
+
repo_id = "Akankshg/ML_DATA"
|
1013 |
+
problem = ['Hypertensive diseases', 'General symptoms', 'Digestive, abdomen symptoms', 'Other dorsopathies', 'Metabolic disorders', 'Health service encounters', 'Diabetes mellitus', 'Chronic lower resp', 'Obesity, hyperalimentation', 'Body mass index (BMI)', 'Communicable hazards', 'Other viral diseases', 'Eyelid, lacrimal disorders', 'Male genital diseases', 'Unclassified pain, Other dorsopathies, Other dorsopathies', 'Circ, resp symptoms', 'Unclassified pain', 'Anticoagulant use', 'Influenza, pneumonia', 'Soft tissue disorders', 'Urinary symptoms', 'Other risk factors', 'Blood exam findings', 'Nutritional disorders', 'Other joint disorders', 'Mycoses', 'Other skin disorders', 'Other health encounters', 'Maternal disorders', 'Reproduction services', 'Other obstetric conditions', 'Gestation weeks', 'Oral, salivary diseases', 'Family, personal hazards', 'Respiratory interstitial diseases', 'Mood disorders', 'Arthrosis', 'Nutritional anaemias', 'Intestinal diseases', 'Med, surg care complications', 'Skin, tissue symptoms', 'Neurotic disorders', 'High-risk pregnancy', 'Female genital disorders', 'Urine exam findings', 'Other joint disorders, Other joint disorders', 'Socioeconomic hazards', 'Maternal care, delivery issues', 'Aplastic anaemias', 'Sexual trans infections', 'Substance use disorders', 'Oesoph, stomach diseases', 'Behavioural syndromes', 'Preg-related disorders', 'Gallbladder, pancreas', 'Pregnancy outcomes', 'Imaging, function findings', 'Episodic disorders', 'Other resp diseases', 'Nervous, musculo symptoms', 'Other dorsopathies, Unclassified pain', 'Spondylopathies', 'External ear diseases', 'Other ear disorders', 'Dermatitis, eczema', 'Polyneuropathies', 'Urinary system diseases', 'Unclassified pain, Other dorsopathies', 'Benign neoplasms', 'Diabetes mellitus, Renal failure', 'Renal failure', 'Thyroid disorders', 'Cognition, emotion symptoms', 'Paralytic syndromes', 'Unclassified pain, Other joint disorders', 'Bone density disorders', 'Other heart diseases', 'Ischaemic heart diseases', 'Delivery', 'Other digestive disorders', 'Viral skin lesions', 'Breast disorders', 'Cerebrovascular diseases', 'Male genital malig', 'Animal force exposures', 'Urolithiasis', 'Erectile dysfunction', 'Other land accidents', 'Visual disturbances', 'Other resp disorders', 'Skin appendage disorders', 'Upper resp infections', 'Benign neoplasms, Benign neoplasms', 'Neurotic disorders, Mood disorders', 'Maternal disorders, Digestive, abdomen symptoms', 'Puerperium complications', 'Childhood disorders', 'Thorax injuries', 'Other eye disorders', 'Conjunctiva disorders, Other resp diseases', 'Conjunctiva disorders', 'Synovium, tendon disorders', 'Renal tubulo diseases', 'Liver diseases', 'Blood alcohol level', 'Labour, delivery complications', 'Family, personal hazards, Family, personal hazards', 'Unspecified trunk injuries', 'Skin infections', 'Pelvic inflammatory diseases', 'Labour complications', 'Unclassified pain, Other joint disorders, Other joint disorders', 'Hernia', 'Vein, lymph disorders', 'Other CNS disorders', 'Blood disorders', 'Renal hypertension', 'Endocrine disorders', 'Infectious agents', 'Specific health procedures', 'Papulosquamous disorders', 'Muscle disorders', 'Schizophrenia disorders', 'Pleura diseases', 'Ocular muscle disorders', 'Other exam findings', 'Intest infect diseases', 'Female genital disorders, Family, personal hazards', 'Middle ear diseases', 'Kidney, ureter disorders', 'Benign neoplasms, Maternal care, delivery issues', 'Pulmonary heart disease', 'Aplastic anaemias, Renal failure', 'Speech, voice symptoms', 'Unspecified behavior neoplasms', 'Soft tissue disorders, Soft tissue disorders', 'Other joint disorders, Unclassified pain, Other joint disorders', 'Viral hepatitis', 'Unclassified pain, Soft tissue disorders', 'In situ neoplasms', 'Chlamydia diseases', 'Unclassified pain, Soft tissue disorders, Soft tissue disorders', 'Haemolytic anaemias', 'Lens disorders', 'Head injuries', 'Nerve disorders', 'Neurotic disorders, Neurotic disorders', 'Other effects', 'Thyroid disorders, Other obstetric conditions', 'Maternal care, delivery issues, Maternal care, delivery issues', 'Polyarthropathies', 'Enteritis, colitis', 'Female genital disorders, Maternal disorders', 'Personality disorders', 'Vitreous, globe disorders', 'Musculoskeletal malformations', 'Abdomen, lumbar injuries', 'Neck injuries', 'Dorsopathies', 'Male genital diseases, Urinary symptoms', 'Glaucoma', 'Knee, lower leg injuries', 'Gestation, growth issues', 'Skin, tissue symptoms, Skin, tissue symptoms', 'Coagulation disorders, Other obstetric conditions', 'Coagulation disorders', 'Immune disorders', 'Diabetes mellitus, Metabolic disorders', 'Circulatory disorders', 'Artery diseases', 'Movement disorders', 'Circulatory malformations', 'Skin malig', 'Maternal disorders, Urinary symptoms', 'General symptoms, General symptoms', 'Breast cancer', 'Urinary malformations', 'Viral hepatitis, Other obstetric conditions', 'Lower resp infections', 'Elbow, forearm injuries', 'Health service encounters, Family, personal hazards', 'Sexual trans infections, Other obstetric conditions', 'CNS malformations', 'Glucose disorders', 'Arthrosis, Arthrosis', 'Digestive organ malig', 'Connective tissue disorders', 'Specified arthritis', 'Genital malformations', 'Myoneural, muscle diseases', 'Other obstetric conditions, Sexual trans infections', 'Sclera, cornea disorders', 'Wrist, hand injuries', 'Renal failure, Diabetes mellitus', 'Hypertensive diseases, Circ, resp symptoms', 'Diabetes mellitus, Other skin disorders', 'Chromosomal abnormalities', 'Unspecified mental disorder', 'Infectious agents, Oesoph, stomach diseases', 'Oesoph, stomach diseases, Oesoph, stomach diseases', 'Respiratory malig', 'Organic mental disorders, Degenerative CNS diseases', 'Med, surg care complications, Family, personal hazards', 'Unclassified pain, Breast disorders', 'Health service encounters, Other health encounters', 'Digestive, abdomen symptoms, Digestive, abdomen symptoms', 'Mechanical force exposures', 'Pregnancy outcomes, Specific health procedures', 'Organic mental disorders, Head injuries', 'Radiation skin disorders']
|
1014 |
st.subheader("_Select Disease_:sunglasses:")
|
1015 |
+
health_option = st.selectbox("_Select Disease_:sunglasses:",[*problem], label_visibility="collapsed")
|
1016 |
+
filename_1 = f'disease_data/{health_option}.parquet'
|
1017 |
+
token = os.environ["HUGGING_FACE_HUB_TOKEN"]
|
1018 |
+
local_file_1 = hf_hub_download(repo_id=repo_id, filename=filename_1,repo_type="dataset", token=token)
|
1019 |
+
filtered_data = pd.read_parquet(local_file_1)
|
1020 |
+
|
1021 |
if filtered_data['key_lab2'].notna().any():
|
1022 |
column_list = ['PatientID', 'VisitID', 'GroupedICD'] + list(filtered_data['key_lab2'].iloc[0])
|
1023 |
pivot_data = pd.pivot_table(filtered_data, values='ComponentValue', index=['PatientID', 'VisitID', 'GroupedICD'], columns='ComponentName', aggfunc=lambda x: ', '.join(map(str, x)))
|
|
|
1183 |
|
1184 |
st.dataframe(data.head(20).style.format({'PatientID': "{:.0f}"}))
|
1185 |
|
1186 |
+
if analysis_option == 'EDA':
|
1187 |
+
problem = ['Health service encounters', 'Diabetes mellitus', 'Chronic lower resp', 'Obesity, hyperalimentation', 'Body mass index (BMI)', 'Eyelid, lacrimal disorders', 'Communicable hazards', 'Hypertensive diseases', 'Soft tissue disorders', 'Urinary symptoms', 'Metabolic disorders', 'Falls', 'Other risk factors', 'Nutritional disorders', 'General symptoms', 'Blood exam findings', 'Other joint disorders', 'Mycoses', 'Other dorsopathies', 'Other skin disorders', 'Diabetes mellitus, Obesity, hyperalimentation', 'Maternal disorders', 'Reproduction services', 'Circ, resp symptoms', 'Other obstetric conditions', 'Gestation weeks', 'Oral, salivary diseases', 'Family, personal hazards', 'Respiratory interstitial diseases', 'Mood disorders', 'Arthrosis', 'Nutritional anaemias', 'Intestinal diseases', 'High-risk pregnancy', 'Female genital disorders', 'Substance use disorders', 'Aplastic anaemias', 'Behavioural syndromes', 'Preg-related disorders', 'Newborn problems', 'Labor,delivery complications', 'Maternal care, delivery issues', 'Neurotic disorders', 'Imaging, function findings', 'Episodic disorders', 'Other resp diseases', 'Unclassified pain', 'Nervous, musculo symptoms', 'Other dorsopathies, Unclassified pain', 'External ear diseases', 'Other ear disorders', 'Dermatitis, eczema', 'Urinary system diseases', 'Digestive, abdomen symptoms', 'Oesoph, stomach diseases', 'Unclassified pain, Other dorsopathies', 'Benign neoplasms', 'Diabetes mellitus, Renal failure', 'Renal failure', 'Cognition, emotion symptoms', 'Paralytic syndromes', 'Unclassified pain, Other joint disorders', 'Bone density disorders', 'Other heart diseases', 'Anticoagulant use', 'Ischaemic heart diseases', 'Delivery', 'Polyneuropathies', 'Other land accidents', 'Other resp disorders', 'Viral skin lesions', 'Skin appendage disorders', 'Other health encounters', 'Other joint disorders, Other joint disorders', 'Renal tubulo diseases', 'Sexual trans infections', 'Socioeconomic hazards', 'Childhood disorders', 'Malnutrition', 'Blood alcohol level', 'Skin, tissue symptoms', 'Pelvic inflammatory diseases', 'Maternal disorders, Digestive, abdomen symptoms', 'Labour complications', 'Thyroid disorders', 'Pregnancy outcomes', 'Unclassified pain, Other joint disorders, Other joint disorders', 'Hernia', 'Other dorsopathies, Soft tissue disorders', 'Liver diseases', 'Vein, lymph disorders', 'Other CNS disorders', 'Blood disorders', 'Renal hypertension', 'Poisoning', 'Conjunctiva disorders', 'Visual disturbances', 'Infectious agents', 'Muscle disorders', 'Fetal, newborn conditions', 'Ocular muscle disorders', 'Middle ear diseases', 'Developmental disorders', 'Urticaria, erythema', 'Neurotic disorders, Mood disorders', 'Intest infect diseases', 'Acne', 'Imaging, function findings, Family, personal hazards', 'Soft tissue disorders, Soft tissue disorders', 'Spondylopathies', 'Specific health procedures', 'Med, surg care complications', 'Unspecified trunk injuries', 'Vein, lymph disorders, Liver diseases', 'Urine exam findings', 'Infectious agents, Other obstetric conditions', 'Other exam findings', 'In situ neoplasms', 'Chlamydia diseases', 'Lens disorders', 'Head injuries', 'Upper resp infections', 'Viral hepatitis', 'Unclassified pain, Soft tissue disorders, Soft tissue disorders', 'Female genital disorders, Maternal disorders', 'Gallbladder, pancreas, Maternal disorders', 'Gallbladder, pancreas', 'Peritoneal diseases', 'Schizophrenia disorders', 'Mental retardation', 'Other eye disorders', 'Breast disorders', 'Musculoskeletal malformations', 'Multi-region injuries', 'Abdomen, lumbar injuries', 'Endocrine disorders', 'Male genital diseases', 'Puerperium complications', 'Sexual trans infections, Maternal disorders', 'Maternal care, delivery issues, Maternal care, delivery issues', 'Haemolytic anaemias', 'Glaucoma', 'Skin infections', 'Polyarthropathies', 'Nerve disorders', 'Papulosquamous disorders', 'Supplementary factors', 'Hypertensive crisis', 'Cerebrovascular diseases', 'Organic mental disorders', 'Degenerative CNS diseases, Organic mental disorders', 'Degenerative CNS diseases', 'Kidney, ureter disorders', 'Immune disorders', 'Erectile dysfunction', 'Circulatory disorders', 'Pleura diseases', 'Hypertensive diseases, Other heart diseases', 'Infectious agents, Pelvic inflammatory diseases', 'Other digestive disorders', 'Speech, voice symptoms', 'Urolithiasis', 'Pulmonary heart disease', 'Enteritis, colitis', 'Thorax injuries', 'Neck injuries', 'Circulatory malformations', 'Coagulation disorders', 'Other effects', 'Artery diseases', 'Influenza, pneumonia', 'Knee, lower leg injuries', 'Dentofacial anomalies', 'Male genital diseases, Urinary symptoms', 'Coagulation disorders, Other obstetric conditions', 'General symptoms, General symptoms', 'Puerperium complications, General symptoms', 'Other dorsopathies, Other obstetric conditions', 'Breast cancer', 'Other joint disorders, Unclassified pain, Other joint disorders', 'Synovium, tendon disorders', 'Toxic effects', 'Other dorsopathies, Other dorsopathies', 'Shoulder, upper arm injuries', 'Other osteopathies', 'Urinary malformations', 'Skin, tissue symptoms, Skin, tissue symptoms', 'Uncertain neoplasms', 'Lower resp infections', 'Conjunctiva disorders, Other resp diseases', 'Elbow, forearm injuries', 'Hypertensive diseases, Other heart diseases, Renal failure', 'Aplastic anaemias, Renal failure', 'Other exam findings, Other exam findings', 'Dorsopathies', 'Maternal disorders, General symptoms', 'Assault', 'Infestations', 'Inner ear diseases', 'Sexual trans infections, Other obstetric conditions', 'Foreign body effects', 'Diabetes mellitus, Artery diseases', 'Emergency U07.1 use', 'Renal failure, Hypertensive diseases', 'Infectious agents, Other resp diseases', 'Female genital disorders, Family, personal hazards', 'Diabetes mellitus, Metabolic disorders', 'Health service encounters, Family, personal hazards', 'Unclassified pain, Other dorsopathies, Other dorsopathies', 'Urinary tract malig', 'Labour, delivery complications', 'Arthrosis, Arthrosis', 'Animal force exposures', 'Gestation, growth issues', 'Genetic susceptibility to neoplasms, Genetic carrier, Genetic susceptibility to neoplasms, Genetic carrier', 'Digestive organ malig', 'Unspecified malig, Unspecified malig', 'Connective tissue disorders', 'Maternal disorders, Urinary symptoms', 'Nerve disorders, Maternal disorders', 'Infectious agents, Maternal disorders', 'Other viral diseases', 'Movement disorders', 'Viral hepatitis, Other obstetric conditions', 'Family, personal hazards, Family, personal hazards', 'Lymphoid, haematopoietic malig', 'Other obstetric conditions, Sexual trans infections', 'Male sexual dysfunction', 'Eye, ear malformations', 'Choroid, retina disorders', 'Gestation weeks, Maternal care, delivery issues', 'Maternal care, delivery issues, Gestation weeks', 'Female genital disorders, Med, surg care complications', 'Other bact diseases', 'General symptoms, Maternal disorders', 'Specified arthritis', 'Movement disorders, Poisoning', 'Female genital malig', 'Systemic atrophies, CNS malformations, Eye, ear malformations, Other malformations, Liver diseases, Mental retardation', 'Breast disorders, Breast disorders', 'Other resp disorders, Other resp disorders', 'Emergency U09.9 use', 'Sclera, cornea disorders', 'Skin infections, Skin infections', 'Perinatal resp, cardio disorders', 'Oesoph, stomach diseases, Circ, resp symptoms', 'Renal failure, Diabetes mellitus', 'Ankle, foot injuries', 'Other malformations', 'Skin malig', 'Unspecified behavior neoplasms', 'Intestinal diseases, Poisoning', 'Musculoskeletal disorders', 'Helminthiases', 'Childhood disorders, Cognition, emotion symptoms', 'Chondropathies', 'Renal tubulo diseases, Male genital diseases', 'Digestive, abdomen symptoms, Digestive, abdomen symptoms, Digestive, abdomen symptoms', 'Bone density disorders, Bone density disorders', 'HIV disease', 'Tuberculosis', 'Other bact diseases, Labour, delivery complications', 'Estrogen receptor status', 'Breast cancer, Estrogen receptor status', 'Infectious agents, Oesoph, stomach diseases', 'Chromosomal abnormalities', 'Female genital disorders, Female genital disorders', 'CNS inflammatory diseases', 'Blood exam findings, Infectious agents', 'Blood exam findings, Blood exam findings', 'Unspecified mental disorder', 'Behavioural syndromes, Unspecified mental disorder', 'Respiratory malig', 'Respiratory malig, Unspecified malig', 'Organic mental disorders, Degenerative CNS diseases', 'Unknown causes of death', 'General symptoms, Mood disorders', 'Genital malformations', 'Maternal care, delivery issues, Genital malformations', 'Unclassified pain, Soft tissue disorders', 'Wrist, hand injuries', 'Viral skin lesions, Other obstetric conditions', 'Poisoning, Circ, resp symptoms', 'Vitreous, globe disorders', 'Health service encounters, Other risk factors', 'Med, surg care complications, Family, personal hazards', 'Optic nerve disorders', 'Diabetes mellitus, Other CNS disorders', 'Postpartum complications', 'Middle ear diseases, Middle ear diseases', 'CNS malformations', 'Genetic carrier status', 'Diabetes mellitus, Urine exam findings', 'Circ, resp symptoms, General symptoms', 'Arthropod-borne fevers', 'Unclassified pain, Breast disorders', 'Soft tissue disorders, Unclassified pain', 'Appendix diseases', 'Neurotic disorders, Behavioural syndromes', 'Renal failure, Renal failure', 'Glucose disorders', 'Sexual trans infections, Sexual trans infections', 'Cognition, emotion symptoms, General symptoms', 'Diabetes mellitus, Other skin disorders', 'Digestive, abdomen symptoms, Digestive, abdomen symptoms', 'Cerebrovascular diseases, Speech, voice symptoms', 'Neurotic disorders, Socioeconomic hazards', 'Other obstetric conditions, Other dorsopathies', 'Other digestive disorders, Family, personal hazards', 'Neurotic disorders, Neurotic disorders', 'Episodic disorders, Episodic disorders', 'Polyarthropathies, Soft tissue disorders', 'Other bact diseases, Urinary system diseases', 'Demyelinating diseases', 'Personality disorders', 'Hip, thigh injuries', 'Renal failure, Aplastic anaemias', 'Gestation, growth issues, Gestation, growth issues', 'Other obstetric conditions, Mycoses', 'Hazardous exposures', 'Thorax injuries, Thorax injuries', 'Elbow, forearm injuries, Elbow, forearm injuries', 'Other spirochaetal dis', 'Diabetes mellitus, Diabetes mellitus', 'Burns, corrosions', 'Oesoph, stomach diseases, Oesoph, stomach diseases', 'Other joint disorders, Soft tissue disorders', 'Other bact diseases, General symptoms', 'Early trauma complications', 'Mechanical force exposures', 'Male genital malig', 'Ocular muscle disorders, Ocular muscle disorders', 'Skin, tissue symptoms, General symptoms', 'Glomerular diseases', 'Infectious agents, Upper resp infections', 'Urine exam findings, Other obstetric conditions', 'Polyarthropathies, Polyarthropathies', 'Benign neoplasms, Maternal care, delivery issues', 'Thyroid malig', 'Genital malformations, Maternal care, delivery issues', 'Infectious arthropathies', 'Pregnancy outcomes, Specific health procedures', 'Female genital disorders, Maternal care, delivery issues', 'Cleft lip, palate', 'Unspecified malig', 'Cognition, emotion symptoms, Mood disorders', 'Liver diseases, Other skin disorders', 'Jaw diseases', 'Substance use disorders, Other obstetric conditions', 'Other skin disorders, Socioeconomic hazards', 'Organic mental disorders, Head injuries', 'Skin infections, Unspecified trunk injuries', 'Specific health procedures, Family, personal hazards', 'Mycoses, Mycoses, Mycoses', 'Maternal disorders, Circ, resp symptoms', 'Oral, salivary diseases, Family, personal hazards', 'Mycoses, Poisoning', 'Family, personal hazards, Family, personal hazards, Family, personal hazards', 'Pedestrian accidents', 'Lung diseases', 'Sequelae of infections', 'Ocular muscle disorders, Ocular muscle disorders, Ocular muscle disorders', 'Self-harm', 'Hypertensive diseases, Renal failure', 'Infectious agents, Other resp disorders', 'Polyarthropathies, Toxic effects', 'Mycoses, Diabetes mellitus', 'Protozoal diseases', 'Other obstetric conditions, Soft tissue disorders', 'Wrist, hand injuries, Self-harm', 'Hip, thigh injuries, Animal force exposures', 'Chronic rheumatic heart', 'Diabetes mellitus, Vitreous, globe disorders', 'Vein, lymph disorders, Other skin disorders', 'Synovium, tendon disorders, Synovium, tendon disorders', 'Radiation skin disorders', 'Choroid, retina disorders, Family, personal hazards', 'Eyelid, lacrimal disorders, Eyelid, lacrimal disorders', 'Family, personal hazards, Nutritional anaemias, Other digestive disorders', 'Infectious agents, Conjunctiva disorders', 'Neurotic disorders, Nervous, musculo symptoms', 'Glucose regulation', 'Other skin disorders, Vein, lymph disorders', 'Cognition, emotion symptoms, Cognition, emotion symptoms', 'Eye, organ burns', 'Immune disorders, Pulmonary heart disease', 'Digestive, abdomen symptoms, Poisoning', 'Movement disorders, Nutritional anaemias', 'Soft tissue disorders, Soft tissue disorders, Soft tissue disorders, Soft tissue disorders', 'Bicycle accidents', 'Chronic lower resp, Chronic lower resp', 'Digestive malformations', 'Multiple burns', 'External prosthetics', 'Myoneural, muscle diseases', 'Soft tissue disorders, Polyarthropathies', 'Other obstetric conditions, Urine exam findings', 'Thyroid disorders, Other obstetric conditions', 'Thyroid disorders, Thyroid disorders', 'Blood exam findings, Poisoning', 'Other skin disorders, Diabetes mellitus', 'Assault by sharp object', 'Other resp diseases, Other resp diseases', 'Mood disorders, Neurotic disorders', 'Multiple burns, Heat, hot exposures', 'Lower resp conditions']
|
|
|
|
|
|
|
|
|
|
|
1188 |
st.subheader("_Select Disease_:sunglasses:")
|
1189 |
+
health_option = st.selectbox("_Select Disease_:sunglasses:",[*problem], label_visibility="collapsed")
|
1190 |
+
repo_id = "Akankshg/ML_DATA"
|
1191 |
+
filename = f'disease_data_EDA/{health_option}.parquet'
|
1192 |
+
|
1193 |
+
token = os.environ["HUGGING_FACE_HUB_TOKEN"]
|
1194 |
+
|
1195 |
+
local_file = hf_hub_download(repo_id=repo_id, filename=filename, repo_type="dataset",token=token)
|
1196 |
+
health_data = pd.read_parquet(local_file)
|
1197 |
+
|
1198 |
+
Sex = health_data.groupby('LegalSex')['PatientID'].nunique().reset_index(name='count')
|
1199 |
+
st.subheader(f"Patients for '{health_option}' by Sex", divider='rainbow')
|
1200 |
+
col1, col2, col3 = st.columns(3)
|
1201 |
+
if 'Male' in Sex['LegalSex'].values:
|
1202 |
+
col1.metric(label="Male", value=Sex[Sex['LegalSex'] == 'Male']['count'].iloc[0])
|
1203 |
+
else:
|
1204 |
+
col1.metric(label="Male", value=0)
|
1205 |
+
if 'Female' in Sex['LegalSex'].values:
|
1206 |
+
col2.metric(label="Female", value=Sex[Sex['LegalSex'] == 'Female']['count'].iloc[0])
|
1207 |
+
else:
|
1208 |
+
col2.metric(label="Male", value=0)
|
1209 |
+
col4, col5 = st.columns(2)
|
1210 |
+
fig2 = funnel_chart(health_data)
|
1211 |
+
col4.plotly_chart(fig2, use_container_width=True)
|
1212 |
|
1213 |
+
fig3 = barplot_lab(health_data)
|
1214 |
+
col5.plotly_chart(fig3, use_container_width=True)
|
1215 |
|
1216 |
+
col6, col7 = st.columns(2)
|
1217 |
+
fig4 = histplot_6(health_data)
|
1218 |
+
col6.plotly_chart(fig4, use_container_width=True)
|
1219 |
|
1220 |
+
fig5 = histplot_7(health_data)
|
1221 |
+
col7.plotly_chart(fig5, use_container_width=True)
|
1222 |
+
|
1223 |
+
col8, col9 = st.columns(2)
|
1224 |
+
fig6 = pie_chart_7(health_data)
|
1225 |
+
col8.plotly_chart(fig6, use_container_width=True)
|
1226 |
|
1227 |
+
fig7 = chart_8(health_data)
|
1228 |
+
col9.plotly_chart(fig7, use_container_width=True)
|
1229 |
+
|
1230 |
|
1231 |
+
col10, col11 = st.columns(2)
|
1232 |
+
fig8 = chart_9(health_data)
|
1233 |
+
col10.plotly_chart(fig8, use_container_width=True)
|
1234 |
|
1235 |
+
fig9 = chart_10(health_data)
|
1236 |
+
col11.plotly_chart(fig9, use_container_width=True)
|
1237 |
|
1238 |
+
col12, col13 = st.columns(2)
|
1239 |
+
fig10 = chart_11(health_data)
|
1240 |
+
col12.plotly_chart(fig10, use_container_width=True)
|
1241 |
|
1242 |
+
fig11 = word_cloud(health_data)
|
1243 |
+
col13.pyplot(fig11, use_container_width=True)
|
1244 |
+
|
1245 |
+
st.dataframe(health_data.head(20).style.format({'PatientID': "{:.0f}"}))
|
1246 |
|
1247 |
|
1248 |
|