-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexplore_page.py
79 lines (56 loc) · 1.59 KB
/
explore_page.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import pickle
def load_model():
with open('disease_predictor.pkl', 'rb') as file:
data = pickle.load(file)
return data
data = load_model()
ss = data["severity"]
sp = data["precaution"]
df = data["dataframe"]
def graphs():
st.title("Explore")
d = ss.groupby('weight').count()
d.insert(0,'Weight',range(1,1+len(d)))
x2=d['Symptom']
y2=d['Weight']
v = plt.figure(figsize=(10,8))
plt.pie(x2,labels=y2,autopct="%1.1f%%")
plt.legend(title="Severity:")
st.write("""
#
### Pie Chart
On the basis of severity of symptoms.
""")
st.pyplot(v)
st.write("""
Inference:
From the above pie chart we can infer that
- More that 50% of the symptoms lie in the severity rate of 4 and 5(according to the given data).
- Symptoms with most severity and least severity occupy only 5%.
- And the rest covers more than 40% in total.
""")
visual2()
def visual2():
vc=df.copy()
st.write("""
#
### Disease severity dataframe
#
""")
st.dataframe(vc)
st.write("""
#
### Bar graph
On basis of severity of diseases.
""")
st.bar_chart(vc)
st.write("""
Inference:
From the above bar graph we can infer that
- AIDS, piles and urinary tract infection has the highest severity rate of 5.
- Acne and psoriasis has the lowest severity rate of 2.
""")