Spaces:
Build error
Build error
File size: 761 Bytes
475c938 2e0cda3 475c938 |
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 |
import streamlit as st
import joblib
import pandas as pd
# Load the trained model
model = joblib.load('sugar_cane_prediction.py')
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}') |