Classification consists of categorizing image pixels, specifically, in a spectral image (SI) it is used to determine environmental pollution agents, to stable land use, and to monitor crops. Due to the high dimensionality of the SI, classification is inefficient. However, compressive sampling (CS) has been established as a sampling protocol of SI allowing the reduction of data. Recently, CS classification is a promising research area, but it has only been tested on some specific systems. This paper proposes a general classification algorithm in