File size: 2,068 Bytes
2dbe47c | 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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | import streamlit as st
import pickle
import numpy as np
import pandas as pd
st.title("AI-Driven Project Risk Level Classification Tool")
Project_Type = st.selectbox("Type of the project", ['Construction', 'Manufacturing', 'IT', 'R&D', 'Healthcare', 'Marketing'])
Team_size = st.number_input("Team size", min_value=2, max_value=50)
Project_Budget_USD = st.number_input('Project Budget (USD)', min_value=159355.55, max_value=3768354.37)
Estimated_Timeline_Months = st.number_input('Estimated Timeline (Months)', min_value=2, max_value=36)
Complexity_Score = st.number_input('Complexity Score', min_value=1.62, max_value=10.00)
Stakeholder_Count = st.number_input('Stakeholder Count', min_value=2, max_value=29)
Methodology_Used = st.selectbox('Methodology Used', ['Waterfall', 'Kanban', 'Agile', 'Scrum', 'Hybrid'])
Team_Experience_Level = st.selectbox('Team Experience Level', ['Senior', 'Mixed', 'Junior', 'Expert'])
External_Dependencies_Count = st.number_input('External Dependencies Count', min_value=0, max_value=7)
Requirement_Stability = st.selectbox('Requirement Stability', ['Moderate', 'Stable', 'Volatile'])
Current_Phase_Duration_Months = st.number_input('Current Phase Duration (Months)', min_value=1, max_value=17)
with open("Classification project.pkl", "rb") as f:
final_model = pickle.load(f)
if st.button("Submit the Details"):
input_df = pd.DataFrame([{
'Project_Type': Project_Type,
'Team_Size': Team_size,
'Project_Budget_USD': Project_Budget_USD,
'Estimated_Timeline_Months': Estimated_Timeline_Months,
'Complexity_Score': Complexity_Score,
'Stakeholder_Count': Stakeholder_Count,
'Methodology_Used': Methodology_Used,
'Team_Experience_Level': Team_Experience_Level,
'External_Dependencies_Count': External_Dependencies_Count,
'Requirement_Stability': Requirement_Stability,
'Current_Phase_Duration_Months': Current_Phase_Duration_Months
}])
pred = final_model.predict(input_df)[0]
st.success(f"The predicted Risk Level is: {pred}") |