GithubHelp home page GithubHelp logo

ccf_product's Introduction

CCF-农产品价格预测

赛题参见 - 赛题详情

赛题说明

  • 使用2016年6月以前的农产品价格数据预测7月的农产品价格

成绩

  • 复赛第2,我们就是xjboost队。。。

代码说明

  • gen.py
    • 生成特征
  • model.py
    • 各个单模型
  • model_stacking.py
    • stacking

代码就将就看吧。。 具体的数据集太大就没传上来

模型算法

  • 训练集

    • 选择了2016年6月1日往后30天+2016年5月25日往后一个月的全部数据作为训练集
  • 测试集

    • 线上测试集为2016年7月
  • 特征

    • 窗口统计特征(前1,2,3,4,7,14,21,30,60天)
      • 6月1日(5月25日)的前x天农产品价格的平均值
      • 6月1日(5月25日)的前x天农产品价格的最小值
      • 6月1日(5月25日)的前x天农产品价格的标准差
      • 考虑有部分数据缺失,对每个农产品,我们将数据先按照时间排序,然后加上了
        • 6月1日(5月25日)的前x个非缺失的价格的平均值
        • 6月1日(5月25日)的前x个非缺失的价格的最小值
        • 6月1日(5月25日)的前x个非缺失的价格的标准差
        • 6月1日(5月25日)的前x天有几天价格有缺失(缺失率)
    • 日期特征 (没怎么用)
      • 一个月的第x天
      • 一周的第x天
      • 一年的第x天
    • 农产品的特征
      • 6月1日(5月25日)距离该农产品第一次有价格记录过去了x天
      • 6月1日(5月25日)距离该农产品最后一次有价格记录过去了x天
      • 所有数据中该农产品最后一次出现的价格
  • 算法说明

    • 一些简单的规则

      • 如提交最后一次的价格线上评分就能达到 0.06088
    • 直接使用模型的训练效果仅为0.12左右还不如简单的规则

    • 考虑到评价标准是MPSE,我们首先对label进行 log transformation 即$y\prime = log(x+1)$,预测后再使用$y^{predict} = exp(y\prime) - 1$变换回来

      • 但是效果提升不大
    • 考虑大部分回归模型的目标函数都是MSE的,label较大的对于误差的影响显然更大一些;而本题的评价函数是MPSE,label较小的更容易带来误差

      • 于是我们对训练样本设置了权重,$weight_i = \frac{1.0}{y^_iy^*_i}$,线上效果明显提升(0.05)
    • 模型融合

      • 我们将LinearRegression、Xgboost、RandomForest的结果进行加权融合
        • 有一定的提升(0.047)
    • 简单的规则

      • 有部分农产品的价格非常稳定(波动非常小),我们就直接选取其最后一次非缺失的平均价格作为7月每一天的价格作为预测结果
        • 同样也有一些提升(0.045)

ccf_product's People

Contributors

xing89qs avatar

Watchers

 avatar

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.