Investigation of Security and Spectrum Management Issues in Cognitive Radio Aided by Machine Learning