The convulsive advancement of multiple-input multiple-output devices and ultra-dense networks has been extensively considered as the key facilitators that ease the evolution and formation of 5G systems. The explosive growth of wireless devices necessitates the deployment of the Internet of Things (IoT), which is the potential of interconnecting diversified things using wireless communications. To enable wireless accesses of IoT devices, Artificial Intelligence (AI) plays a significant role in 5G network. While existing end-to-end learning and adaptive model require continuous monitoring and dynamic changes cannot achieve global optimization due to wireless signal classifiers and a higher amount of interference. In this work, an integrated spectrum selection and spectrum access using a greedy and AI-based framework to allow the forthcoming and subsequent demands on 5G and beyond is presented. Fractional Knapsack Greedy-based strategy is introduced, and Langrange Hyperplane-based approach is utilized to realize the AI-based strategies for spectrum selection and spectrum allocation for IoT-enabled sensor networks. This framework is called as Fractional Knapsack and Langrange Hyperplane Spectrum Access (FK-LHSA). First Fractional Knapsack Multi-band spectrum selection (FKMSS) model is designed along with an energy consumption model to optimize channel or spectrum throughput. Next, a Lagrange Hyperplane (LH) spectrum access model is designed to minimize spectrum access delay and improve spectrum access accuracy. The simulation results show that the proposed FKM model and LH model can effectively reduce the spectrum access delay along with the improvement of throughput and spectrum access accuracy.