Nowadays, the development of efficient communication system is necessary for future networks. Compressive sensing was proposed as a technique to save storage and energy by compressing signals using simple linear transformations. Although compressed signals can be perfectly recovered, the complexity of the reconstruction operation is high. However, there are applications where compressive signals are processed directly in the compressed domain, with spectrum sensing being an example. Several works apply classical statistical detectors for extracting information from compressed signals, but an emerging concept, denoted as compressive learning, uses machine learning algorithms to extract information from compressed signals and it has promising applications in telecommunications. Compressive learning is being pointed-out as an important technique for future networks, where detecting patterns from a large amount of data is a key feature for new applications. In this paper, we investigate the compressive learning approach applied to spectrum sensing for cognitive radios. We assume that the information about the channel occupancy is collected by spatially distributed sensors and then concentrated in a gateway. The gateway compresses the signals and employs orthogonal frequency division multiplexing to transmit the data to the fusion center, responsible for the final decision about the channel status. We propose a detector based on neural networks to recover information about the occupancy of the channel from the compressed signal and compare it with the optimum maximum likelihood detector, assuming perfect and imperfect channel state information. Results demonstrate that both detectors achieve comparable performance, whereas our proposal has lower complexity.