├── data ├── Code ├── README.md └── code2 /data: -------------------------------------------------------------------------------- 1 | Project_Size,Team_Experience,Complexity,Estimated_Effort 2 | 10000,3,2,12 3 | 15000,5,3,20 4 | 8000,2,1,8 5 | 12000,4,2,15 6 | 9000,3,1,10 7 | -------------------------------------------------------------------------------- /Code: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | from sklearn.model_selection import train_test_split 3 | from sklearn.linear_model import LinearRegression 4 | from sklearn.metrics import mean_squared_error, r2_score 5 | 6 | # Load the historical project data 7 | data = pd.read_csv("historical_data.csv") 8 | 9 | # Preview the data 10 | print("Sample Data:") 11 | print(data.head()) 12 | 13 | # Define features and target 14 | features = ['Project_Size', 'Team_Experience', 'Complexity'] 15 | target = 'Estimated_Effort' 16 | 17 | X = data[features] 18 | y = data[target] 19 | 20 | # Split into training and testing sets 21 | X_train, X_test, y_train, y_test = train_test_split( 22 | X, y, test_size=0.2, random_state=42 23 | ) 24 | 25 | # Train a Linear Regression model 26 | model = LinearRegression() 27 | model.fit(X_train, y_train) 28 | 29 | # Predict on test set 30 | y_pred = model.predict(X_test) 31 | 32 | # Evaluate the model 33 | mse = mean_squared_error(y_test, y_pred) 34 | r2 = r2_score(y_test, y_pred) 35 | 36 | print("\nModel Performance:") 37 | print(f"Mean Squared Error: {mse:.2f}") 38 | print(f"R² Score: {r2:.2f}") 39 | 40 | # Predicting effort for a new project example 41 | new_project = pd.DataFrame([{ 42 | 'Project_Size': 12000, 43 | 'Team_Experience': 5, 44 | 'Complexity': 2 45 | }]) 46 | 47 | predicted_effort = model.predict(new_project) 48 | print("\nPredicted Effort for New Project:") 49 | print(f"{predicted_effort[0]:.2f} person-months") 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 📊 Effort Estimation Using Historical Data 2 | 3 | This project provides a simple yet powerful Streamlit dashboard to estimate software development effort using historical project data and machine learning (Linear Regression). It allows users to train models and make predictions based on features like project size, team experience, and complexity. 4 | 5 | ## 🚀 Features 6 | 7 | - 📁 Upload historical project data in CSV format. 8 | - 🧠 Train a Linear Regression model on your data. 9 | - 📈 View model performance (MSE and R²). 10 | - 🔮 Predict person-month effort for new projects. 11 | - 📊 Interactive and user-friendly Streamlit interface. 12 | 13 | --- 14 | 15 | ## 🛠️ Installation 16 | 17 | 1. **Clone this repository** 18 | ```bash 19 | git clone https://github.com/yourusername/effort-estimation-app.git 20 | cd effort-estimation-app 21 | 22 | Install dependencies 23 | 24 | pip install -r requirements.txt 25 | 26 | Run the Streamlit app 27 | 28 | streamlit run effort_estimation_app.py 29 | 30 | 📂 Sample CSV Format 31 | 32 | Your dataset should contain the following columns: 33 | Project_Size Team_Experience Complexity Estimated_Effort 34 | 10000 3 2 12 35 | 15000 5 3 20 36 | 8000 2 1 8 37 | 38 | Project_Size: Size of the project (e.g., Lines of Code or Function Points). 39 | 40 | Team_Experience: Average experience of the team (in years). 41 | 42 | Complexity: Numerical representation (1=Low, 2=Medium, 3=High). 43 | 44 | Estimated_Effort: Actual recorded effort (in person-months). 45 | 46 | 📸 App Screenshot 47 | 48 | (Insert a screenshot here after running the app locally) 49 | 50 | 📌 Requirements 51 | 52 | Python 3.8+ 53 | 54 | Streamlit 55 | 56 | pandas 57 | 58 | scikit-learn 59 | 60 | You can install them with: 61 | 62 | pip install streamlit pandas scikit-learn 63 | 64 | 📤 Future Improvements 65 | 66 | Add support for other ML models (Random Forest, XGBoost). 67 | 68 | Plot feature importance and residuals. 69 | 70 | Export trained model for reuse. 71 | 72 | Deploy to Streamlit Cloud or Hugging Face Spaces. 73 | 74 | 🤝 Contribution 75 | 76 | Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change or add. 77 | 📜 License 78 | 79 | MIT License © 2025 [Your Name] 80 | 81 | 82 | --- 83 | 84 | ### ✅ Optional `requirements.txt` file 85 | 86 | ```txt 87 | streamlit>=1.35.0 88 | pandas>=2.1.0 89 | scikit-learn>=1.4.0 90 | -------------------------------------------------------------------------------- /code2: -------------------------------------------------------------------------------- 1 | import streamlit as st 2 | import pandas as pd 3 | from sklearn.linear_model import LinearRegression 4 | from sklearn.model_selection import train_test_split 5 | from sklearn.metrics import mean_squared_error, r2_score 6 | 7 | st.title("📊 Effort Estimation Using Historical Data") 8 | 9 | st.markdown(""" 10 | This app uses a simple machine learning model (Linear Regression) to estimate software development effort 11 | based on past project data (like size, experience, and complexity). 12 | """) 13 | 14 | # File uploader 15 | uploaded_file = st.file_uploader("📁 Upload CSV File", type=["csv"]) 16 | 17 | if uploaded_file is not None: 18 | data = pd.read_csv(uploaded_file) 19 | st.subheader("📄 Preview of Uploaded Data") 20 | st.dataframe(data.head()) 21 | 22 | # Select input columns 23 | default_features = ['Project_Size', 'Team_Experience', 'Complexity'] 24 | if not set(default_features + ['Estimated_Effort']).issubset(data.columns): 25 | st.error("CSV must contain 'Project_Size', 'Team_Experience', 'Complexity', and 'Estimated_Effort' columns.") 26 | else: 27 | X = data[default_features] 28 | y = data['Estimated_Effort'] 29 | 30 | # Split dataset 31 | X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) 32 | 33 | # Train model 34 | model = LinearRegression() 35 | model.fit(X_train, y_train) 36 | y_pred = model.predict(X_test) 37 | 38 | # Metrics 39 | mse = mean_squared_error(y_test, y_pred) 40 | r2 = r2_score(y_test, y_pred) 41 | 42 | st.subheader("📈 Model Performance") 43 | st.metric("Mean Squared Error", f"{mse:.2f}") 44 | st.metric("R² Score", f"{r2:.2f}") 45 | 46 | st.subheader("🔍 Estimate Effort for a New Project") 47 | project_size = st.number_input("Project Size (e.g. LOC or FP)", min_value=1000, value=12000) 48 | team_exp = st.slider("Team Experience (Years)", 0, 20, 5) 49 | complexity = st.selectbox("Complexity Level", options=[1, 2, 3], format_func=lambda x: ["Low", "Medium", "High"][x - 1]) 50 | 51 | if st.button("Estimate Effort"): 52 | input_data = pd.DataFrame([{ 53 | 'Project_Size': project_size, 54 | 'Team_Experience': team_exp, 55 | 'Complexity': complexity 56 | }]) 57 | prediction = model.predict(input_data) 58 | st.success(f"🔮 Predicted Effort: **{prediction[0]:.2f} person-months**") 59 | 60 | else: 61 | st.info("Awaiting CSV file upload...") 62 | 63 | --------------------------------------------------------------------------------