A Feature Selection Method for Yarn Quality Prediction Based on SHAP Interpretation
Abstract
1. Introduction
2. Algorithm Description
2.1. Recursive Feature Elimination Algorithm
2.2. SVR-RFE
2.3. SHAP
2.4. RFE-SHAP Algorithm
| Algorithm 1: RFE-SHAP Feature Selection |
| Input: Full feature set F = {f1, f2, …, fn}, Training data X, SVR Model M |
| Output: Optimal feature subset Sopt |
| 1: Train M on X with all features F 2: Calculate SHAP values for all samples using Equations (4)–(6) 3: Compute global importance I(fi) as the mean absolute SHAP value for each feature 4: Rank F in descending order based on I(fi) 5: Initialize Sopt = ∅, Best_Score = ∞ 6: For k = 1 to n do 7: Select top k features to form subset Sk 8: Retrain M on Sk using cross-validation 9: Calculate evaluation metric (e.g., RMSE) 10: If RMSE < Best_Score then 11: Best_Score = RMSE 12: Sopt = Sk 13: Return Sopt |
3. Model Evaluation Indicators and Dataset
3.1. Model Evaluation Indicators
3.2. Dataset
4. Experiments and Results Analysis
4.1. Analysis Results of the SVR-RFE Algorithm
4.2. Analysis Results of the RFE-SHAP Algorithm
4.3. Model Construction and Result Comparison
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Liang, Q.; Zhang, L. Inversion of yarn production process parameters based on particle swarm genetic algorithm. Cotton Text. Technol. 2024, 52, 1–7. [Google Scholar] [CrossRef]
- Zhang, B.; Song, J.; Zhao, S. Prediction of yarn strength based on an expert weighted neural network optimized by particle swarm optimization. Text. Res. J. 2021, 91, 2911–2924. [Google Scholar] [CrossRef] [Scilit]
- Elkateb, S.N. Prediction of mechanical properties of woven fabrics by ANN. Fibres Text. East. Eur. 2022, 30, 54–59. [Google Scholar] [CrossRef] [Scilit]
- Balci, O.; Oğulata, S.N.; Şahin, C.; Oğulata, R.T. An artificial neural network approach to prediction of the colorimetric values of the stripped cotton fabrics. Fibers Polym. 2008, 9, 604–614. [Google Scholar] [CrossRef] [Scilit]
- Gharehaghaji, A.A.; Shanbeh, M.; Palhang, M. Analysis of two modeling methodologies for predicting the tensile properties of cotton-covered nylon core yarns. Text. Res. J. 2007, 77, 565–571. [Google Scholar] [CrossRef] [Scilit]
- Dai, N.; Li, L.; Xu, K.; Lu, Z.; Hu, X.; Yuan, Y. Development of a standardized data collection and intelligent fabric quality prediction system for the weaving department. J. Eng. Fibers Fabr. 2025, 20, 15589250241312778. [Google Scholar] [CrossRef] [Scilit]
- Liu, Z.; Chen, N.; Wang, J. A two-layer stacking regression model for predicting yarn quality of small samples. Text. Res. J. 2024, 94, 1096–1110. [Google Scholar] [CrossRef] [Scilit]
- Ghanmi, H.; Ghith, A.; Benameur, T. Ring spun yarn quality prediction using hybrid neural networks. J. Text. Inst. 2023, 114, 66–74. [Google Scholar] [CrossRef] [Scilit]
- Zhang, J.; Chen, M.; Guo, X.; Fu, Z.; Wang, J. Yarn quality prediction based on particle swarm optimization support vector machine. Cotton Text. Technol. 2024, 52, 16–22. Available online: https://link.cnki.net/urlid/61.1132.TS.20231207.1133.002 (accessed on 23 March 2026).
- Liu, Z.; Li, X.; Li, L.; Chen, N.; Wang, J. Applicability analysis of machine learning algorithms for small-sample yarn quality prediction. Cotton Text. Technol. 2024, 52, 27–34. [Google Scholar] [CrossRef]
- Zhang, B.; Xu, L.; Wang, Y. Yarn unevenness prediction using generalized regression neural network. J. Internet Technol. 2023, 24, 775–781. [Google Scholar] [CrossRef] [Scilit]
- Dai, N.; Jin, H.; Xu, K. Prediction of cotton yarn quality based on attention-GRU. Appl. Sci. 2023, 13, 10003. [Google Scholar] [CrossRef] [Scilit]
- Ma, Y. Displacement Prediction of Step-Type Landslides Using PSO-SVR Based on RFE Feature Selection; Chongqing Jiaotong University: Chongqing, China, 2023. [Google Scholar]
- Liang, W.; Tian, S.; Yang, X.; Xie, M. Research on the integrated development of port, industry, and city based on grey correlation analysis method—Taking Beibu Gulf Port as an example. China J. Commer. 2025, 34, 142–146. [Google Scholar] [CrossRef]
- Zhang, J.; Xu, Y.; Shao, J. Correlation analysis of factors affecting cotton-spinning quality. Cotton Text. Technol. 2023, 51, 22–27. [Google Scholar] [CrossRef]
- Lundberg, S.M.; Lee, S.I. A unified approach to interpreting model predictions. Adv. Neural Inf. Process. Syst. 2017, 30, 7874. [Google Scholar] [CrossRef] [Scilit]
- Yang, Y.; Li, R. Feature selection for high-dimensional data classification based on machine learning. J. Hunan Univ. Arts Sci. (Nat. Sci. Ed.) 2025, 37, 23–31. [Google Scholar]
- Du, Q.; Zhu, Y. Selecting multimodal group features to improve social media rumor detection performance. Comput. Appl. Softw. 2023, 40, 195–201. [Google Scholar] [CrossRef]
- Hu, X.; Li, D. Research progress on the Shapley value of multi-choice cooperative games. Syst. Eng.-Theory Pract. 2025, 45, 3925–3938. [Google Scholar] [CrossRef]










| Method Features | Standard RFE | SVR-RFE | RFE-SHAP (Ours) |
|---|---|---|---|
| Evaluator Dependency | Linear or tree-based models only | SVR only | Model-agnostic |
| Ranking Criterion | Model coefficients (w) | SVR weight vectors | SHAP marginal contributions |
| Synergistic Interactions | Not considered | Not considered | Explicitly quantified |
| Interpretability | Low (Black-box) | Medium (weights only) | High (local & global) |
| Selection Mechanism | Simple elimination | Weight-based recursion | Game-theoretic recursion |
| Yarn Strength | Hairiness H-Value |
|---|---|
| yarn number | yarn number |
| raw cotton strength/(cN/tex) | drafting multiple |
| raw cotton short fiber rate/% | combed AFIS short fiber rate2/(Neps/g) |
| spun yarn twist shrinkage/% | spun yarn twist shrinkage/% |
| combed AFIS short fiber rate2/(Neps/g) | combed noil rate/% |
| combed AFIS short fiber rate1/(Neps/g) | combed AFIS short fiber rate1/(Neps/g) |
| carded AFIS neps2/(Neps/g) | raw cotton short fiber rate/% |
| carded AFIS short fiber rate2/(Neps/g) | raw cotton micronaire value |
| carded AFIS short fiber rate1/(Neps/g) | carded AFIS short fiber rate2/(Neps/g) |
| drafting multiple | carded noil rate/% |
| combed AFIS cotton neps2/(Neps/g) | carded AFIS short fiber rate1/(Neps/g) |
| raw cotton micronaire value | combed AFIS cotton neps1/(Neps/g) |
| combed AFIS cotton neps1/(Neps/g) | combed AFIS cotton neps2/(Neps/g) |
| average length of the right half of raw cotton/mm | average length of the right half of raw cotton/mm |
| raw cotton impurity rate/% | raw cotton neps/(Neps/g) |
| carded AFIS neps1/(Neps/g) | |
| carded AFIS neps2/(Neps/g) | |
| raw cotton impurity rate/% |
| Yarn Strength | Hairiness H-Value |
|---|---|
| yarn number | yarn number |
| average length of the right half of raw cotton/mm | raw cotton micronaire value |
| raw cotton strength/(cN/tex) | spun yarn twist shrinkage/% |
| raw cotton short fiber rate/% | average length of the right half of raw cotton/mm |
| combed AFIS short fiber rate1/(Neps/g) | raw cotton maturity |
| carded AFIS short fiber rate2/(Neps/g) | raw cotton short fiber rate/% |
| raw cotton micronaire value | raw cotton length uniformity/% |
| carded AFIS short fiber rate1/(Neps/g) | combed AFIS short fiber rate2/(Neps/g) |
| combed AFIS short fiber rate2/(Neps/g) | carded noil rate/% |
| spun yarn twist shrinkage/% | roving twist shrinkage/% |
| combed noil rate/% | combed AFIS short fiber rate1/(Neps/g) |
| carded noil rate/% | carded AFIS short fiber rate2/(Neps/g) |
| drafting multiple | raw cotton strength/(cN/tex) |
| combed AFIS cotton neps1/(Neps/g) | carded AFIS short fiber rate1/(Neps/g) |
| raw cotton neps/(Neps/g) | drafting multiple |
| carded AFIS cotton neps2/(Neps/g) | raw cotton neps/(Neps/g) |
| combed AFIS cotton neps2/(Neps/g) | combed AFIS cotton neps2/(Neps/g) |
| carded AFIS cotton neps1/(Neps/g) | carded cotton line speed/(m/min) |
| carded cotton line speed/(m/min) | |
| raw cotton impurity rate/% |
| Samples | Yarn Strength | Hairiness H-Value | ||||
|---|---|---|---|---|---|---|
| Actual | SVR-RFE-BP | RFE-SHAP-BP | Actual | SVR-RFE-BP | RFE-SHAP-BP | |
| 1 | 207.5 | 208.201 | 210.845 | 2.62 | 2.493 | 2.540 |
| 2 | 209.6 | 213.380 | 209.446 | 2.27 | 2.398 | 2.368 |
| 3 | 142.9 | 149.496 | 141.593 | 2.54 | 2.451 | 2.531 |
| 4 | 251.1 | 247.255 | 247.851 | 2.41 | 2.415 | 2.397 |
| 5 | 249.7 | 256.090 | 251.012 | 2.45 | 2.370 | 2.407 |
| 6 | 211 | 224.207 | 212.815 | 2.6 | 2.487 | 2.486 |
| 7 | 176.5 | 193.570 | 178.932 | 2.04 | 2.261 | 2.189 |
| 8 | 257.4 | 249.500 | 248.865 | 2.48 | 2.443 | 2.446 |
| 9 | 203.4 | 204.767 | 210.234 | 2.4 | 2.408 | 2.376 |
| 10 | 178.7 | 185.625 | 175.713 | 2.335 | 2.397 | 2.367 |
| 11 | 205.6 | 223.720 | 211.737 | 2.39 | 2.389 | 2.378 |
| 12 | 138.9 | 141.248 | 139.976 | 2.33 | 2.397 | 2.382 |
| 13 | 242.4 | 250.935 | 247.379 | 2.12 | 2.280 | 2.184 |
| 14 | 216.7 | 212.790 | 210.651 | 2.38 | 2.414 | 2.376 |
| 15 | 191.9 | 200.495 | 191.450 | 2.66 | 2.350 | 2.460 |
| 16 | 245.1 | 237.598 | 248.540 | 2.545 | 2.475 | 2.520 |
| 17 | 134.8 | 144.415 | 142.196 | 2.42 | 2.491 | 2.380 |
| 18 | 174.8 | 190.261 | 179.938 | 2.54 | 2.464 | 2.491 |
| 19 | 253.2 | 238.551 | 247.993 | 2.57 | 2.507 | 2.540 |
| 20 | 208.4 | 210.221 | 213.102 | 2.61 | 2.496 | 2.528 |
| 21 | 125.8 | 130.367 | 130.516 | 2.55 | 2.425 | 2.430 |
| Model | Yarn Strength | Hairiness H-Value | ||||
|---|---|---|---|---|---|---|
| RMSE | MAE | MAPE (%) | RMSE | MAE | MAPE (%) | |
| LASSO-BP | 6.845 | 5.210 | 3.520 | 0.138 | 0.105 | 4.412 |
| MI-BP | 6.124 | 4.652 | 3.015 | 0.122 | 0.098 | 4.020 |
| SVR-RFE-BP | 5.820 | 4.319 | 2.830 | 0.114 | 0.091 | 3.785 |
| RFE-SHAP-BP | 3.668 | 3.049 | 2.100 | 0.094 | 0.068 | 2.778 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Wei, C.; Liu, T.; Zhang, B.; Wang, X. A Feature Selection Method for Yarn Quality Prediction Based on SHAP Interpretation. Algorithms 2026, 19, 266. https://doi.org/10.3390/a19040266
Wei C, Liu T, Zhang B, Wang X. A Feature Selection Method for Yarn Quality Prediction Based on SHAP Interpretation. Algorithms. 2026; 19(4):266. https://doi.org/10.3390/a19040266
Chicago/Turabian StyleWei, Chunxue, Tianxiang Liu, Baowei Zhang, and Xiao Wang. 2026. "A Feature Selection Method for Yarn Quality Prediction Based on SHAP Interpretation" Algorithms 19, no. 4: 266. https://doi.org/10.3390/a19040266
APA StyleWei, C., Liu, T., Zhang, B., & Wang, X. (2026). A Feature Selection Method for Yarn Quality Prediction Based on SHAP Interpretation. Algorithms, 19(4), 266. https://doi.org/10.3390/a19040266

