Wireless communication is experiencing rapid growth, but it faces a significant challenge due to the limited availability of radio frequency spectrum. Cognitive Radio (CR) technology has emerged as a solution for mitigating spectrum scarcity. CR allows for more efficient spectrum utilization by enabling devices to dynamically access available frequency channels. One of the key mechanisms of CR technology is the utilization of Licensed User or Primary User (PU) channels when they are inactive. By intelligently sensing and detecting unused spectrum, CR devices can access these channels without causing interference to the primary users. Machine learning (ML) models have been successfully integrated into CR systems to improve their performance. These models are favored for their ability to accurately predict channel availability and occupancy patterns. Traditional ML approaches typically rely on labeled data and predefined decision boundaries. However, in the context of CR, the decision boundary can shift as devices transition between indoor and outdoor environments. To address this challenge, we have developed a novel model called Support Vector Machine with On-The-Go training (SVM-OTG). This model offers flexibility by allowing the CR system to train itself whenever there is a change in the environment's decision boundary. Additionally, our model undergoes On-The-Go training whenever its predictions do not match the actual output. This adaptive capability allows the CR system to continuously adapt to the changing environment, thereby improving the accuracy of its predictions. Our work has been specifically focused on enhancing spectrum usage within the widely utilized 2.4 GHz Wi-Fi band. Recent studies have indicated that conventional 2.4 GHz Wi-Fi protocols often experience performance bottlenecks. To address this, we applied our SVM-OTG model to a 2.4 GHz Wi-Fi dataset. Through extensive experimentation, we have demonstrated that our proposed model outperforms existing algorithms in this domain, achieving a prediction accuracy of 97.25% in both fixed and dynamic environments. Compared to state-of-the-art approaches such as LSTM, RLMLP, RNN, SHLNN, and DL-Mac, our model consistently delivers superior prediction accuracy. These results underscore the effectiveness of the SVM-OTG model in optimizing spectrum utilization and improving wireless communication in the 2.4 GHz Wi-Fi band.