Coder Social home page Coder Social logo

fqcforsorfml's Introduction

Summary

This is modified version of the FoodQualityController R package which is optimised for the back-end side of sorfML 2.0. FQC is a flexible and user-friendly R package that is used to identify, validate, and optimise the most suitable machine learning platform for the given analytical platform. 14 machine learning models are created in the package to predict microbial quality in food products.

Table of Contents

FoodQualityController workflow

The typical workflow of FoodQualityController is outlined below:

Installation

Dependencies

FoodQualityController needs the following:

  • R (tested on version 4.2.2)
  • The following R libraries: (The number is the version tested during development)
   caret (6.0.91)             neuralnet (1.44.2)
   colorRamps (2.3.1)         openxlsx (4.2.5)
   Boruta (7.0.0)             pls (2.8.0)
   configr (0.3.5)            plyr (1.8.7) 
   corrplot (0.92)            randomForest (4.7.1) 
   doParallel (1.0.17)        rpart (4.1.16)
   e1071 (1.7.9)              shape (1.4.6)
   foreach (1.5.2)            tools (4.1.1)
   glmnet (4.1.3)             viridis (0.6.2)
   mixOmics (6.16.3)          xgboost (1.5.2.1)

Note: The package is platform-independent; it was developed and runs on multiple operating systems (Windows, MacOS).

All dependencies should be installed together with the FoodQualityController package, however, they can be installed separately. To install all required CRAN dependencies of FoodQualityController, type the following in R:

> install.packages(c("caret", "colorRamps", "Boruta", "corrplot", "doParallel", "e1071", "foreach", "glmnet", "mixOmics", "neuralnet" ,
"openxlsx", "pls", "plyr", "randomForest", "rpart", "shape", "tools", "viridis", "xgboost"))

Install FoodQualityController from source

You can download the latest source from the FQCforSorfml GitHub repository page.

An example installation of FQC onto your environment using git command.

Type the command below in your terminal:

% git clone https://github.com/shin-kinos/FQCforSorfml.git

Then, go to R consosle, and install the source package:

> library(utils)
> install.packages("FQCforSorfml", repos = NULL, type = "source", dependencies=TRUE)

Quick Start

Load FoodQualityController

Once the package is installed, to start using FoodQualityController simply load the FoodQualityController package in R:

> library(FoodQualityController)

Reading application parameters from configuration file

FoodQualityController can read configuration file in json format. assess.quality which is the main function of FoodQualityController takes name of the configuration file as parameter. Configuration file contains user-defined parameters which are required by the application.

Example of a input files is as following:

example input file

Reading data from input files

Input datafiles from different analytical platforms contain microbial data on which machine learning models run. Name of the datafiles with absolute directory path should be provided with dataFileName tag under platformList tag in the configuration file, for more details see in 'Input configuration file format' section.

How to run FoodQualityController

The main and only function that is exported to the user in FoodQualityController package is assess.quality.

It is called as following with configuration file name as method parameter.

> assess.quality("/Users/shintarokinoshita/Cranfield/FoodQualityController/input/config.json")

Creating output files

Output directory is provided in outputDirectory section of configuration file by the user. If it is not provided, the output directory becomes the current working directory.

The general structure of the output directory and files are below:

example output dir

  • rankRmse.csv : List of ML models which are sorted based on the RMSEs. ✅Note that the format of this data are optimised for LaTeX document preparation.
  • <PlatformName>_PCA.pdf : PCA plot of analytical data.
  • <PlatformName>_RMSE_Means.pdf : Line plot of the RMSE scores in each iteration between the ML models.
  • <PlatformName>_RSquare_Means.pdf : Line plot of the RSquare scores in each iteration between the ML models.
  • result.csv : CSV data recording results of the evaluation Statistics in each ML model.
  • RSME_Statistics.csv : CSV data recording RMSEs in each model.
  • RSquare_Statistics.csv : CSV data recording RSquares in each model.
  • <PlatformName>_<BacterialName>_<MLmodelName>.rda : RDA data containing the model information which aqcuired the lowest RMSE throughout the iterations.
  • <PlatformName>_<BacterialName>_<MLmodelName>.txt : Text data containing the lowest RMSE in the ML model.

Accessing help

To access help pages for any of the functions or built-in data provided by FoodQualityController, prefix the name of the function or data set with a question mark, e.g. to get additional information on the assess.quality function, type the following in R:

?assess.quality

fqcforsorfml's People

Contributors

ozlemkaradeniz avatar parthdoshi97 avatar shin-kinos avatar

Forkers

leasaxton

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.