Sathwikchowdary commited on
Commit
783bc55
Β·
verified Β·
1 Parent(s): e4fdc97

Update home.py

Browse files
Files changed (1) hide show
  1. home.py +25 -1
home.py CHANGED
@@ -82,4 +82,28 @@ else:
82
  # User Inputs for Wine Features
83
  st.markdown('<h2 class="subtitle">🍷 Enter Wine Properties</h2>', unsafe_allow_html=True)
84
  fixed_acidity = st.number_input("Fixed Acidity", min_value=3.0, max_value=15.0, value=7.0)
85
- volatile_acidity = st.number_input("
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  # User Inputs for Wine Features
83
  st.markdown('<h2 class="subtitle">🍷 Enter Wine Properties</h2>', unsafe_allow_html=True)
84
  fixed_acidity = st.number_input("Fixed Acidity", min_value=3.0, max_value=15.0, value=7.0)
85
+ volatile_acidity = st.number_input("Volatile Acidity", min_value=0.0, max_value=2.0, value=0.5)
86
+ citric_acid = st.number_input("Citric Acid", min_value=0.0, max_value=1.5, value=0.2)
87
+ residual_sugar = st.number_input("Residual Sugar", min_value=0.1, max_value=15.0, value=2.0)
88
+ chlorides = st.number_input("Chlorides", min_value=0.01, max_value=0.2, value=0.05)
89
+ free_sulfur_dioxide = st.number_input("Free Sulfur Dioxide", min_value=1, max_value=100, value=30)
90
+ total_sulfur_dioxide = st.number_input("Total Sulfur Dioxide", min_value=5, max_value=300, value=120)
91
+ density = st.number_input("Density", min_value=0.98, max_value=1.1, value=0.995)
92
+ pH = st.number_input("pH", min_value=2.5, max_value=4.5, value=3.2)
93
+ sulphates = st.number_input("Sulphates", min_value=0.3, max_value=2.0, value=0.8)
94
+ alcohol = st.number_input("Alcohol Content", min_value=5.0, max_value=20.0, value=10.0)
95
+
96
+ # Prepare input for model
97
+ input_data = np.array([[fixed_acidity, volatile_acidity, citric_acid, residual_sugar,
98
+ chlorides, free_sulfur_dioxide, total_sulfur_dioxide, density,
99
+ pH, sulphates, alcohol]])
100
+
101
+ # Prediction Button
102
+ if st.button("Predict Quality"):
103
+ if model_loaded:
104
+ prediction = model.predict(input_data)
105
+ st.markdown(f'<p class="prediction">Predicted Wine Quality: {int(prediction[0])}/10</p>', unsafe_allow_html=True)
106
+ else:
107
+ st.error(f"Model file '{model_path}' not found. Please upload the correct model file.")
108
+
109
+ st.write("*Powered by Machine Learning & AI* πŸš€")