Instructions to use Siddartha96/concrete-strength-rf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use Siddartha96/concrete-strength-rf with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("Siddartha96/concrete-strength-rf", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
Concrete Compressive Strength — RandomForest
GitHub repo: https://github.com/Siddartha-DevOps/ConcreteMix.AI (full source, training pipeline, and reproduce script)
A scikit-learn RandomForestRegressor that predicts concrete compressive
strength (MPa) from mix proportions and curing age. Trained on the public
UCI Concrete Compressive Strength dataset.
Status: honest baseline. This is a reproducible model on a well-known public benchmark — not a proprietary or state-of-the-art model. It is useful as a fast strength estimate and as a transparent baseline; it is not a substitute for laboratory testing or code-compliance verification.
Training data
- Dataset: UCI Concrete Compressive Strength (I-Cheng Yeh). 1,030 lab samples. License: CC BY 4.0.
- Split: 824 train / 206 test,
train_test_split(test_size=0.2, random_state=42). - The dataset CSV is vendored in the source repo at
app/backend/ml_models/data/concrete_uci.csv.
Evaluation (held-out test set, n=206)
| Metric | Value |
|---|---|
| R² | 0.8795 |
| RMSE | 5.573 MPa |
| MAE | 3.906 MPa |
These numbers are independently reproducible — run
python scripts/reproduce_metrics.py in the source repo (retrains and asserts a
match against the committed metrics).
Inputs (order matters)
The model consumes an 8-feature vector, standardized by the included
scaler.skops (a StandardScaler fit on the training set):
cement(kg/m³)blast_furnace_slag(kg/m³)fly_ash(kg/m³)water(kg/m³)superplasticizer(kg/m³)coarse_aggregate(kg/m³)fine_aggregate(kg/m³)age(days)
Output: predicted compressive strength in MPa.
Requirements
The model was trained and serialized with scikit-learn 1.9.0 (verified from
the pickle's _sklearn_version). Loading with a different scikit-learn raises
InconsistentVersionWarning and can change predictions — pin these exact
versions for guaranteed-consistent output:
scikit-learn==1.9.0
skops==0.14.0
numpy==2.4.6
pip install -r requirements.txt # bundled in this repo
Usage
import numpy as np
from skops.io import load, get_untrusted_types
f = "model.skops"
model = load(f, trusted=get_untrusted_types(file=f))
scaler = load("scaler.skops", trusted=get_untrusted_types(file="scaler.skops"))
# cement, slag, fly_ash, water, SP, coarse, fine, age
x = np.array([[380, 0, 0, 175, 6, 1000, 780, 28]], dtype=float)
strength_mpa = float(model.predict(scaler.transform(x))[0])
print(round(strength_mpa, 1), "MPa")
Intended use & limitations
- Intended: quick strength estimates during mix design, teaching/insight, and as a transparent baseline for benchmarking.
- Not intended: structural sign-off, QC acceptance, or code compliance — always confirm with lab breaks.
- Distribution shift: trained on one public lab dataset with specific materials; predictions outside that distribution (unusual SCM ratios, admixtures, aggregates, or regional materials) are unreliable.
- Uncertainty: the source application serves calibrated conformal prediction intervals around this model; those are not bundled in this artifact (point predictions only here).
- No field calibration: lab-cured cylinder data; field strength differs.
License
- Model weights: MIT (proposed — confirm before publishing).
- Training data: UCI dataset under CC BY 4.0 (attribution: I-Cheng Yeh).
Citation
Yeh, I-C. (1998). Modeling of strength of high-performance concrete using artificial neural networks. Cement and Concrete Research, 28(12), 1797–1808. UCI Machine Learning Repository: Concrete Compressive Strength.
- Downloads last month
- -
Evaluation results
- r_squared on UCI Concrete Compressive Strengthself-reported0.879
- rmse on UCI Concrete Compressive Strengthself-reported5.573
- mae on UCI Concrete Compressive Strengthself-reported3.906