© 2022, Springer Science+Business Media, LLC, part of Springer Nature.The efficiency of chocolate sample classification by type and manufacturer is demonstrated using a spectralprint method and THz transmission spectra. Their baselines are determined using the adaptive iteratively reweighted penalized least squares (airPLS) method to suppress noise and the Fabry–Perot effect. The classification was carried out by constructing a low-dimensional space of the principal components of the baselines and applying cluster analysis methods in this space. The precision and recall values of the classification of chocolate samples by the k-means, classification and regression tree, and hierarchical cluster analysis methods are 0.85 and 0.83, 0.91 and 0.90, and 0.94 and 0.93, respectively. The support vector machine is successfully applied to two cases where pairwise classification is most problematic.