commited on
Commit
136cc9d
·
verified ·
1 Parent(s): 5d3195f

Upload 5 files

Browse files
Google Trends Zaman Serisi Analizi AI Tahmini.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
README.md CHANGED
@@ -1,20 +1,38 @@
1
- ---
2
- title: Google Trends Ai
3
- emoji: 🚀
4
- colorFrom: red
5
- colorTo: red
6
- sdk: docker
7
- app_port: 8501
8
- tags:
9
- - streamlit
10
- pinned: false
11
- short_description: Streamlit template space
12
- license: mit
13
- ---
14
-
15
- # Welcome to Streamlit!
16
-
17
- Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
18
-
19
- If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
20
- forums](https://discuss.streamlit.io).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 📈 Google Trends AI Zaman Serisi Analizi ve Tahmini
2
+
3
+ Bu uygulama, Google Trends verilerini kullanarak belirli bir anahtar kelimenin son 5 yıldaki popülerliğini analiz eder ve Prophet modeli ile geleceğe yönelik tahmin yapar.
4
+
5
+ ## 🚀 Özellikler
6
+
7
+ - Google Trends üzerinden veri çekme (pytrends)
8
+ - Son 5 yıllık zaman serisi grafiği
9
+ - CSV formatında veri indirme
10
+ - Prophet ile gelecek 30 günü tahmin etme
11
+ - Streamlit arayüzü üzerinden etkileşimli kullanım
12
+
13
+ ## 🧠 Kullanılan Teknolojiler
14
+
15
+ - Python
16
+ - Streamlit
17
+ - Pytrends
18
+ - Prophet
19
+ - Pandas & Matplotlib
20
+
21
+ ## ▶️ Kullanım
22
+
23
+ 1. Anahtar kelimeyi girin (örnek: `AI`, `Machine Learning`, `Python`).
24
+ 2. `Veriyi Getir ve Tahmin Yap` butonuna tıklayın.
25
+ 3. Son 5 yılın trend verisi ve gelecek 30 günün tahmin grafiği görüntülenecektir.
26
+ 4. Veriyi CSV olarak indirebilirsiniz.
27
+
28
+ ## 📦 Kurulum (lokal çalıştırmak için)
29
+
30
+ ```bash
31
+ pip install -r requirements.txt
32
+ streamlit run app.py
33
+
34
+
35
+ Lisans
36
+ MIT License – Bu proje yalnızca eğitim amaçlıdır.
37
+
38
+ ---
Screenshot_1.png ADDED
app.py ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import matplotlib.pyplot as plt
4
+ from pytrends.request import TrendReq
5
+ from prophet import Prophet
6
+
7
+ # Sayfa ayarları
8
+ st.set_page_config(page_title="Google Trends Analizi", layout="centered")
9
+
10
+ # Başlık
11
+ st.title("📈 Google Trends Zaman Serisi Analizi ve Tahmini")
12
+ st.write("Son 5 yıldaki Google arama trendlerini analiz edin ve geleceğe yönelik tahmin alın.")
13
+
14
+ # Anahtar kelime girişi
15
+ keyword = st.text_input("Anahtar Kelime Girin:", value="AI")
16
+
17
+ # Butona basıldığında işlem başlasın
18
+ if st.button("🔍 Veriyi Getir ve Tahmin Yap"):
19
+ with st.spinner("Google Trends verisi alınıyor..."):
20
+ try:
21
+ pytrends = TrendReq(hl='en-US', tz=360,)
22
+ pytrends.build_payload([keyword], cat=0, timeframe='today 5-y')
23
+ df = pytrends.interest_over_time()
24
+
25
+ if df.empty:
26
+ st.warning("❌ Bu anahtar kelime için veri bulunamadı.")
27
+ else:
28
+ df = df.drop(labels=['isPartial'], axis=1)
29
+
30
+ # Ham veriyi göster
31
+ st.subheader("📊 Ham Veri")
32
+ st.dataframe(df.tail())
33
+
34
+ # Zaman serisi grafiği
35
+ st.subheader("📈 Trend Grafiği")
36
+ fig, ax = plt.subplots()
37
+ ax.plot(df.index, df[keyword], label=keyword)
38
+ ax.set_xlabel("Tarih")
39
+ ax.set_ylabel("İlgi (0-100)")
40
+ ax.set_title(f"Google Trends: {keyword}")
41
+ ax.legend()
42
+ st.pyplot(fig)
43
+
44
+ # CSV indir
45
+ csv = df.to_csv().encode('utf-8')
46
+ st.download_button(
47
+ label="⬇️ Veriyi CSV Olarak İndir",
48
+ data=csv,
49
+ file_name=f"{keyword}_trends.csv",
50
+ mime='text/csv'
51
+ )
52
+
53
+ # Prophet için veri hazırlığı
54
+ st.subheader("🔮 Prophet ile 30 Günlük Tahmin")
55
+ prophet_df = df.reset_index()[['date', keyword]]
56
+ prophet_df.columns = ['ds', 'y']
57
+
58
+ model = Prophet()
59
+ model.fit(prophet_df)
60
+
61
+ future = model.make_future_dataframe(periods=30)
62
+ forecast = model.predict(future)
63
+
64
+ # Tahmin grafiği
65
+ fig2 = model.plot(forecast)
66
+ st.pyplot(fig2)
67
+
68
+ st.subheader("📅 Tahmin Tablosu (Son 30 Gün)")
69
+ st.dataframe(forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail(30))
70
+
71
+ except Exception as e:
72
+ st.error(f"🚨 Hata oluştu: {str(e)}")
requirements.txt CHANGED
@@ -1,3 +1,5 @@
1
- altair
2
- pandas
3
- streamlit
 
 
 
1
+ streamlit
2
+ pytrends
3
+ pandas
4
+ matplotlib
5
+ prophet