| The stock market is an indispensable part of a country’s economic development,and predicting stock trends is of great significance to regulatory agencies,investment institutions,and individual investors,making it a focal point of society’s attention.However,stock prices are influenced by various factors such as politics,economic cycles,and market environments,exhibiting non-stationary volatility,which makes stock prediction difficult.In addition,traditional prediction methods are no longer applicable due to the large volume of stock market data.In this context,this article uses a K-nearest neighbor improved support vector machine method for stock trend prediction,improving prediction accuracy,and based on this,constructs an investment portfolio model to increase returns.Stock price prediction is a binary classification problem,and support vector machines(SVM)are commonly used prediction methods.However,SVM are prone to misclassify samples near the classification hyperplane.To address this issue,this article proposes a method based on K-nearest neighbor(KNN)improved SVM.First,the method uses SVM to obtain the support vectors corresponding to each unclassified sample and the normal and displacement vectors of the classification function,which can be used to calculate the distance from the sample to the classification hyperplane.Second,when the distance between the unclassified sample and the classification hyperplane is greater than a given threshold,SVM,are used for classification,otherwise KNN classification is used.Additionally,this article uses grid search to optimize the hyper-parameters of SVM.According to the prediction results of the trading day quotes of the HS 300 stock index,the proposed method effectively improves the prediction accuracy of SVM.Finally,we selected 18 stocks from the constituents of HS300 Index,predicted the rise and fall of each stock based on monthly data,and used the Markowitz portfolio model to find a suitable investment portfolio for short-term investment.According to the Sharpe optimal principle,the cumulative return rate of the Sharpe optimal investment portfolio was 12.11%,and the investment weights of each stock were obtained.Through this research,we hope that the proposed combination prediction model can provide some reference for stock prediction research and investors.Furthermore,the above method was applied to predict the future one-month trends of 18 selected stocks from the constituent stocks of the HS300 stock index.Based on the prediction results,three investment portfolios were constructed by selecting predicted bullish stocks,and four investment methods were back-tested using the Markowitz portfolio model.The best performing investment portfolios had cumulative returns of 12.11% for the Sharpe optimal portfolio,6.77% for the minimum risk portfolio,8.67% for the equally weighted portfolio,and 10.77% for the market-value weighted portfolio,all of which exceeded the returns of the HS300 stock index(5.70%)during the same period.Notably,the cumulative returns of the Sharpe optimal portfolio(12.11%)based on the Sharpe optimal principle were significantly higher than those of the HS300 stock index during the same period.Through this study,it is hoped that the proposed portfolio prediction model can provide some reference for stock prediction research and investors. |