__author__='徐长亮'
# pip install tushare
# pip install plotly
import os
import numpy as np
import pandas as pd
import tushare as ts
from datetime import datetime as dt
import matplotlib.pyplot as plt
import plotly.offline as of
import plotly.graph_objs as go
from sklearn.linear_model import LinearRegression
from sklearn import preprocessing
num = 5 # 预测5天后的情况
def get_stock_data(stock_num,start):
"""
下载数据
股票数据的特征
date:日期
open:开盘价
high:最高价
close:收盘价
low:最低价
volume:成交量
price_change:价格变动
p_change:涨跌幅
ma5:5日均价
ma10:10日均价
ma20:20日均价
v_ma5:5日均量
v_ma10:10日均量
v_ma20:20日均量
:param stock_num:
:return:df
"""
df = ts.get_hist_data(stock_num,start=start,ktype='D')
return df
def stoc
ml_linear_预测股票
最新推荐文章于 2024-04-24 12:04:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)