Overfitting, a common issue in polynomial regression, occurs when the model fits noise rather than underlying patterns in the data. To mitigate overfitting and improve generalization, we propose a dynamic approach to select the regularization parameter lambda using k-fold cross-validation. This method ensures that the regularization strength adapts to the characteristics of the data, preventing overfitting while allowing the model to capture underlying patterns effectively. We demonstrate the effectiveness of our approach through experiments on linear and nonlinear datasets, showing improved generalization performance compared to fixed regularization parameter settings.