Spaces:
Build error
Build error
Upload 3 files
Browse files- app.py +38 -0
- prophet_model.pkl +3 -0
- requirements.txt +9 -0
app.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pickle
|
| 3 |
+
import pandas as pd
|
| 4 |
+
from prophet import Prophet
|
| 5 |
+
from prophet.plot import plot_plotly, plot_components
|
| 6 |
+
|
| 7 |
+
# Modeli yükleme fonksiyonu
|
| 8 |
+
def load_model():
|
| 9 |
+
with open('prophet_model.pkl', 'rb') as f:
|
| 10 |
+
model = pickle.load(f)
|
| 11 |
+
return model
|
| 12 |
+
|
| 13 |
+
# Streamlit uygulaması
|
| 14 |
+
st.title("Hava Durumu Tahmini - Prophet Modeli")
|
| 15 |
+
|
| 16 |
+
# Modeli yükle
|
| 17 |
+
model = load_model()
|
| 18 |
+
|
| 19 |
+
# Kullanıcıdan tarih aralığı girişi
|
| 20 |
+
periods = st.number_input("Gelecek gün sayısını girin:", min_value=1, max_value=365, value=30)
|
| 21 |
+
|
| 22 |
+
# Gelecek verileri oluştur
|
| 23 |
+
future = model.make_future_dataframe(periods=periods)
|
| 24 |
+
predictions = model.predict(future)
|
| 25 |
+
|
| 26 |
+
# Tahminleri göster
|
| 27 |
+
st.subheader("Tahmin Sonuçları")
|
| 28 |
+
st.write(predictions[['ds', 'yhat', 'yhat_lower', 'yhat_upper']])
|
| 29 |
+
|
| 30 |
+
# Tahmin sonuçlarını çiz
|
| 31 |
+
st.subheader("Tahmin Grafiği")
|
| 32 |
+
fig = plot_plotly(model, predictions)
|
| 33 |
+
st.plotly_chart(fig)
|
| 34 |
+
|
| 35 |
+
# Bileşen grafiğini çiz (matplotlib kullanarak)
|
| 36 |
+
st.subheader("Bileşen Grafiği")
|
| 37 |
+
components_fig = plot_components(model, predictions)
|
| 38 |
+
st.pyplot(components_fig)
|
prophet_model.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7b1450cb4d8ffabd8215b86d4f95673ff35cb899260cbc5e44cfbee6aa1bcd2b
|
| 3 |
+
size 185138
|
requirements.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
tensorflow
|
| 3 |
+
opencv-python
|
| 4 |
+
scikit-learn
|
| 5 |
+
torch
|
| 6 |
+
torchvision
|
| 7 |
+
matplotlib
|
| 8 |
+
transformers
|
| 9 |
+
sentencepiece
|