CoolFace
Datasetpublic

ULM-DS-Lab/food-composition-matrix

Food Composition Nutrient Matrix — TKPI 2017 & USDA SR Legacy 2018 This repository contains two food composition datasets reformatted as wide-format nutrient matrices, suitable for a wide range of research tasks including nutrient prediction, food type classification, missing value imputation, dietary analysis, and other machine learning applications on food data. Both datasets share a harmonised set of 18 common nutrients, enabling cross-dataset generalization experiments.… See the full description on the dataset page: https://huggingface.co/datasets/ULM-DS-Lab/food-composition-matrix.

sourceHugging Faceotherupdated 6mo agoView on Hugging Face
1likes38downloads
Dataset Card

Food Composition Nutrient Matrix — TKPI 2017 & USDA SR Legacy 2018

This repository contains two food composition datasets reformatted as wide-format nutrient matrices, suitable for a wide range of research tasks including nutrient prediction, food type classification, missing value imputation, dietary analysis, and other machine learning applications on food data. Both datasets share a harmonised set of 18 common nutrients, enabling cross-dataset generalization experiments.

Subsets

SubsetFoodsNutrientsGeographyMissingness
tkpi1,14619IndonesiaModerate–high (15–53% by nutrient)
usda_sr_legacy7,79318USA / InternationalNear-complete

Load a specific subset:

python
from datasets import load_dataset

tkpi  = load_dataset("ULM-DS-Lab/food-composition-matrix", name="tkpi")
usda  = load_dataset("ULM-DS-Lab/food-composition-matrix", name="usda_sr_legacy")

Subset 1 — TKPI 2017 (tkpi)

Source

Kementerian Kesehatan Republik Indonesia. (2017). Tabel Komposisi Pangan Indonesia 2017. Jakarta: Kemenkes RI. https://repository.kemkes.go.id/book/777

TKPI 2017 (Tabel Komposisi Pangan Indonesia) is the official Indonesian Food Composition Table published by the Indonesian Ministry of Health. It extends TKPI 2009 through imputation of missing values (imputed values and borrowed values) and addition of new foods sourced from Badan Ketahanan Pangan, Kementerian Pertanian (Food Security Agency, Ministry of Agriculture).

The original publication is a PDF. This CSV was produced by OCR digitisation followed by manual verification to correct recognition errors.

Columns

ColumnOriginal (Indonesian)DescriptionUnit
KODEKODEFood code
NAMA_BAHANNAMA BAHANFood name (Indonesian)
GOLONGANGOLONGANFood group / category
EnergyENERGIEnergykcal
ProteinPROTEINProteing
FatLEMAKTotal fatg
CarbohydrateKHCarbohydrate (by difference)g
FiberSERATDietary fiberg
CalciumKALSIUMCalciummg
PhosphorusFOSFORPhosphorusmg
IronBESIIronmg
SodiumNATRIUMSodiummg
PotassiumKALIUMPotassiummg
CopperTEMBAGACoppermg
ZincSENGZincmg
RetinolRETINOLRetinol (preformed Vitamin A)µg
Beta_CaroteneBKARBeta-Caroteneµg
Total_CarotenoidsKARTOTALTotal Carotenoidsµg
ThiamineTHIAMINThiamine (Vitamin B1)mg
RiboflavinRIBOFLAVINRiboflavin (Vitamin B2)mg
NiacinNIASINNiacin (Vitamin B3)mg
Vitamin_CVIT_CVitamin Cmg

Missingness Profile

Missing values (NaN) indicate nutrients not measured for that food. Zeros are genuine observed values.

NutrientApprox. Missing (%)
Retinol~53%
Total_Carotenoids~47%
Beta_Carotene~41%
Potassium~28%
Copper~21%
Zinc~19%
Fiber~15%
Remaining<10%

Underlying Sources (TKPI 2009 and predecessors)

  1. 1.Lie Goan Hong dan Oey Kam Nio, 1964. Daftar Analisis Bahan Pangan. Lembaga Makanan Rakyat. Jakarta.
  2. 2.Mahmud Mien K et al., 1990. Komposisi Zat Gizi Pangan Indonesia. Departemen Kesehatan R.I.
  3. 3.Mien Karmini et al., 2001. Komposisi Zat Gizi Pangan Indonesia. Departemen Kesehatan RI.
  4. 4.Mahmud, Mien K, Hermana, dan Rossi Rozanna, 1993. Komposisi Zat Gizi Pangan Siap Santap. Puslitbang Gizi, Balitbangkes.
  5. 5.Oei Kam Nio, 1992. Daftar Analisis Bahan Pangan. Universitas Indonesia. Jakarta.
  6. 6.Woot-Tsuen Wu Leung et al., 1972. Food Composition Table for Use in East Asia. FAO / US DHEW.

License

TKPI 2017 is an official publication of the Indonesian Ministry of Health (Kemenkes RI), publicly accessible at https://repository.kemkes.go.id/book/777. Users should cite the original publication and verify redistribution rights with Kemenkes RI for commercial use.

Citation:

Kementerian Kesehatan Republik Indonesia. (2017). Tabel Komposisi Pangan Indonesia 2017.
Jakarta: Kemenkes RI. https://repository.kemkes.go.id/book/777

Subset 2 — USDA SR Legacy 2018 (usda_sr_legacy)

Source

U.S. Department of Agriculture, Agricultural Research Service. (2018). USDA Standard Reference Legacy Release. FoodData Central. https://fdc.nal.usda.gov/download-datasets.html

SR Legacy is the historical USDA Standard Reference database, now hosted on FoodData Central. It is a public domain US government work with no restrictions on use or redistribution.

Preprocessing Applied

The original release is a relational long-format database (food.csv + food_nutrient.csv). Preprocessing for this subset:

  1. 1.Filtered to 18 target nutrients matched to the TKPI nutrient set (see table below).
  2. 2.Pivoted from long to wide format (one row per food, one column per nutrient).
  3. 3.Retained only rows with at least one non-NaN value.
  4. 4.Column headers renamed to English standard names for cross-dataset compatibility.
  5. 5.No imputation applied — NaN reflects genuine absence of measurement.

Columns

ColumnUSDA Nutrient IDDescriptionUnit
fdc_idFoodData Central food ID
descriptionFood description (English)
Energy1008Energykcal
Protein1003Proteing
Fat1004Total lipid (fat)g
Carbohydrate1005Carbohydrate, by differenceg
Fiber1079Fiber, total dietaryg
Calcium1087Calcium, Camg
Phosphorus1091Phosphorus, Pmg
Iron1089Iron, Femg
Sodium1093Sodium, Namg
Potassium1092Potassium, Kmg
Copper1098Copper, Cumg
Zinc1095Zinc, Znmg
Retinol1105Retinolµg
Beta_Carotene1107Carotene, betaµg
Thiamine1165Thiaminmg
Riboflavin1166Riboflavinmg
Niacin1167Niacinmg
Vitamin_C1162Vitamin C, total ascorbic acidmg
Total_Carotenoids is present in TKPI but has no direct equivalent in SR Legacy and is therefore excluded from this subset.

License

USDA SR Legacy is a US government work in the public domain. No restrictions apply. See: https://www.ars.usda.gov/about-ars/ars-is-public-domain/

Citation:

U.S. Department of Agriculture, Agricultural Research Service. (2018).
USDA Standard Reference Legacy Release. FoodData Central.
https://fdc.nal.usda.gov/

Dataset Comparison

Property`tkpi``usda_sr_legacy`
Foods1,1467,793
Nutrients1918
GeographyIndonesiaUSA / International
LanguageIndonesianEnglish
Natural missingnessModerate–highNear-complete
SVD rank (66%+ variance)Rank 3 (66.6%)Rank 3 (71.8%)
KNN–SoftImpute crossover~25% missing~35–40% missing
LicenseKemenkes RI (open access)US Public Domain

Repository File Structure

food-composition-matrix/
├── README.md                     ← this file
├── tkpi_2017.csv                 ← TKPI subset (1,146 × 22 columns)
└── usda_sr_legacy_2018_wide.csv  ← USDA subset (7,793 × 20 columns)

Citation (this dataset)

F Indriani. (2026). Food Composition Nutrient Matrix — TKPI 2017 & USDA SR Legacy 2018 [Data set].
Hugging Face. https://huggingface.co/datasets/ULM-DS-Lab/food-composition-matrix