Spaces:
Build error
Build error
File size: 973 Bytes
86753b4 | 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 pickle
import sklearn
import numpy as np
import pandas as pd
import streamlit as st
model_file = 'model-6.pkl'
try:
with open(model_file,'rb') as file:
model = pickle.load(file)
except FileNotFoundError:
st.error("The file was not found or may be its corrupted")
st.title("IRIS FLOWER CLASSIFICATION")
st.header("Enter the features for your prediction")
sepal_length = st.number_input("Sepal length (cm):",min_value=0.0,max_value=10.0)
sepal_width = st.number_input("Sepal Width (cm):",min_value=0.0,max_value=10.0)
petal_length = st.number_input("Petal length (cm):",min_value=0.0,max_value=10.0)
petal_width = st.number_input("Petal Width (cm):",min_value=0.0,max_value=10.0)
if st.button("PREDICT") :
features = np.array([[sepal_length,sepal_width,petal_length,petal_width]])
prediction = model.predict(features)[0]
st.subheader("Prediction has been made: ")
st.write("The prediction for your given parameters is:",prediction) |