-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHome.py
More file actions
140 lines (119 loc) · 4.05 KB
/
Home.py
File metadata and controls
140 lines (119 loc) · 4.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import streamlit as st
from utils.css import inject_css
# Constants
PAGE_CONFIG = {
"page_title": "Real Estate App",
"page_icon": "🏠"
}
st.set_page_config(**PAGE_CONFIG)
# CSS
inject_css()
# Components
def hero_section():
"""Render the hero section"""
st.header("Real Estate 🏠 Data Science Application")
st.markdown("###### Get instant price estimates using our AI-powered valuation tool 🤖")
def disclaimer():
"""Render the disclaimer box"""
st.info("""⚠️ **Disclaimer:**
This application uses 99acres.com data for educational purposes only.""")
def cta_button():
"""Render the CTA button"""
st.markdown(
f'<a href="/Price_Predictor" class="cta-link">🚀 Get Instant Estimate →</a>',
unsafe_allow_html=True
)
def feature_card(emoji: str, title: str, description: str):
"""Create a feature card component"""
return f"""
<div class="feature-card">
<div style="font-size: 2rem;">{emoji}</div>
<h5>{title}</h5>
<p>{description}</p>
</div>
"""
def metric_box(title: str, items: list):
"""Create a metric box component"""
items_html = "".join([f"• {item}<br>" for item in items])
return f"""
<div class="metric-box">
<h4>{title}</h4>
<p style="line-height: 1.6;">{items_html}</p>
</div>
"""
def profile_link(emoji: str, text: str, url: str):
"""Create a profile link component"""
return f'''
<a href="{url}" class="profile-link" target="_blank">
{emoji} <span>{text}</span>
</a>
'''
# Page Sections
def main_features():
"""Render the main features section"""
st.markdown("### ✨ Main Features")
with st.container():
cols = st.columns(3)
features = [
("🏠", "AI Price Predictor", "Instant valuation using machine learning models"),
("📊", "Market Analytics", "Interactive charts & trend analysis"),
("🤝", "Smart Recommendations", "Personalized apartment suggestions")
]
for col, feature in zip(cols, features):
with col:
st.markdown(feature_card(*feature), unsafe_allow_html=True)
def data_section():
"""Render the data & accuracy section"""
st.markdown("### 📈 Data & Accuracy")
with st.container():
col1, col2 = st.columns(2)
with col1:
content = metric_box(
"📊 Data Sources",
[
"Trained on 99acres.com property listings",
"99acres.com historical data",
"Gurgaon-focused market analysis",
"Carefully curated local listings"
]
)
st.markdown(content, unsafe_allow_html=True)
with col2:
content = metric_box(
"🎯 Model Approach",
[
"Ensemble learning techniques",
"Hyperlocal price factors",
"95% Confidence Intervals",
"Cross-validated results"
]
)
st.markdown(content, unsafe_allow_html=True)
st.markdown("""<div style="text-align: center; margin-top: 1rem; color: #666; font-size: 0.9em;">
🔒 Data used for educational purposes only</div>""",
unsafe_allow_html=True)
def sidebar_content():
"""Render the sidebar content"""
with st.sidebar:
st.markdown("### Connect with Me 👋")
links = [
("🐙", "GitHub Repository", "https://github.com/pxxthik"),
("🎨", "My Portfolio", "https://pratheek-bedre.web.app")
]
for emoji, text, url in links:
st.markdown(profile_link(emoji, text, url), unsafe_allow_html=True)
# Main Page
def main():
inject_css()
hero_section()
disclaimer()
cta_button()
st.image("assets/real-estate.jpg")
st.markdown("---")
main_features()
st.markdown("---")
data_section()
st.markdown("---")
sidebar_content()
if __name__ == "__main__":
main()