SummaryOpportunistic spectrum sharing ability enables higher spectrum utilization in cognitive radio networks. Detecting the presence of primary user in the network is the most important functionality in cognitive radio network as the cognitive users cannot use the spectrum with interference to primary users. Most solutions proposed for primary user detection suffer from hidden terminal problem resulting from multipath fading and shadow effects. The work focus on Rayleigh and Nakagami fading channel with comparable nonfading AWGN channel in cognitive radio. An ensemble model to detect the presence of primary user with high confidence is proposed in this work. The approach is based on training machine learning models with energy vectors in presence and absence of primary users. The trained model is then used to predict the primary user based on the energy vector.