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)