Coder Social home page Coder Social logo

ai-challenger2018-weather-forecast's Introduction

AI-Challenger 2018 天气预报赛道

队伍名称:LoganLin

代码说明

环境配置

  1. 编程语言: Python3.6
  2. 机器学习框架:XGBoost
  3. 调用的库:
  • numpy 1.15.1
  • pandas 0.23.4
  • netCDF4 1.4.1

代码文件结构说明

Python文件

  • load_data.py

读取原始数据,并转换为pd.DataFrame

  • generate_set.py

生成能送入XGBoost的训练数据与预测数据。

  • train_xgb.py

训练XGBoost模型,并存入模型文件

  • xgb_predict.py

使用训练完成的XGBoost模型进行预测,并生成提交文件。

Jupyter Notebook

  • gen_train_data.ipynb

生成指定时间段的训练数据。

  • eval_xgboost.ipynb

网格化搜索XGBoost最佳参数。

  • train_xgboost.ipynb

训练XGBoost模型。

  • xgb_predict.ipynb

使用XGBoost模型进行预测。

训练代码的使用说明

训练模型前,首先需要生成训练数据。可使用generate_set.combine_periods函数。

函数的使用可参考gen_train_data.ipynb中的写法。

生成完毕后使用pickle.dump()函数将数据保存为文件。

训练新的数据集时,我会先用网格搜索计算模型的最佳参数。可使用train_xgb.gen_best_parameters函数。

参考eval_xgboost.ipynb中的写法。

读取计算得到的参数,使用train_xgb.train_all_xgb函数,即可训练一组模型。

参考train_xgboost.ipynb中的写法。

测试代码的使用说明

使用generate_set.generate_x_oneday函数可生成提交一次预测需要的输入特征数据。

随后调用xgb_predict.xgb_predict_all函数读取模型文件,生成预测结果。

最后调用xgb_predict.construct_submission函数可对预测结果进行规范化,并生成提交结果所需的文件。

参考xgb_predict.ipynb中的写法。

ai-challenger2018-weather-forecast's People

Stargazers

 avatar

Watchers

James Cloos avatar Yan Lin avatar

Forkers

shnmng

ai-challenger2018-weather-forecast's Issues

你好,数据集下载问题

您好,感谢您无私的分享代码,看了您的代码,受益匪浅,但是目前AI2018的官网数据集的无法下载,您是否方便提供一下数据集的下载地址呢,万分感谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.