Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,10 +7,10 @@ import numpy as np
|
|
| 7 |
model = joblib.load('Rf_model.joblib')
|
| 8 |
encoder = joblib.load('encoder_d.joblib')
|
| 9 |
|
| 10 |
-
# Custom CSS
|
| 11 |
st.markdown("""
|
| 12 |
<style>
|
| 13 |
-
/*
|
| 14 |
.main-title {
|
| 15 |
background-color: #007BFF;
|
| 16 |
padding: 10px;
|
|
@@ -18,19 +18,22 @@ st.markdown("""
|
|
| 18 |
color: white;
|
| 19 |
text-align: center;
|
| 20 |
font-size: 28px;
|
|
|
|
| 21 |
}
|
| 22 |
|
| 23 |
-
/* App
|
| 24 |
.stApp {
|
| 25 |
background-image: url('https://images.unsplash.com/photo-1605902711622-cfb43c4437d1');
|
| 26 |
background-size: cover;
|
|
|
|
|
|
|
| 27 |
}
|
| 28 |
|
| 29 |
-
/* Input
|
| 30 |
-
.stNumberInput, .stSelectbox {
|
| 31 |
-
background-color:
|
| 32 |
-
|
| 33 |
-
|
| 34 |
}
|
| 35 |
|
| 36 |
/* Predict Button */
|
|
@@ -44,7 +47,7 @@ st.markdown("""
|
|
| 44 |
border-radius: 8px;
|
| 45 |
}
|
| 46 |
|
| 47 |
-
/* Output
|
| 48 |
.result-box {
|
| 49 |
background-color: rgba(255,255,255,0.85);
|
| 50 |
border-left: 6px solid #28a745;
|
|
@@ -52,7 +55,7 @@ st.markdown("""
|
|
| 52 |
font-size: 20px;
|
| 53 |
border-radius: 10px;
|
| 54 |
text-align: center;
|
| 55 |
-
margin-top:
|
| 56 |
}
|
| 57 |
</style>
|
| 58 |
""", unsafe_allow_html=True)
|
|
@@ -60,9 +63,8 @@ st.markdown("""
|
|
| 60 |
# Streamlit app
|
| 61 |
def main():
|
| 62 |
st.markdown('<div class="main-title">Insurance Cost Prediction App</div>', unsafe_allow_html=True)
|
| 63 |
-
st.markdown("##")
|
| 64 |
|
| 65 |
-
#
|
| 66 |
col1, col2, col3 = st.columns(3)
|
| 67 |
with col1:
|
| 68 |
age = st.number_input("Age", min_value=18, max_value=100, value=30)
|
|
|
|
| 7 |
model = joblib.load('Rf_model.joblib')
|
| 8 |
encoder = joblib.load('encoder_d.joblib')
|
| 9 |
|
| 10 |
+
# Custom CSS for styling
|
| 11 |
st.markdown("""
|
| 12 |
<style>
|
| 13 |
+
/* Title Styling */
|
| 14 |
.main-title {
|
| 15 |
background-color: #007BFF;
|
| 16 |
padding: 10px;
|
|
|
|
| 18 |
color: white;
|
| 19 |
text-align: center;
|
| 20 |
font-size: 28px;
|
| 21 |
+
margin-bottom: 30px;
|
| 22 |
}
|
| 23 |
|
| 24 |
+
/* App Background */
|
| 25 |
.stApp {
|
| 26 |
background-image: url('https://images.unsplash.com/photo-1605902711622-cfb43c4437d1');
|
| 27 |
background-size: cover;
|
| 28 |
+
background-repeat: no-repeat;
|
| 29 |
+
background-attachment: fixed;
|
| 30 |
}
|
| 31 |
|
| 32 |
+
/* Input Fields */
|
| 33 |
+
.stNumberInput input, .stSelectbox div[data-baseweb="select"] {
|
| 34 |
+
background-color: #f0f9ff !important;
|
| 35 |
+
padding: 10px;
|
| 36 |
+
border-radius: 8px;
|
| 37 |
}
|
| 38 |
|
| 39 |
/* Predict Button */
|
|
|
|
| 47 |
border-radius: 8px;
|
| 48 |
}
|
| 49 |
|
| 50 |
+
/* Output Result */
|
| 51 |
.result-box {
|
| 52 |
background-color: rgba(255,255,255,0.85);
|
| 53 |
border-left: 6px solid #28a745;
|
|
|
|
| 55 |
font-size: 20px;
|
| 56 |
border-radius: 10px;
|
| 57 |
text-align: center;
|
| 58 |
+
margin-top: 30px;
|
| 59 |
}
|
| 60 |
</style>
|
| 61 |
""", unsafe_allow_html=True)
|
|
|
|
| 63 |
# Streamlit app
|
| 64 |
def main():
|
| 65 |
st.markdown('<div class="main-title">Insurance Cost Prediction App</div>', unsafe_allow_html=True)
|
|
|
|
| 66 |
|
| 67 |
+
# Inputs arranged in 3 columns (2 rows layout)
|
| 68 |
col1, col2, col3 = st.columns(3)
|
| 69 |
with col1:
|
| 70 |
age = st.number_input("Age", min_value=18, max_value=100, value=30)
|