Prediction of Coffee Ratings Based On Influential Attributes Using SelectKBest and Optimal Hyperparameters
Edmund F. Agyemang, Lawrence Agbota, Vincent Agbenyeavu, Peggy Akabuah, Bismark Bimpong & Christopher Attafuah · 2025
Read Prediction of Coffee Ratings Based On Influential Attributes Using SelectKBest and Optimal Hyperparameters by Edmund F. Agyemang, Lawrence Agbota, Vincent Agbenyeavu, Peggy Akabuah, Bismark Bimpong & Christopher Attafuah (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2509-18124.txt.
Introduction
Edmund Agyemang and 5 co-authors guess coffee scores from review text and numbers. Their 2025 study asks which traits in a review drive a coffee's rating. Clean text, word-weight scores, and a top-trait pick step prepare the data for the models.
Six model types were trained and tuned, from a plain tree to boosted forests. Group methods and a multi-layer net beat the plain tree and nearest-neighbour picks. Score checks used a blend of fair class and curve measures. The team says firm trait picks and tuning are the key to a sound guesser for taste goods.
Catalog record
| CREATOR | Edmund F. Agyemang, Lawrence Agbota, Vincent Agbenyeavu, Peggy Akabuah, Bismark Bimpong & Christopher Attafuah |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 34 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2509-18124
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Prediction of Coffee Ratings Based On Influential Attributes Using SelectKBest and Optimal Hyperparameters Edmund F. Agyemang, Lawrence Agbota, Vincent Agbenyeavu, Peggy Akabuah, Bismark Bimpong & Christopher Attafuah Abstract This study explores the application of supervised machine learning algorithms to predict coffee ratings based on a combination of influential textual and numerical attributes extracted from user reviews. Through careful data preprocessing including text cleaning, feature extraction using TF-IDF, and selection with SelectKBest, the study identifies key factors contributing to coffee quality assessments. Six models (Decision Tree, K-Nearest Neighbors, Multi-layer Perceptron, Random Forest, Extra Trees, and XGBoost) were trained and evaluated using optimized hyperparameters. Model performance was assessed primarily using F1-score, G-mean, and AUC metrics. Results demonstrate that ensemble methods (Extra Trees, Random Forest, and XGBoost), as well as Multi-layer Perceptron, consistently outperform simpler classifiers (Decision Trees and K-Nearest Neighbors) in terms of evaluation metrics such as F1 scores, G-mean and AUC. The findings highlight the essence of rigorous feature selection and hyperparameter tuning in building robust predictive systems for sensory product evaluation, offering a data driven approach to complement traditional coffee cupping by expertise of trained professionals. Keywords: Coffee Ratings; Variance Threshold; SelectKBest; F1-Score, G-Mean. 1 Introduction Coffee, often hailed as the world’s favorite beverage, holds a unique place in both global agriculture and daily life. Its origins trace back to the ancient coffee forests of Ethiopia, where history has it that a goat herder named Kaldi first discovered the energizing effects of the coffee bean pendergrast2010uncommon . Since then, coffee cultivation and consumption have spread across continents, shaping economies, cultures, and even social rituals. Today, coffee is one of the most valuable agricultural commodities worldwide, second only to crude oil in dollar value among globally traded goods pancsira2022international . The coffee industry provides livelihoods for an estimated 125 million people, many of whom are smallholder farmers in developing countries across Africa, Latin America, and Asia. Major coffee-producing nations include Brazil, Vietnam, Colombia, Ethiopia, and Honduras, with Brazil consistently leading global output ICO2025CoffeeMarket . The consumption of coffee has evolved alongside its production. Once a luxury for the elite, coffee has become an everyday staple, with more than two billion cups consumed each day across the globe jhaveri2021coffee . Its popularity is deeply intertwined with social and cultural practices, from the European cafe culture of the Enlightenment era to the modern specialty coffee movement that emphasizes origin, quality, and sustainability. Given coffee’s immense economic, social, and cultural significance, understanding the attributes that influence its ratings remains an important focus for researchers, producers, and consumers alike. Traditionally, assessing the quality of products like coffee, wine, or tea has relied heavily on the expertise of trained professionals or professional human expertise, known as “cuppers.” These experts evaluate coffee samples through a standardized process called cupping, which involves smelling, tasting, and scoring brewed coffee to judge its aroma, flavor, acidity, body, and aftertaste sca2018cupping . The cupping procedure follows strict protocols to minimize bias, including the use of specific ratios, temperatures, and blind tasting techniques. Despite its widespread use and importance in the industry, the traditional approach has some limitations. Human assessment is inherently subjective, inconsistent and can be influenced by personal preferences, fatigue, or even environmental factors. Additionally, traditional methods can be time consuming and require significant training to ensure consistency and reliability. Nevertheless, sensory evaluation by skilled cuppers remains the gold standard for determining coffee quality and guiding both producers and buyers. Machine learning algorithms, on the other hand, are able to process large amounts of data ranging from chemical composition and physical attributes to sensory scores and identify patterns that may not be immediately obvious to human evaluators. In recent years, machine learning has become a transformative tool for quality prediction within the food and beverage industry. In the coffee sector, researchers have used machine learning techniques to classify coffee beans by sustainability labeling, organic, fair trade, country of origin, type of coffee (espresso, filter, instant, single cup, with milk, iced) and intrinsic attributes (roast degree, specialty coffee), and extrinsic attributes (brands and packaging) samoggia2018coffee . The prediction of coffee ratings based on influential attributes and optimal hyperparameters through supervised machine learning algorithms represents a significant advancement in the coffee industry. By employing various machine learning techniques, researchers aim to automate the assessment of coffee quality, providing a reliable framework for predicting ratings based on key attributes like aroma, flavor, acidity, body, balance, and aftertaste. This integration of data science enhances the understanding of coffee characteristics, which is crucial for both consumers and producers in guiding purchasing decisions and improving product standards. barahona2020sensory research in this domain has highlighted the complexities involved in evaluating coffee quality, encompassing challenges such as the variability in study designs, inconsistent definitions of coffee quality, and the need for comprehensive datasets. These challenges can hinder the development of robust predictive models and may lead to overfitting or bias in algorithm performance, necessitating a careful approach to data collection and preprocessing liu2023establishing . Furthermore, machine learning offers promising solutions to address these issues, as evidenced by successful applications that have achieved high classification accuracies, demonstrating the potential of technology to reshape traditional methods of quality assessment. Despite its advancements, the field is not without controversies, as debates persist regarding the definition and measurement of coffee quality, as well as the accessibility of machine learning tools to stakeholders beyond experts liu2023establishing . In this study, we apply supervised machine learning techniques to build predictive models. The data consists of user’s rating of coffee and other relevant attributes. six (6) distinct algorithms namely Decision Trees (DT), K-Nearest Neighbors (KNN), Multi-layer Perceptrons (MLP), Random Forest (RF), Extra Trees (Extremely Randomized Trees) and Extreme Gradient Boosting (XGBoost) are utilized to generate the outputs (predicted ratings) from the attributes that are used as inputs to the models. The model performance is evaluated against the actual ratings and the F1-score, G-mean and AUC are the main metric used as assessment. The remainder of the paper is organized as follows: section 2 discusses the data preprocessing via text data including feature extraction and selection. In section 3 , the machine learning algorithms adopted for the study and implementation are elaborated on. Section 4 delves into the results, findings and discussions of the study encompassing any insightful findings of the relationships between coffee attributes and ratings and key challenges encountered during execution of the project. Lastly, section 5 concludes the study and provide recommendations for further work. 2 Data Preprocessing The data preprocessing step is pivotal for converting unrefined data into a state that can be effectively employed by machine learning algorithms. For this project, the dataset consists of both numerical and textual features. We focus on cleaning and transforming these features into usable formats, especially for the textual review data. 2.1 Text Data Preprocessing The textual reviews, which are unstructured, require thorough preprocessing to extract meaningful features. The following steps were applied and the resulting cleaned data is a set of processed text reviews that are ready to be transformed into numerical features: \star Cleaning Text : First, we removed non-alphabetical characters using regular expressions, keeping only words made up of letters. \star Lowercasing : All text was converted to lowercase to maintain uniformity