Giter VIP home page Giter VIP logo

nutrient-db's Introduction

Nutrient Analysis

Nutrient-db (https://github.com/schirinos/nutrient-db) is a program to convert the USDA National Nutrient Database for Standard Reference (http://www.ars.usda.gov/ba/bhnrc/ndl) from the flat files they provide into a relational database. Let's see what interesting observations we can learn from it. Note that these require Python3.x.

Using k-means analysis (explained in the presentation), you can see if it makes sense to separate foods into 2, 3, 4... groups. Can the computer "learn" what the food groups are from nutrition data?

nutrientslist.py - Simply lists each nutritional value.

kmeansclick.py - Click various points, and close each window to see the next k-mean clustering. Which separation fits best?

foodcluster.py Tries to cluster the USDA database intro food groups. Spoiler alert, they are very separable into 2,3,4, or 5 groups. After running this, note the central foods of each group and read outputs in (NClusters-n) output files.

For 5 clusters the average silhouette score is 0.840297
#1 Turnover, filled with egg, meat and cheese, frozen off by 607.120245
#2 HOT POCKETS, CROISSANT POCKETS Chicken, Broccoli, and Cheddar Stuffed Sandwich, frozen off by 607.120245
#3 HOT POCKETS, CROISSANT POCKETS Chicken, Broccoli, and Cheddar Stuffed Sandwich, frozen off by 607.120245


#1 Veal, variety meats and by-products, liver, cooked, braised off by 37625.011750
#2 Beef, New Zealand, imported, variety meats and by-products liver, cooked, boiled off by 37625.011750
#3 Beef, New Zealand, imported, variety meats and by-products liver, cooked, boiled off by 37625.011750


#1 Beef, variety meats and by-products, liver, cooked, braised off by 17710.545346
#2 Beef, variety meats and by-products, liver, cooked, pan-fried off by 17710.545346
#3 Beef, variety meats and by-products, liver, cooked, pan-fried off by 17710.545346


#1 Peas and carrots, frozen, cooked, boiled, drained, with salt off by 6637.241690
#2 Peas and carrots, frozen, cooked, boiled, drained, without salt off by 6637.241690
#3 Peas and carrots, frozen, cooked, boiled, drained, without salt off by 6637.241690


#1 Tomato products, canned, sauce, with onions, green peppers, and celery off by 2211.156050
#2 Tomato products, canned, sauce, with mushrooms off by 2211.156050
#3 Tomato products, canned, sauce, with mushrooms off by 2211.156050

USDA National Nutrient Database for Standard Reference (http://www.ars.usda.gov/ba/bhnrc/ndl)

nutrient-db's People

Contributors

asazernik avatar schirinos avatar gesinger avatar philtom avatar

Watchers

James Cloos avatar Joshua Belden avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.