import streamlit as st import pandas as pd import numpy as np import pickle # Load the saved model with open('rf_model.pkl', 'rb') as file: rf_model = pickle.load(file) # Create the Streamlit app st.title("Parkinson's Disease Prediction") # Collect user input col = ['MDVP:Fo(Hz)', 'MDVP:Fhi(Hz)', 'MDVP:Flo(Hz)', 'MDVP:Jitter(%)', 'MDVP:Jitter(Abs)', 'MDVP:RAP', 'MDVP:PPQ', 'Jitter:DDP', 'MDVP:Shimmer', 'MDVP:Shimmer(dB)', 'Shimmer:APQ3', 'Shimmer:APQ5', 'MDVP:APQ', 'Shimmer:DDA', 'NHR', 'HNR', 'RPDE', 'DFA', 'spread1', 'spread2', 'D2', 'PPE'] input_data = {} for feature in col: input_data[feature] = st.number_input(f"Enter {feature}", value=0.0) # Make the prediction if st.button("Predict"): input_array = np.array(list(input_data.values())).reshape(1, -1) prediction = rf_model.predict(input_array) # Display the results if prediction[0] == 1: st.error("Parkinson's Disease detected") else: st.success("No Parkinson's Disease")