Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
import pickle
|
4 |
-
from sklearn.naive_bayes import GaussianNB
|
5 |
-
import joblib
|
6 |
|
7 |
-
# Load the trained model
|
8 |
# Load the trained model using pickle
|
9 |
with open('naive_bayes_model.pkl', 'rb') as file:
|
10 |
model = pickle.load(file)
|
@@ -12,8 +9,9 @@ with open('naive_bayes_model.pkl', 'rb') as file:
|
|
12 |
# Define the Streamlit app
|
13 |
def main():
|
14 |
st.title("Crop Recommendation Model")
|
|
|
15 |
st.write("This is a simple web app to make predictions using a Naive Bayes model.")
|
16 |
-
|
17 |
st.sidebar.header("Enter Features")
|
18 |
|
19 |
# Input fields for each feature
|
@@ -38,5 +36,9 @@ def main():
|
|
38 |
st.header("Prediction")
|
39 |
st.write("Predicted crop:", prediction[0])
|
40 |
|
|
|
|
|
|
|
|
|
41 |
if __name__ == '__main__':
|
42 |
main()
|
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
import pickle
|
|
|
|
|
4 |
|
|
|
5 |
# Load the trained model using pickle
|
6 |
with open('naive_bayes_model.pkl', 'rb') as file:
|
7 |
model = pickle.load(file)
|
|
|
9 |
# Define the Streamlit app
|
10 |
def main():
|
11 |
st.title("Crop Recommendation Model")
|
12 |
+
st.write("Developed by: Adil")
|
13 |
st.write("This is a simple web app to make predictions using a Naive Bayes model.")
|
14 |
+
|
15 |
st.sidebar.header("Enter Features")
|
16 |
|
17 |
# Input fields for each feature
|
|
|
36 |
st.header("Prediction")
|
37 |
st.write("Predicted crop:", prediction[0])
|
38 |
|
39 |
+
# Display the labels in a well-formatted box
|
40 |
+
st.info("Labels the model can predict:")
|
41 |
+
st.write(model.classes_)
|
42 |
+
|
43 |
if __name__ == '__main__':
|
44 |
main()
|