Linear Regression with Regularized Hyperparameter Optimization
Abstract
Traditional linear regression struggles with noisy data due to its lack of regularization, which fails to mitigate overfitting effectively. This results in excellent fitting on training data but poor generalization on test sets. Additionally, its reliance on a single analytical solution via the normal equation limits adaptability to complex, dynamic data relationships, particularly under significant noise interference. To address these shortcomings, this paper introduces a linear regression method with regularized hyperparameter optimization (Reg-LR). Standard linear regression uses the normal equation to efficiently capture basic linear patterns, while Reg-LR incorporates hyperparameters to dynamically regulate model complexity, balancing fitting accuracy and generalization. By optimizing the loss function, this approach enhances performance from basic fitting to robust prediction. Experiments feature two key modules: a data generation module using NumPy to produce simulated datasets with Gaussian noise, simulating realistic conditions, and a regularization optimization module employing gradient descent to tune parameters across various hyperparameter values. Results indicate that standard linear regression achieves a test set mean squared error (MSE) of 3.90, while Reg-LR optimizes it to 6.56 through tuning. Though improvements are modest on small datasets, Reg-LR demonstrates robustness in noisy environments. Ablation studies highlight the regularization term’s role in preventing overfitting and the impact of hyperparameter choices on model stability. This method provides a scalable tuning framework for linear regression and a foundation for complex predictive tasks, offering theoretical and practical significance.
References
- Su X, Yan X, Tsai C L. Linear regression[J]. Wiley Interdisciplinary Reviews: Computational Statistics, 2012, 4(3): 275-294.
- Hoel P G. On methods of solving normal equations[J]. The Annals of Mathematical Statistics, 1941, 12(3): 354-359.
- Lanczos C. Evaluation of noisy data[J]. Journal of the Society for Industrial and Applied Mathematics, Series B: Numerical Analysis, 1964, 1(1): 76-85.
- Köksoy O. Multiresponse robust design: Mean square error (MSE) criterion[J]. Applied Mathematics and Computation, 2006, 175(2): 1716-1729.
- Ying X. An overview of overfitting and its solutions[C]//Journal of physics: Conference series. IOP Publishing, 2019, 1168: 022022.
- Ramsay J, Hooker G. Dynamic data analysis[J]. Springer New York, New York, NY. doi, 2017, 10: 978-1.
- McDonald G C. Ridge regression[J]. Wiley Interdisciplinary Reviews: Computational Statistics, 2009, 1(1): 93-100.
- Ruder S. An overview of gradient descent optimization algorithms[J]. arXiv preprint arXiv:1609.04747, 2016.
- Goeman J, Meijer R, Chaturvedi N. L1 and L2 penalized regression models[J]. cran. r-project. or, 2012.
- Solli-Sæther H, Gottschalk P. The modeling process for stage models[J]. Journal of Organizational Computing and Electronic Commerce, 2010, 20(3): 279-293.
- Denenberg J N. Anti-noise[J]. IEEE potentials, 1992, 11(2): 36-40.
- Seeger M W. Cross-Validation Optimization for Large Scale Structured Classification Kernel Methods[J]. Journal of Machine Learning Research, 2008, 9(6).
- Adami C. What is complexity?[J]. BioEssays, 2002, 24(12): 1085-1094.
- Zeiler M D. Adadelta: an adaptive learning rate method[J]. arXiv preprint arXiv:1212.5701, 2012.
- Schmidt M, Fung G, Rosales R. Fast optimization methods for l1 regularization: A comparative study and two new approaches[C]//Machine Learning: ECML 2007: 18th European Conference on Machine Learning, Warsaw, Poland, September 17-21, 2007. Proceedings 18. Springer Berlin Heidelberg, 2007: 286-297.