Spaces:
Build error
Build error
import streamlit as st | |
import joblib | |
import pandas as pd | |
# Load the trained model | |
model = joblib.load('my_model.pkl') | |
st.title('Sugar Cane Properties Prediction') | |
# Input fields | |
farm = st.text_input('Farm Name') | |
variety = st.text_input('Variety') | |
age = st.text_input('Age') | |
if st.button('Predict'): | |
# Create a DataFrame with the input data | |
input_data = pd.DataFrame({'Farm': [farm], 'Variety': [variety], 'Age': [age]}) | |
# Make prediction | |
prediction = model.predict(input_data) | |
# Display results | |
st.write('Predicted Properties:') | |
st.write(f'Brix: {prediction[0][0]:.2f}') | |
st.write(f'Purity: {prediction[0][1]:.2f}') | |
st.write(f'Pol: {prediction[0][2]:.2f}') | |
st.write(f'RS: {prediction[0][3]:.2f}') |