摘要
股票预测可以辅助投资者进行正确的金融投资,本文使用Python语言开发网页爬虫爬取真实的股票数据,首先通过requests库获取网页数据,使用Beautiful Soup库解析静态html页面,并通过查找标签获取股票数据,然后对数据进行解析,用xlwt库将数据存入excel文件,并对数据归一化处理,最后,在三层BP神经网络中根据批量梯度下降法调整隐含层结点个数,以获取相对更优的连接权值和阈值,从而对股票的涨跌做出预测,为投资者的投资行为提供参考。
Stock predictions can help investors to make the right financial investment. This article uses Python language to develop web crawlers to crawl real stock data. The web page data is obtained from the requests library first, the static html page is analyzed using the Beautiful Soup library, and the stock data is obtained through searching the tags. Then the data is analyzed, the data is stored in excel file by xlwt library, and the data is normalized. Finally, the number of hidden layer nodes is adjusted according to the batch gradient descent method in the three-layer BP neural network to obtain relatively better connection weights and thresholds, so as to predict the ups and downs of stocks and provide reference for investors' investment behavior.
作者
曾武序
钱文彬
王映龙
杨文姬
柳军
Zeng Wuxu;Qian Wenbin;Wang Yinglong;Yang Wenji;Liu Jun(School of Software,Jiangxi Agricultural University,Nanchang,Jiangxi 330045,China;School of computer and information engineering,Jiangxi Agricultural University)
出处
《计算机时代》
2018年第6期72-75,80,共5页
Computer Era
基金
国家自然科学基金(No.61502213
No.61462038
No.71461013)