|
import streamlit as st |
|
import pandas as pd |
|
import numpy as np |
|
import pickle |
|
|
|
|
|
with open('rf_model.pkl', 'rb') as file: |
|
rf_model = pickle.load(file) |
|
|
|
|
|
st.title("Parkinson's Disease Prediction") |
|
|
|
|
|
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) |
|
|
|
|
|
if st.button("Predict"): |
|
input_array = np.array(list(input_data.values())).reshape(1, -1) |
|
prediction = rf_model.predict(input_array) |
|
|
|
|
|
if prediction[0] == 1: |
|
st.error("Parkinson's Disease detected") |
|
else: |
|
st.success("No Parkinson's Disease") |