“…Near-infrared spectroscopy technology has the following characteristics: a fast speed, convenient detection, low cost, no pollution in the detection process, wide detection range, high detection efficiency, non-destructive, able to simultaneously determine multiple groups, etc. With the rapid development of computer application technology, chemometrics methods, statistical theory, and the high integration of multi-disciplinary technologies have been put forward, and their feasibility for NIR detection has been verified [ 20 , 21 , 22 , 23 , 24 ]. At the same time, random forest (RF) is a common machine learning method that is usually used to deal with classification [ 25 , 26 , 27 ] and regression [ 28 , 29 , 30 ] problems.…”