Manufacturing data science · Portfolio case study

Weight prediction under process shift

Can injection-molding telemetry estimate a completed part’s weight—and remain reliable when process conditions change?

Accurate on familiar conditions. Unreliable on an omitted experiment.

Detailed pressure/flow signals and more complex models did not consistently solve the transfer problem. This study does not justify skipping physical weight measurements.

Point prediction · scalar PLS baseline

0.114 gRepresented conditions
0.523 gUnseen experiment

Mean absolute error: average distance from measured weight. Every evaluated cycle counts equally; 167 represented-condition cycles versus 829 cycles across three whole-experiment holdouts.

Interval coverage · separate uncertainty study

86.2%Represented conditions
5.2%Unseen experiment

Share of measured weights inside intervals intended to cover 90.0%. This branch selects scalar PLS or LightGBM using development data; it is a separate analysis from the PLS baseline.

These are separately fitted retrospective benchmarks. Their gap describes performance under two evaluation designs; it is not a paired causal estimate of process shift. No authoritative product tolerance is available.

What I built, and why the details matter

I implemented the source adapter, source audit, evaluation memberships, model and signal comparisons, uncertainty checks, predictive explanations, and the local dashboard and static report. Bogedale et al. collected and released the source measurements; the modeling libraries supply the estimators.

Source-safe preparation

The adapter verifies pinned source bytes and joins each machine cycle to its measured part. It preserves native timestamps, nulls and field lineage. Ninety-two released signal-only cycles have no supported weight target, so they remain outside the prediction study.

Leakage-safe comparisons

Fixed row memberships separate fitting, tuning, calibration and evaluation. Scaling and signal compression learn only from permitted training rows. Weight and experimental context do not enter the predictors.

A bounded complexity test

Mean, Ridge and partial least squares (PLS) establish scalar baselines. Engineered summaries and compressed pressure/flow traces test signal shape. LightGBM tests a nonlinear model family without expanding the search after evaluation.

A decision gate that can fail

Prediction intervals test uncertainty. A development-only distance screen checks whether unfamiliar inputs can rank prediction errors well enough to study selective measurement. The screen failed; that next study was skipped.

Engineering evidence: implementation, synthetic regression tests, and locked-environment checks. These links show the work; they do not establish factory deployment.

Hold out conditions, not just individual cycles

The study uses 829 labeled cycles across 3 controlled experiments from scatimdata Dataset 2. A stacking-box part was molded from glass-fiber-reinforced nylon 6 (PA6-GF30). Each cycle provides 16 scalar machine measurements and pressure/flow traces with 2,048 samples per channel. Physical weight in grams is the reference outcome.

Labeled Dataset 2 cycles and observed group means. Context describes source experiment roles.
ExperimentLabeled cyclesMean part weight (g)Controlled source context
15303115.956Moisture-content experiment
20223115.237Moisture-content experiment
23303114.308Mold-temperature experiment

A scalar is one number, such as peak pressure or injection time. A trajectory is the sequence recorded during the cycle. Prediction occurs after the machine cycle is complete; this is a study of virtual measurement, not early-cycle control.

1. Join & auditMatch cycle identity to weight; retain source meanings.
2. Reserve rowsWithhold a whole experiment; keep calibration separate.
3. Fit & compareTune on development experiments; transform within folds.
4. EvaluateMeasure error and coverage on the reserved population.
  • Represented conditions: training contains cycles from all three experiment groups; different cycles are reserved for evaluation. This mainly tests interpolation within familiar conditions.
  • Unseen experiment: all cycles from one experiment are excluded from fitting and calibration. The other two experiments supply development data. Repeat for experiments 15, 20 and 23.

70.45% of observed weight variation lay between the three groups. Their separation can make pooled scores look strong when all groups are represented. It motivates the harder whole-experiment benchmark.

Source and evaluation limitations

The initial audit inspected all three experiments before the later evaluation scope was fixed. The grouped benchmark is retrospective cross-validation, not an untouched prospective test. Adjacent cycles and three specific experiments do not support a universal factory claim.

Pressure and flow amplitudes remain in unresolved source-native units; elapsed time is in seconds. Moisture settings for experiment 15 disagree with the paper in two places. Mold-temperature units are inferred as °C. Geometry fields are retained but deferred because their scale and mapping are unresolved. There is no authoritative wall-clock chronology or part-weight specification.

The source paper studied random cross-validation within the available mixture of conditions. This implementation asks a different transfer question and uses different features and models. It is an extension, not an exact replication or a contradiction of the paper.

See the dataset contract and feature and evaluation contract.

Low error within known conditions did not transfer

The scalar PLS baseline reached 0.114 g pooled MAE for represented conditions and 0.523 g across the omitted experiments. Its predefined scientific summary gives each experiment equal weight: 0.503 g MAE. The pooled value instead gives every evaluated cycle equal weight.

Scalar model error under the two evaluation designs

Represented conditionsUnseen experiment
Training mean · Represented conditions (n=167)
0.740 g
Training mean · Unseen experiment (n=829)
1.091 g
Ridge · Represented conditions (n=167)
0.112 g
Ridge · Unseen experiment (n=829)
0.966 g
PLS · Represented conditions (n=167)
0.114 g
PLS · Unseen experiment (n=829)
0.523 g
0 g1.2 g · lower is better
Mean absolute error in grams; lower is better. All bars use pooled cycle weighting and start at zero. Each represented-condition model evaluates 167 cycles; each unseen-experiment summary pools 829 cycles. The training-mean baseline predicts one value learned from its training rows. Source: saved scalar-baseline predictions.

The error was systematic for experiment 23. PLS underpredicted all 303 held-out parts by an average of 0.798 g. That directional bias is evidence of a model failure in this population; it does not identify a physical cause.

Inspect PLS results by evaluation population
Scalar PLS by experiment. Bias is mean predicted minus measured weight; all errors in g.
ExperimentEvaluation populationCycles (n)MAE (g)Signed bias (g)
15Represented conditions610.109-0.027
15Unseen experiment3030.421+0.420
20Represented conditions450.150+0.010
20Unseen experiment2230.289+0.089
23Represented conditions610.091+0.002
23Unseen experiment3030.798-0.798

Signed bias is mean(predicted − measured): a negative value means underprediction. The represented-condition rows share one fitted pipeline; whole-experiment rows use a separate pipeline for each omitted experiment.

Did detailed signals or nonlinear models help?

Some pressure/flow representations improved the aggregate error, but every augmented representation was worse than scalars on at least one omitted experiment. LightGBM’s summary features gave a small aggregate improvement; compression did not improve its aggregate result. Scalar PLS had the lowest equal-experiment MAE among the predefined comparisons. No deployment model was selected from those outer scores.

Compare signal representations and model families
Whole-experiment transfer: mean MAE with equal weight for each held-out experiment.
Predictor representationRidge MAE (g)LightGBM MAE (g)
A · Scalars only0.9190.635
B · Scalars + trajectory summaries1.4570.624
C-PCA · Scalars + PCA signal components1.0470.638
C-PLS · Scalars + supervised PLS signal components0.7040.649

Each value averages the MAE of the three held-out experiments equally. Ridge uses linear regression with coefficient shrinkage. Principal component analysis (PCA) compresses signal variation without weight labels; supervised PLS compression uses weight labels only within its training partition. LightGBM combines decision trees. These are bounded benchmark comparisons, not proof of an optimal model.

Trajectory methods and per-experiment results · LightGBM comparison

Familiar-condition calibration missed the shifted errors

A separate uncertainty branch chooses scalar PLS or LightGBM on development data, then uses reserved calibration cycles to estimate a split-conformal error margin. The margin defines an interval around each prediction. For whole-experiment evaluation, neither fitting nor calibration sees the omitted experiment.

Measured coverage of nominal 90.0% prediction intervals

Represented conditions · pooled (144/167 covered)
86.2%
Unseen experiment · pooled (43/829 covered)
5.2%
Unseen experiment · experiment 15 (0/303 covered)
0.0%
Unseen experiment · experiment 20 (42/223 covered)
18.8%
Unseen experiment · experiment 23 (1/303 covered)
0.33%
0%Target 90.0% · 100%
Coverage is the share of measured weights inside their intervals; higher is better relative to the nominal target. The dashed line marks 90.0%. Pooled coverage was 144/167 for represented conditions and 43/829 under whole-experiment holdout. Experiment 23 covered 1 of 303 parts (0.33%). Source: saved uncertainty-evaluation predictions.

Calibration learns an error margin from familiar conditions. It does not automatically enlarge that margin when a new condition causes larger errors. Split-conformal coverage relies on statistically interchangeable calibration and future examples—the exchangeability assumption. These process changes do not establish that assumption.

Inspect uncertainty models, interval widths and error
M07 selected scalar pipelines and prediction intervals; separate fits from the M04 baseline.
Evaluation populationSelected familyCycles (n)CoverageMean width (g)MAE (g)
Represented conditions · pooledLightGBM16786.2% (144/167)0.1940.052
Unseen experiment · pooledLightGBM / PLS8295.2% (43/829)0.3420.735
Unseen experiment · experiment 15LightGBM3030.0% (0/303)0.1880.869
Unseen experiment · experiment 20LightGBM22318.8% (42/223)0.2690.469
Unseen experiment · experiment 23PLS3030.33% (1/303)0.5500.798

The model is chosen separately for each evaluation setup. These point errors belong to the uncertainty branch, not the scalar PLS comparison above. Interval width is constant within a fitted fold. Calibration-set coverage is not reported as evaluation performance.

Uncertainty method, selection boundary and full results

Could input novelty identify more reliable predictions?

The study tested one fixed distance score: the average distance to five nearby training cycles after rescaling the scalar features using training data. Keeping the closest 75% of development predictions had to reduce MAE by at least 10% in every held-out-experiment setup.

Development distance gate. These outcomes describe screening data, not final held-out cycles.
Experiment excludedScreening experimentsMean relative MAE reductionCriterion met?
1520 and 2319.7%Yes
2015 and 234.3%No
2315 and 2016.3%Yes

One setup failed, so the selective-measurement study was skipped. These are development-screen results on the listed experiments, not screening performance on the excluded experiment. Model selection reused the development labels, so the screen is selection-affected and may be optimistic. No measurement savings or safe measurement-skipping policy was demonstrated.

What predictive explanations can tell us

Permutation importance asks how much prediction error changes when a feature’s values are shuffled. The leading feature changed across evaluated populations, and correlated temperature channels often acted as condition proxies. Marginal training-range departures describe unfamiliar inputs. Neither diagnostic establishes a universal sensor ranking, a causal mechanism, or a validated drift detector.

Decision implication: retain physical measurement. A follow-up should collect labeled examples across a broader operating envelope—the combinations and ranges of supported process conditions—and evaluate complete conditions, lots or machines prospectively. This study did not compare data-collection strategies or validate that proposed workflow.

Weight is one quality characteristic. Without authoritative tolerances, MAE cannot establish product conformance or production adequacy. The study covers three controlled transfer scenarios, not arbitrary future factory changes.

Read the evidence without installing the project

This file contains the report, styles, aggregate charts and tables. It opens offline and requires no account or Python environment. Supporting repository and source links need internet access. The local Streamlit dashboard offers additional views of saved evidence.

Regenerate this presentation or reproduce the study

After producing the saved study artifacts, regenerate the report from the repository root:

uv run python scripts/render_portfolio_report.py

Rendering checks existing source/membership lineage, aggregates saved outputs, and writes this HTML. It does not fit models, acquire data, retune candidates or reopen evaluation. A fresh clone contains this report and maintained milestone summaries; raw/prepared data and full numeric run artifacts remain local and ignored. The tracked audit notebook has no saved outputs.

To reproduce the analysis, follow the README sequence. That route acquires the pinned public Dataset 2 archive and runs the predefined experiments. The repository’s synthetic tests check source and modeling contracts; they do not independently reproduce this real-data study or establish production readiness.

Source identity and attribution

Source measurements: Bogedale et al., scatimdata Dataset 2, associated with Online Prediction of Molded Part Quality in the Injection Molding Process Using High-Resolution Time Series (2023), licensed CC BY 4.0.

The source data were joined into English-named canonical tables and analyzed by this project. Charts and tables are this project’s derived summaries, not publisher figures. Project code and report prose use the MIT license; the underlying source retains its attribution requirements.

Source commit: 7bd35941d75c97a3f276439377dc430ab47402be

Source archive SHA-256: 69294087889a52791c296734051d6b21b30847c2859613e4178074182150c491

Evaluation memberships SHA-256: 3b10bfdb4672e42790b632913d0b8ffa123d54d91e93a4e1885b12238f7b0c59

Pinned source manifest · Data licensing and rendered-evidence policy