Spaces:
Sleeping
Sleeping
salsabilapl
commited on
Commit
•
0c8aa82
1
Parent(s):
5311c98
Update app.py
Browse files
app.py
CHANGED
@@ -10,10 +10,10 @@ import statsmodels.api as sm
|
|
10 |
fitted_model = joblib.load('modelling_all123.sav')
|
11 |
|
12 |
# Streamlit App
|
13 |
-
st.title("
|
14 |
|
15 |
# Date Range Input
|
16 |
-
start_date = st.date_input("
|
17 |
#end_date = st.date_input("Select End Date", pd.to_datetime('2024-01-30'))
|
18 |
|
19 |
# Make predictions based on user input
|
@@ -27,7 +27,7 @@ predictions.columns = ['Prediction Harga Bawang',
|
|
27 |
predictions = predictions.abs()
|
28 |
predictions = predictions.set_index(pd.date_range(start=start_date, periods=len(predictions)))
|
29 |
# Display Predictions Table
|
30 |
-
st.subheader("
|
31 |
st.write(predictions)
|
32 |
|
33 |
# Plotting Predictions
|
@@ -36,9 +36,9 @@ fig, ax = plt.subplots(figsize=(10, 6))
|
|
36 |
for column in predictions.columns:
|
37 |
ax.plot(predictions.index, predictions[column], label=column)
|
38 |
|
39 |
-
ax.set_xlabel("
|
40 |
-
ax.set_ylabel("
|
41 |
-
ax.set_title("
|
42 |
|
43 |
# Show plot in Streamlit
|
44 |
st.pyplot(fig)
|
|
|
10 |
fitted_model = joblib.load('modelling_all123.sav')
|
11 |
|
12 |
# Streamlit App
|
13 |
+
st.title("Aplikasi Prediksi Harga Bawang")
|
14 |
|
15 |
# Date Range Input
|
16 |
+
start_date = st.date_input("Pilih Tanggal Mulai", pd.to_datetime('2024-01-01'))
|
17 |
#end_date = st.date_input("Select End Date", pd.to_datetime('2024-01-30'))
|
18 |
|
19 |
# Make predictions based on user input
|
|
|
27 |
predictions = predictions.abs()
|
28 |
predictions = predictions.set_index(pd.date_range(start=start_date, periods=len(predictions)))
|
29 |
# Display Predictions Table
|
30 |
+
st.subheader("Hasil Prediksi")
|
31 |
st.write(predictions)
|
32 |
|
33 |
# Plotting Predictions
|
|
|
36 |
for column in predictions.columns:
|
37 |
ax.plot(predictions.index, predictions[column], label=column)
|
38 |
|
39 |
+
ax.set_xlabel("Tanggal")
|
40 |
+
ax.set_ylabel("Hasil Prediksi")
|
41 |
+
ax.set_title("Prediksi")
|
42 |
|
43 |
# Show plot in Streamlit
|
44 |
st.pyplot(fig)
|