Stock price prediction is a complex and important challenge for stock market participants. The difficulty of predicting stock prices is a major problem that requires an approach method in obtaining stock price predictions. This research proposes using machine learning with the Support Vector Regression (SVR) model and linear regression for stock price prediction—the dataset used in the daily Apple Inc historical data from 2018 to 2023. The hyperparameter tuning technique uses the Grid Search method with a value of k = 5, which will be tested on the SVR and Linear Regression methods to get the best prediction model based on the number of cost, epsilon, kernel, and intercept fit parameters. The test results show that the linear regression model with all hyperparameters k = 5 with the average taken performs best with a True intercept fit value. The resulting model can get an excellent error value, namely the RMSE value of 0.931231 and MSE of 0.879372. This finding confirms that the linear regression model in this configuration is a good choice for predicting stock prices.
Read full abstract