Jiranuwat commited on
Commit
6dde7e1
·
1 Parent(s): 3217373

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -61,8 +61,8 @@ def plotdata(t, s, i,r,R0, e=None):
61
  a.legend()
62
 
63
  plt.tight_layout()
64
-
65
- return fig
66
 
67
  #final model
68
  def SIR(country,t_infective):
@@ -85,7 +85,7 @@ def SIR(country,t_infective):
85
  e = None
86
 
87
 
88
- return plotdata(t, s, i,r,R0),R0,t_infective,gamma,beta
89
 
90
  def main():
91
  st.title("SIR Model for Monkeypox")
@@ -104,11 +104,11 @@ def main():
104
  # Show SIR
105
  SIR_param = SIR(country,recovery)
106
 
107
- st.success(st.pyplot(plt.plot(all_location[country]['total_cases'])))
108
- st.success(st.pyplot(SIR(country,recovery)[0]))
109
  st.success("SIR model parameters for "+str(country)+" is")
110
- st.success("R0 = "+str(SIR_param[1]))
111
- st.success("Beta = "+str(SIR_param[4]))
112
  st.success("Gamma = "+str(SIR_param[3]))
113
 
114
  # Run main()
 
61
  a.legend()
62
 
63
  plt.tight_layout()
64
+ st.pyplot(fig)
65
+
66
 
67
  #final model
68
  def SIR(country,t_infective):
 
85
  e = None
86
 
87
 
88
+ return R0,t_infective,beta,gamma
89
 
90
  def main():
91
  st.title("SIR Model for Monkeypox")
 
104
  # Show SIR
105
  SIR_param = SIR(country,recovery)
106
 
107
+ st.success(st.pyplot(all_location[country]['total_cases']))
108
+ st.success(st.pyplot(SIR(country,recovery)))
109
  st.success("SIR model parameters for "+str(country)+" is")
110
+ st.success("R0 = "+str(SIR_param[0]))
111
+ st.success("Beta = "+str(SIR_param[2]))
112
  st.success("Gamma = "+str(SIR_param[3]))
113
 
114
  # Run main()