USEP价格预测
nextstep的Python项目详细描述
下一步
简介
NEX-TEP集成了所有主流机器学习算法的TSAN-TEP软件包。同时,它通过将关键的超参数提取到配置字典中来解除编程限制,使经验较少的python用户能够探索机器学习。在
Nextstep最初是为一个涉及价格预测的数据科学挑战而开发的。因此,它有一个专门的模块,可以通过开放API或web抓取来获取数据(石油和天气)。它演变成一个机器学习预测工具箱。在
安装
首次安装
pip install nextstep
升级至最新版本
^{pr2}$快速教程
getData模块
产生油价
fromnextstep.getData.oilimport*oil_prices.process()
布伦特_每日.csv和wti_每日.csv将在当前目录下生成。它们包含了直到最近一天的历史油价。在
生成天气数据
此函数依赖于来自worldweatheronline的API密钥。自2020年3月27日起,免费60天。它将在当前目录中生成csv数据文件。在
fromnextstep.getData.weatherimportweatherconfig={'frequency':1,'start_date':'01-Jan-2020','end_date':'31-Jan-2020','api_key':'your api key here','location_list':['singapore'],'location_label':False}weather(config).get_weather_data()
模型模块
每个ML模型都有一个独特的配置。请相应填写。在
随机森林
# examples, please fill in according to your project scopefromnextstep.model.random_forestimportrandom_forestconfig={'label_column':'USEP','train_size':0.9,'seed':66,'n_estimators':10,'bootstrap':True,'criterion':'mse','max_features':'sqrt'}random_forest_shell=random_forest(config)random_forest_shell.build_model(data)# build model
arima
fromnextstep.model.arimaimportarimaconfig={'lag':7,'differencing':0,'window_size':2,'label_column':'USEP','train_size':0.8,'seed':33}arima_shell=arima(config)arima_shell.autocorrelation(data)# plot autocorrelation to determine p, lag orderarima_shell.partial_autocorrelation(data)# plot partial autocorrelation to determine q, moving average widow sizearima_shell.build_model(data)# build model# residual plot to check model performancearima_shell.residual_plot()arima_shell.residual_density_plot()
贡献
欢迎拉取请求
作者
杨月松
朱伯林
杨紫月
- 项目
标签: