
This repository contains all the supplemental files and scripts for the Nature Communications paper 'Predicting and Improving Complex Beer Flavor through Machine Learning'.Init_modeling.py Helper script that contains some functions for model performance evaluation and storage. Jupyter Notebook for training machine learning models.ipynb Jupyter notebook containing the code to train the 10 different machine learning models of the research article, including hyperparameter optimization and model performance evaluation. The 10 models included are: Linear regression Lasso regression Partial least squares regression Random Forest regression Extra-trees regression Adaboosted regression Gradient boosting regression XGBoosting regression Support vector regression Multi-layered perception Machine learning models transcript.py A direct copy of the Jupyter Notebook, as a regular Python script. Main figure generator.Rmd R Markdown file that generates the figures from the paper's main text. Sensory data quality control - ANOVA on repeated samples.Rmd R Markdown file that performs ANOVA on the beer samples that were repeated in multiple sessions with the trained panel. Supplemental Figure generator.Rmd R Markdown file that generates the supplemental figures of the paper. Supplemental Files and Figure source files.xlsx Excel file containing all the supplemental files and tables, and the raw data underlying every figure (main and supplemental) in the manuscript. RateBeer_Appreciation_Gradient_Boost_Regressor.pkl Pickled version of the best-performing model for predicting RateBeer Appreciation from chemical composition (Python version 3.9.16). RateBeer_Full_Model_Gradient_Boost_Regressor.pkl Pickled version of the best-performing model for predicting all RateBeer scores, from beer chemical composition (Python version 3.9.16). SHAP analysis.ipynb Jupyter Notebook that performs SHAP analysis on the models. It also extracts the SHAP values in a CSV file to make a customized SHAP plot in R with the "Main Figure Generator.Rmd" script. Partial Dependence Plots with SHAP.ipynb Jupyter Notebook that generates Partial Dependence Plots of your model for compounds of your choice. SYSTEM REQUIREMENTS Any operating system capable of running Python v3.9.16 and R v4.2.2 Python v3.9.16 packages: anaconda 2023.07conda 23.5.0joblib 1.2.0numpy 1.24.3pandas 1.5.3scikit-learn 1.2.2seaborn 0.12.2shap 0.41.0xgboost 1.7.3 R v4.2.2 packages:factoextra 1.0.7forcats 1.0.0ggbeeswarm 0.7.1ggpmisc 0.5.2ggpubr 0.6.0ggsignif 0.6.4ggtext 0.1.2grid 4.2.2gridExtra 2.3Hmisc 4.8.0naniar 1.0.0psycho 0.6.1RColorBrewer 1.1.3shapes 1.2.7stats 4.2.2svglite 2.1.1tidyquant 1.0.6tidyverse 2.0.0 INSTALLATION GUIDE Download and install Python from Python or Anaconda.Download and install R from CRAN. Packages are installed with the built-in package installers. DEMO / INSTRUCTIONS FOR USE All available data is included in the file "Supplemental Files and Figure source files.xlsx".Open the worksheet of your choise and save this as a .CSV file. All scripts refer to the corresponding worksheet names whenever the data is required. The expected output is identical to the figures, tables and supplemental files presented in the manuscript.
| selected citations These citations are derived from selected sources. This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | 1 | |
| popularity This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network. | Average | |
| influence This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | Average | |
| impulse This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network. | Average |
