Dataset Viewer
Auto-converted to Parquet Duplicate
source_id
stringlengths
9
9
serving_size_g
float64
14
45
servings_per_container
float64
1
58
calories
float64
60
220
total_fat_g
float64
1.5
15
sodium_mg
float64
5
410
carbs_g
float64
10
29
sugar_g
float64
0
23
protein_g
float64
0.5
10
category
stringclasses
5 values
parent_id
stringlengths
9
9
augmentation
stringclasses
1 value
is_augmented
bool
1 class
second_parent_id
stringlengths
9
9
mix_weight
float64
1
1
Snack_001
28
6
150
9
160
16
0.5
1
chips
Snack_001
none
false
Snack_001
1
Snack_002
28
15
160
10
180
15
1
2
chips
Snack_002
none
false
Snack_002
1
Snack_003
28
7
140
6
110
19
2
2
chips
Snack_003
none
false
Snack_003
1
Snack_004
28
5
150
8
190
18
0.5
2
chips
Snack_004
none
false
Snack_004
1
Snack_005
28
9
160
11
210
15
0
1
chips
Snack_005
none
false
Snack_005
1
Snack_006
28
24
150
8
115
17
0
2
chips
Snack_006
none
false
Snack_006
1
Snack_007
14
26
60
2.5
140
10
2
0.5
crackers
Snack_007
none
false
Snack_007
1
Snack_008
16
28
70
1.5
135
12
0
1
crackers
Snack_008
none
false
Snack_008
1
Snack_009
39
8
200
10
290
23
5
4
crackers
Snack_009
none
false
Snack_009
1
Snack_010
16
24
80
4.5
130
10
1
0.5
crackers
Snack_010
none
false
Snack_010
1
Snack_011
30
1
130
8
410
10
2
10
crackers
Snack_011
none
false
Snack_011
1
Snack_012
15
36
70
2.5
120
10
2
1
crackers
Snack_012
none
false
Snack_012
1
Snack_013
28
1
140
5
110
21
11
1
cookies
Snack_013
none
false
Snack_013
1
Snack_014
28
1
140
7
75
19
8
1
cookies
Snack_014
none
false
Snack_014
1
Snack_015
28
7
140
7
160
18
12
2
cookies
Snack_015
none
false
Snack_015
1
Snack_016
31
8
130
5
85
21
12
1
cookies
Snack_016
none
false
Snack_016
1
Snack_017
44
10
220
10
140
29
14
2
cookies
Snack_017
none
false
Snack_017
1
Snack_018
31
8
150
6
115
23
12
2
cookies
Snack_018
none
false
Snack_018
1
Snack_019
17
5
80
4
40
10
9
1
candy
Snack_019
none
false
Snack_019
1
Snack_020
42
36
210
11
20
28
23
2
candy
Snack_020
none
false
Snack_020
1
Snack_021
21
2
120
8
20
11
10
2
candy
Snack_021
none
false
Snack_021
1
Snack_022
30
33
150
7
60
20
15
1
candy
Snack_022
none
false
Snack_022
1
Snack_023
30
2
170
11
90
15
12
3
candy
Snack_023
none
false
Snack_023
1
Snack_024
30
3.5
140
6
90
20
12
3
candy
Snack_024
none
false
Snack_024
1
Snack_025
36
15
200
12
80
21
9
2
granola_bars
Snack_025
none
false
Snack_025
1
Snack_026
24
58
100
3.5
70
17
7
1
granola_bars
Snack_026
none
false
Snack_026
1
Snack_027
45
1
200
11
110
21
7
7
granola_bars
Snack_027
none
false
Snack_027
1
Snack_028
40
12
190
15
140
16
5
6
granola_bars
Snack_028
none
false
Snack_028
1
Snack_029
43
2
200
11
60
22
9
5
granola_bars
Snack_029
none
false
Snack_029
1
Snack_030
24
40
100
3
5
17
6
2
granola_bars
Snack_030
none
false
Snack_030
1

24-679 (Fall 2026): Packaged Snack Nutrition

shanexf/packaged-snack-nutrition

Nutrition Facts values for 30 packaged snack products, hand-collected from package labels, plus explicitly marked synthetic variants. The classroom classification task predicts the snack category (chips, crackers, cookies, candy, granola_bars) from eight per-serving nutrition numbers.

Source and task

Each original row is one product. The eight features were read directly from the product's Nutrition Facts panel: serving size (g), servings per container, calories, total fat (g), sodium (mg), total carbohydrate (g), sugar (g), and protein (g). The category is the type of snack the product is sold as; six products were collected for each of five categories. The preparation notebook reads Package food nutritional value.csv, keeps the collected sample_id as source_id, and checks that every value is finite and nonnegative, that serving fields are positive, and that sugar never exceeds total carbohydrate. These checks establish valid domains, not the accuracy of a label.

Course: 24-679, Fall 2026, Carnegie Mellon University. Repository maintainer: the account shown above.

Fields

Stored field / group Meaning and modeling role
serving_size_g, servings_per_container Continuous features from the label; strictly positive.
calories, total_fat_g, sodium_mg, carbs_g, sugar_g, protein_g Continuous per-serving nutrition features; nonnegative.
category Nominal classification target with five classes. Synthetic rows inherit it from their parents.
source_id, parent_id, second_parent_id Unique example key and original source keys; provenance only.
augmentation, is_augmented, mix_weight Method, synthetic flag, and primary-parent weight; exclude from predictors.

Numeric features are stored as floats in both splits. The machine-readable feature metadata at the top of this card preserves every exact column name and storage type.

Splits

These counts are computed from the packaged splits for this run.

Split Original rows Synthetic rows Total rows
original 30 0 30
augmented 0 399 399
train 21 399 420
validation 4 0 4
test 5 0 5
Split Category Rows
original candy 6
original chips 6
original cookies 6
original crackers 6
original granola_bars 6
augmented candy 76
augmented chips 74
augmented cookies 76
augmented crackers 96
augmented granola_bars 77
train candy 80
train chips 78
train cookies 80
train crackers 101
train granola_bars 81
validation candy 1
validation chips 1
validation cookies 1
validation granola_bars 1
test candy 1
test chips 1
test cookies 1
test crackers 1
test granola_bars 1

original holds the 30 collected rows unchanged and augmented holds only synthetic rows; these two splits are the assignment deliverable. The remaining splits support model comparison: original rows were randomly partitioned before augmentation (holdout fraction 30%, stratified by category, seed 24679; test receives 50% of that holdout, seed 24680). train = training originals + every synthetic row; validation and test = untouched holdout originals. Every parent of every synthetic row is a training original, so no holdout product has a synthetic child anywhere in the dataset. augmented is exactly the synthetic portion of train. Keep these boundaries fixed for downstream comparisons; changing or reordering the source CSV changes them.

Augmentation and preprocessing

This run requests 5 copies per method and original training row before filtering (seed 24679). Unchanged rows and repeated feature combinations for a given primary parent are removed. Every synthetic value is rounded to the resolution printed on a Nutrition Facts label (1 g serving size, 0.5 servings, 5 kcal, 0.5 g fat/sugar/protein, 5 mg sodium, 1 g carbohydrate) and clipped to its domain.

  • Additive numeric jitter: perturb every feature with Gaussian noise. Each standard deviation is max(5% of that column's IQR, one label step).
  • Multiplicative numeric scaling: independently multiply each feature by a factor in 0.90–1.10.
  • Within-class Mixup: select two distinct original parents from the same category. Apply the same primary weight in 0.60–0.90 to all eight features; copy the shared category; record both parents and the weight.
  • Within-class nearest-neighbor interpolation (SMOTE-style): select one of the 3 nearest same-category products in standardized feature space and place the child at a uniform step along the segment between them; mix_weight stores the primary parent's share.

No method changes the category. Original and single-parent rows repeat the primary key in second_parent_id and use mix_weight=1.0. Categorical perturbation and CTGAN are not used.

Augmentation method Stored rows
additive_numeric_jitter 105
multiplicative_numeric_scale 105
within_class_mixup 99
within_class_neighbor_interpolation 90

Intended use and limitations

Use for teaching tabular data contracts, provenance, augmentation, and small-sample classification. Thirty products from a small number of brands do not represent the packaged-food market, and categories overlap in nutrition space (a sweet granola bar can resemble a cookie). Synthetic rows add spread around real products but not new independent products; a domain-valid synthetic row may still describe a product nobody sells. Compare training on the original training rows alone against the train split, using the same validation and test rows; report accuracy and macro-F1 against a majority-class baseline. With four or five holdout rows per partition, scores will be noisy. Do not use this classroom sample for nutrition guidance or consequential decisions.

Privacy and licensing

The data describe products, not people; no personal information is included. Values were transcribed from public package labels. No license was specified in repository metadata when this card was first added; this card does not assign one.

Load

from datasets import load_dataset
ds = load_dataset("shanexf/packaged-snack-nutrition")
original, augmented = ds["original"], ds["augmented"]
# Train with ds["train"], choose settings with ds["validation"], then score ds["test"].

Regenerate this card with the preparation notebook after changing the data; its counts are calculated from the actual packaged splits. The YAML schema and split configuration are preserved from the upload.

Downloads last month
40