Skip to content

R package to derive probability that any two food items are the same

License

Notifications You must be signed in to change notification settings

armandvalsesia/FoodC5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travis-CI Build Status AppVeyor build status

FoodC5

R package to derive probability that any two food items are the same

Overview

FoodC5 is an R package providing an interface to a pre-trained C5.0 classification model. This C5.0 tree enables to predict whether any two food items are the same. It requires the following input parameters:

  • fuzzy score: similary between the two food names
  • information on how much the two items differ in energy content

The fuzzy score can be computed with with the Foodmapping R package. The difference in energy content can be expressed as 100 * abs( itemA_energy_content - itemB_energy_content ) / itemA_energy_content.

Installation

To install, run the following commands in R:

install.packages("devtools")
devtools::install_github("armandvalsesia/FoodC5", build_vignettes = TRUE)

Quick Start

require("FoodC5")

# load example dataset
data(food_score)

# Compute probability based on a comparison using the English-translated food names
preds <- c5_one_language(food_score,  'ENG_SCORE', 'EDIFF')


# Compute probability based on a comparison using the original food names
# this model is trained for the following languages: English, Dutch, Danish, and a modest subset for Greek, Spanish and Bulgarian.  
preds <- c5_one_language(food_score,  'ENG_SCORE', 'EDIFF', c5_object = read_c50_ori())

License and authors

This software uses the GPL v3 license, see LICENSE. Authors and copyright are provided in DESCRIPTION.

Big thanks to Hélène Ruffieux and Radu Popescu for help with CI.

About

R package to derive probability that any two food items are the same

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages