f-indriani's picture
Update README.md
86f7d1d verified
metadata
license: other
pretty_name: Food Composition Nutrient Matrix  TKPI 2017 & USDA SR Legacy 2018
size_categories:
  - 1K<n<10K
task_categories:
  - tabular-regression
tags:
  - food
  - nutrition
  - food-composition
  - matrix-completion
  - imputation
  - nutrient
  - indonesia
  - usda
configs:
  - config_name: tkpi
    data_files: tkpi_2017.csv
    default: true
  - config_name: usda_sr_legacy
    data_files: usda_sr_legacy_2018_wide.csv
dataset_info:
  - config_name: tkpi
    features:
      - name: KODE
        dtype: string
      - name: Energy
        dtype: float64
      - name: Protein
        dtype: float64
      - name: Fat
        dtype: float64
      - name: Carbohydrate
        dtype: float64
      - name: Fiber
        dtype: float64
      - name: Calcium
        dtype: float64
      - name: Phosphorus
        dtype: float64
      - name: Iron
        dtype: float64
      - name: Sodium
        dtype: float64
      - name: Potassium
        dtype: float64
      - name: Copper
        dtype: float64
      - name: Zinc
        dtype: float64
      - name: Retinol
        dtype: float64
      - name: Beta_Carotene
        dtype: float64
      - name: Total_Carotenoids
        dtype: float64
      - name: Thiamine
        dtype: float64
      - name: Riboflavin
        dtype: float64
      - name: Niacin
        dtype: float64
      - name: Vitamin_C
        dtype: float64
    splits:
      - name: train
        num_examples: 1146
  - config_name: usda_sr_legacy
    features:
      - name: fdc_id
        dtype: int64
      - name: description
        dtype: string
      - name: Energy
        dtype: float64
      - name: Protein
        dtype: float64
      - name: Fat
        dtype: float64
      - name: Carbohydrate
        dtype: float64
      - name: Fiber
        dtype: float64
      - name: Calcium
        dtype: float64
      - name: Phosphorus
        dtype: float64
      - name: Iron
        dtype: float64
      - name: Sodium
        dtype: float64
      - name: Potassium
        dtype: float64
      - name: Copper
        dtype: float64
      - name: Zinc
        dtype: float64
      - name: Retinol
        dtype: float64
      - name: Beta_Carotene
        dtype: float64
      - name: Thiamine
        dtype: float64
      - name: Riboflavin
        dtype: float64
      - name: Niacin
        dtype: float64
      - name: Vitamin_C
        dtype: float64
    splits:
      - name: train
        num_examples: 7793

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

Subset Foods Nutrients Geography Missingness
tkpi 1,146 19 Indonesia Moderate–high (15–53% by nutrient)
usda_sr_legacy 7,793 18 USA / International Near-complete

Load a specific subset:

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

Column Original (Indonesian) Description Unit
KODE KODE Food code
NAMA_BAHAN NAMA BAHAN Food name (Indonesian)
GOLONGAN GOLONGAN Food group / category
Energy ENERGI Energy kcal
Protein PROTEIN Protein g
Fat LEMAK Total fat g
Carbohydrate KH Carbohydrate (by difference) g
Fiber SERAT Dietary fiber g
Calcium KALSIUM Calcium mg
Phosphorus FOSFOR Phosphorus mg
Iron BESI Iron mg
Sodium NATRIUM Sodium mg
Potassium KALIUM Potassium mg
Copper TEMBAGA Copper mg
Zinc SENG Zinc mg
Retinol RETINOL Retinol (preformed Vitamin A) µg
Beta_Carotene BKAR Beta-Carotene µg
Total_Carotenoids KARTOTAL Total Carotenoids µg
Thiamine THIAMIN Thiamine (Vitamin B1) mg
Riboflavin RIBOFLAVIN Riboflavin (Vitamin B2) mg
Niacin NIASIN Niacin (Vitamin B3) mg
Vitamin_C VIT_C Vitamin C mg

Missingness Profile

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

Nutrient Approx. 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. Lie Goan Hong dan Oey Kam Nio, 1964. Daftar Analisis Bahan Pangan. Lembaga Makanan Rakyat. Jakarta.
  2. Mahmud Mien K et al., 1990. Komposisi Zat Gizi Pangan Indonesia. Departemen Kesehatan R.I.
  3. Mien Karmini et al., 2001. Komposisi Zat Gizi Pangan Indonesia. Departemen Kesehatan RI.
  4. Mahmud, Mien K, Hermana, dan Rossi Rozanna, 1993. Komposisi Zat Gizi Pangan Siap Santap. Puslitbang Gizi, Balitbangkes.
  5. Oei Kam Nio, 1992. Daftar Analisis Bahan Pangan. Universitas Indonesia. Jakarta.
  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. Filtered to 18 target nutrients matched to the TKPI nutrient set (see table below).
  2. Pivoted from long to wide format (one row per food, one column per nutrient).
  3. Retained only rows with at least one non-NaN value.
  4. Column headers renamed to English standard names for cross-dataset compatibility.
  5. No imputation applied — NaN reflects genuine absence of measurement.

Columns

Column USDA Nutrient ID Description Unit
fdc_id FoodData Central food ID
description Food description (English)
Energy 1008 Energy kcal
Protein 1003 Protein g
Fat 1004 Total lipid (fat) g
Carbohydrate 1005 Carbohydrate, by difference g
Fiber 1079 Fiber, total dietary g
Calcium 1087 Calcium, Ca mg
Phosphorus 1091 Phosphorus, P mg
Iron 1089 Iron, Fe mg
Sodium 1093 Sodium, Na mg
Potassium 1092 Potassium, K mg
Copper 1098 Copper, Cu mg
Zinc 1095 Zinc, Zn mg
Retinol 1105 Retinol µg
Beta_Carotene 1107 Carotene, beta µg
Thiamine 1165 Thiamin mg
Riboflavin 1166 Riboflavin mg
Niacin 1167 Niacin mg
Vitamin_C 1162 Vitamin C, total ascorbic acid mg

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
Foods 1,146 7,793
Nutrients 19 18
Geography Indonesia USA / International
Language Indonesian English
Natural missingness Moderate–high Near-complete
SVD rank (66%+ variance) Rank 3 (66.6%) Rank 3 (71.8%)
KNN–SoftImpute crossover ~25% missing ~35–40% missing
License Kemenkes 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