Sovereign 8s.is mirror of standardgalactic/Concrete-strength-prediction
- Python 88.1%
- JavaScript 5.4%
- CSS 3.7%
- HTML 2.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| data | ||
| make_visuals | ||
| saved | ||
| static | ||
| .gitignore | ||
| app.py | ||
| feature_importance.py | ||
| gui.py | ||
| model-training.py | ||
| preprocessing.py | ||
| README.md | ||
| requirements.txt | ||
| residual_analysis.py | ||
| statistical_analysis.py | ||
| test.py | ||
| visualization.py | ||
Concrete Strength Prediction
This project provides a machine learning solution for predicting the compressive strength of concrete mixtures based on their composition and age. It includes:
- Model training scripts for building and evaluating regression models.
- A modern desktop GUI for interactive predictions.
- A FastAPI backend for web-based or API access.
Project Structure
concrete-strenght-prediction/
│
├── app.py # FastAPI backend for predictions
├── gui.py # PyQt5 desktop GUI application
├── model-training.py # Model training and evaluation script
├── preprocessing.py # Feature engineering and preprocessing functions
├── requirements.txt # Python dependencies
├── saved/
│ ├── models/ # Trained model files (.joblib)
│ ├── assets/ # Evaluation plots, SHAP explanations, etc.
│ └── preprocessing/ # Encoders (if any)
├── data/
│ └── Concrete_Data.xls # Raw dataset
└── static/
└── index.html # Frontend for FastAPI (if used)
Installation
-
Clone the repository:
git clone https://github.com/Ahmed-Hereiz/Concrete-strength-prediction.git cd concrete-strenght-prediction -
Install dependencies:
pip install -r requirements.txt -
Prepare the dataset:
- Place
Concrete_Data.xlsin thedata/directory.
- Place
Model Training
To train and evaluate the models:
python model-training.py
- This will preprocess the data, train several regression models, save them in
saved/models/, and generate evaluation plots and SHAP explanations insaved/assets/.
Using the Desktop GUI
The GUI allows interactive prediction of concrete strength:
python gui.py
- Adjust mixture parameters using sliders.
- Select a prediction model.
- View predicted strength and feature details.
Requirements: PyQt5 (installed via requirements.txt).
Using the FastAPI Backend
Start the API server:
python app.py
- The API will be available at
http://localhost:8000. - The main page (if
static/index.htmlexists) is served at/. - Prediction endpoint:
POST /predict
Requirements
- Python 3.7+
- See
requirements.txtfor all dependencies (scikit-learn, pandas, numpy, PyQt5, fastapi, uvicorn, lightgbm, shap, etc.)
Notes
- Models must be trained before using the GUI or API (
saved/models/must exist). - Feature engineering is handled via
preprocessing.py. - SHAP explanations and evaluation plots are generated for model interpretability.