salsabilapl commited on
Commit
045c80d
1 Parent(s): c5570d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -24,8 +24,8 @@ import base64
24
 
25
 
26
  # Streamlit UI
27
- st.title('Sales Forecasting App')
28
- st.write("This app uses the SARIMAX model to predict future sales with exogenous variables (temp avg and humidity avg).")
29
 
30
  #Read Dataset
31
 
@@ -50,9 +50,9 @@ last_date = target_train.index[-1]
50
  st.write(last_date)
51
 
52
  # Streamlit UI
53
- st.subheader("Predict sales for the next 7 days?")
54
 
55
- if st.button("Yes"):
56
 
57
  #Fungsi forecast
58
  @st.cache_resource
@@ -102,15 +102,15 @@ if st.button("Yes"):
102
  pred_SARIMAX_selected = selected_rows['pred_SARIMAX']
103
 
104
  # Show the predictions
105
- st.subheader('Predicted Sales for the Next 7 Days')
106
  st.write(pred_SARIMAX_selected)
107
 
108
  # Plot the predictions
109
  plt.figure(figsize=(10, 5))
110
  plt.plot(pred_SARIMAX_selected.index, pred_SARIMAX_selected, label='Predicted Sales', marker='o')
111
- plt.xlabel('Date')
112
- plt.ylabel('Sales')
113
- plt.title('Predicted Sales for the Next 7 Days')
114
  plt.grid()
115
  plt.legend()
116
  st.pyplot(plt)
@@ -120,4 +120,4 @@ if st.button("Yes"):
120
  b64 = base64.b64encode(csv.encode()).decode() # Konversi DataFrame ke base64
121
 
122
  # Show download button
123
- st.markdown(f'<a href="data:file/csv;base64,{b64}" download="hasil_prediksi.csv">Download Prediction (CSV)</a>', unsafe_allow_html=True)
 
24
 
25
 
26
  # Streamlit UI
27
+ st.title('EIS Prediksi Demand Produk UMKM')
28
+ st.write("UDINUS - ASPOO")
29
 
30
  #Read Dataset
31
 
 
50
  st.write(last_date)
51
 
52
  # Streamlit UI
53
+ st.subheader("Memprediksi permintaan produk UMKM Anda 7 hari kedepan?")
54
 
55
+ if st.button("Ya"):
56
 
57
  #Fungsi forecast
58
  @st.cache_resource
 
102
  pred_SARIMAX_selected = selected_rows['pred_SARIMAX']
103
 
104
  # Show the predictions
105
+ st.subheader('Prediksi Permintaan Barang 7 Hari Kedepan')
106
  st.write(pred_SARIMAX_selected)
107
 
108
  # Plot the predictions
109
  plt.figure(figsize=(10, 5))
110
  plt.plot(pred_SARIMAX_selected.index, pred_SARIMAX_selected, label='Predicted Sales', marker='o')
111
+ plt.xlabel('Tanggal')
112
+ plt.ylabel('Penjualan')
113
+ plt.title('Prediksi Permintaan Barang 7 Hari Kedepan')
114
  plt.grid()
115
  plt.legend()
116
  st.pyplot(plt)
 
120
  b64 = base64.b64encode(csv.encode()).decode() # Konversi DataFrame ke base64
121
 
122
  # Show download button
123
+ st.markdown(f'<a href="data:file/csv;base64,{b64}" download="hasil_prediksi.csv">Unduh Hasil Prediksi (CSV)</a>', unsafe_allow_html=True)