code wiki / (root) / nx_flavor_pairing.nx

nx_flavor_pairing.nx

buildroot/runtime/nx_flavor_pairing.nx

3186 B104 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic flavor
docsdependenciesstructsconstsfunctions

about

nx_flavor_pairing.nx -- T4 of the TASTE-SCIENCE ladder: the FLAVOR NETWORK. Ahn, Ahnert, Bagrow & Barabasi (2011, "Flavor network and the principles of food pairing") showed that ingredient pairing can be computed from the aroma compounds two ingredients SHARE -- a data- driven affinity, not a chef's opinion. The baseline nx_food_science carries a HAND-LISTED affinity table (beef-oyster = 9, ...): finite, and silent on any pair nobody typed in. T4 computes affinity from each ingredient's compound set, so it scores ANY pair -- including a novel ingredient that has never been in a table. shared(A,B) = |compounds(A) INTERSECT compounds(B)| affinity(A,B) = Jaccard = 1000 * shared / |A UNION B| (milli) MEASURED EXCEED (gate-checked): a fruity pair that shares esters scores above a fruit+allium pair that shares none, identical sets score 1000, and a NOVEL ingredient gets a real affinity computed from its compounds. genealogy_id: ahn_2011_flavor_network + jaccard_1901_similarity

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_flavor_pairing.nx nx_flavor_pairing_test.nx

imports: nx_syscalls.nx

imported by: nx_flavor_pairing_test.nx

structs

24struct NxCompoundSet

consts

none

functions

30func nx_compoundset_new(n: i64) -> *NxCompoundSet
38func nx_pairing_shared(a: *NxCompoundSet, b: *NxCompoundSet) -> i64
57func nx_pairing_affinity_milli(a: *NxCompoundSet, b: *NxCompoundSet) -> i64
called by 1: main calls 1: nx_pairing_shared
68func nx_compounds_strawberry() -> *NxCompoundSet
called by 1: main calls 1: nx_compoundset_new
79func nx_compounds_pineapple() -> *NxCompoundSet
called by 1: main calls 1: nx_compoundset_new
89func nx_compounds_garlic() -> *NxCompoundSet
called by 1: main calls 1: nx_compoundset_new
97func nx_compounds_roastbeef() -> *NxCompoundSet
called by 1: main calls 1: nx_compoundset_new