This project simulates a manufacturing quality dataset and applies Statistical Process Control (SPC) and process capability analysis to evaluate whether a production process is stable and capable of meeting engineering specifications.
It is structured as a portfolio-ready analytics project with reproducible data generation, modular Python source code, chart outputs, and an executive-style quality report.
Apple MDE work often requires deciding whether a process is stable, capable, and ready for ramp or corrective action. This project uses SPC charts, Cp/Cpk, yield trends, defect Pareto analysis, and machine-level comparisons to surface tool drift, process centering issues, and likely improvement priorities.
- The process achieved Cp = 1.12 and Cpk = 1.04, suggesting that the process variation is close to acceptable but the process is not well-centered.
- Mean-shift signals appeared in the later production period, which may indicate equipment wear, tool drift, or setup change.
- Scratch, Dimension and Surface defects accounted for the majority of observed defects, so improvement work should start from surface handling and dimensional control.
- Machine-level comparison should be used to identify whether one machine contributes disproportionately to yield loss or dimensional shift.
- Simulates 5,000 manufacturing observations with batch, machine, operator, process settings, dimension measurements, defect types, and yield rate.
- Calculates process capability metrics using:
Cp = (USL - LSL) / (6 * sigma)
Cpk = min((USL - mean) / (3 * sigma), (mean - LSL) / (3 * sigma))
- Builds SPC control limits and identifies out-of-control signals, sustained trends, and mean shifts.
- Produces four required quality visuals:
- X-bar control chart
- Cpk capability analysis chart
- Yield trend chart
- Defect Pareto chart
- Adds machine-level analysis for Cpk, yield rate, and defect count.
- Generates an English
quality_report.mdsuitable for GitHub and resume discussion.
.
+-- data/
| +-- README.md
+-- reports/
| +-- quality_report.md
| +-- figures/
| +-- control_chart.svg
| +-- cpk_analysis.svg
| +-- yield_trend.svg
| +-- defect_pareto.svg
| +-- machine_cpk.svg
| +-- machine_yield.svg
| +-- machine_defects.svg
+-- src/
| +-- config.py
| +-- data_simulation.py
| +-- main.py
| +-- report.py
| +-- spc.py
| +-- visualization.py
+-- tests/
| +-- test_spc_metrics.py
+-- requirements.txt
+-- README.md
Install dependencies:
pip install -r requirements.txtRun the full pipeline:
python -m src.mainThe pipeline writes generated data to data/manufacturing_quality_data.csv, chart files to
reports/figures/, and the final report to reports/quality_report.md.
For simplicity, this project estimates X-bar control limits using the empirical standard deviation of daily subgroup means. A future improvement is to implement classical X-bar/R control limits using A2, D3 and D4 constants.
Run tests:
pytestBuilt a Python-based SPC and process capability analytics project for simulated manufacturing data, generating 5,000 production records, calculating Cp/Cpk, detecting control-limit violations and process shifts, and producing automated quality charts and an executive quality report.