ESMATUGBA commited on
Commit
3ef31b7
·
verified ·
1 Parent(s): e8712f9

Upload 4 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ gold_analysis_pairplot.png filter=lfs diff=lfs merge=lfs -text
app.py ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import matplotlib.pyplot as plt
4
+ import seaborn as sns
5
+
6
+ # Sayfa Genişlik Ayarı
7
+ st.set_page_config(layout="wide", page_title="Gold Analysis Dashboard")
8
+ plt.style.use('dark_background')
9
+
10
+ # 1. VERİ YÜKLEME
11
+ @st.cache_data
12
+ def load_data():
13
+ df = pd.read_csv("gld_price_data.csv")
14
+ df['Date'] = pd.to_datetime(df['Date'])
15
+ df['YEAR'] = df['Date'].dt.year
16
+ return df
17
+
18
+ df = load_data()
19
+
20
+ # 2. SOL PANEL (SIDEBAR) - TIKLAYARAK SEÇME
21
+ st.sidebar.markdown("# 📅 Filtreler / Filters")
22
+ years_list = sorted([y for y in df['YEAR'].unique() if y >= 2008])
23
+
24
+ year = st.sidebar.selectbox(
25
+ "Yıl Seçin / Select Year",
26
+ options=years_list,
27
+ index=0
28
+ )
29
+
30
+ filtered_df = df[df['YEAR'] == year]
31
+
32
+ # 3. ANA BAŞLIK (BÜYÜK BOYUT)
33
+ st.markdown("<h1 style='text-align: center;'>Gold Price Analysis / Altın Fiyat Analizi</h1>", unsafe_allow_html=True)
34
+ st.divider()
35
+
36
+ # 4. YÖNETİCİ BİLGİ NOTU (İSTEĞİN ÜZERİNE EN ÜSTTE)
37
+ st.markdown("## 💼 Yönetici Bilgi Notu / Executive Summary") # ## ile başlık büyütüldü
38
+ info_col1, info_col2 = st.columns(2)
39
+
40
+ if year == 2008:
41
+ with info_col1:
42
+ st.warning("### 🇹🇷 2008'de altın güvenli limandır, alım faydalıdır.") # Yazı boyutu büyütüldü
43
+ with info_col2:
44
+ st.warning("### 🇺🇸 Gold is a safe haven in 2008; buying is beneficial.")
45
+ else:
46
+ with info_col1:
47
+ st.success(f"### 🇹🇷 {year} yılı verileri istikrarlı görünüyor.")
48
+ with info_col2:
49
+ st.success(f"### 🇺🇸 Data for {year} appears stable.")
50
+
51
+ st.divider()
52
+
53
+ # 5. ANA GRAFİK: ZAMAN SERİSİ (KÜÇÜLTÜLMÜŞ)
54
+ st.markdown(f"## 📈 {year} Analizi / Analysis")
55
+
56
+ fig1, ax1 = plt.subplots(figsize=(8, 2.5))
57
+ ax1.plot(filtered_df['Date'], filtered_df['GLD'], color='gold', linewidth=1.5)
58
+ ax1.fill_between(filtered_df['Date'], filtered_df['GLD'], color='gold', alpha=0.1)
59
+
60
+ # Eksen ayarı
61
+ y_min, y_max = filtered_df['GLD'].min(), filtered_df['GLD'].max()
62
+ ax1.set_ylim(y_min * 0.98, y_max * 1.02)
63
+
64
+ st.pyplot(fig1)
65
+
66
+ # GRAFİK NOTU (DAHA BÜYÜK VE OKUNAKLI)
67
+ st.markdown(f"#### 📝 Not: Bu grafik {year} yılındaki günlük fiyat hareketlerini gösterir. / Note: This chart shows daily price movements in {year}.")
68
+
69
+ st.divider()
70
+
71
+ # 6. DİĞER GRAFİKLER (YAN YANA)
72
+ col_left, col_right = st.columns(2)
73
+
74
+ with col_left:
75
+ st.markdown("### 🎯 Dağılım / Distribution")
76
+ fig2, ax2 = plt.subplots(figsize=(5, 3))
77
+ sns.kdeplot(x=filtered_df['GLD'], fill=True, color="orange", ax=ax2)
78
+ st.pyplot(fig2)
79
+
80
+ with col_right:
81
+ st.markdown("### 🌡️ Korelasyon / Correlation")
82
+ fig3, ax3 = plt.subplots(figsize=(5, 3))
83
+ sns.heatmap(filtered_df.corr(numeric_only=True), annot=True, cmap='YlOrBr', ax=ax3, annot_kws={"size": 7})
84
+ st.pyplot(fig3)
85
+
86
+ # 7. VERİ TABLOSU
87
+ with st.expander("Verileri Gör / View Data"):
88
+ st.dataframe(filtered_df.head(), use_container_width=True)
89
+ csv = filtered_df.to_csv(index=False).encode('utf-8')
90
+ st.download_button("📥 İndir / Download", data=csv, file_name=f'gold_{year}.csv')
gold_analysis_pairplot.png ADDED

Git LFS Details

  • SHA256: 3a4025094ae34e60100f2b9ee8ee3b89a0ffe4f4916845e89699bd39eba62325
  • Pointer size: 132 Bytes
  • Size of remote file: 3.59 MB
gold_feature_engineered.csv ADDED
The diff for this file is too large to render. See raw diff
 
gold_plot.png ADDED