Giter Club home page Giter Club logo

walmart_competition_code's Introduction

#Kaggle-Walmart Sales Forecasting
This repository hosts R code for the winning entry in Kaggle's Walmart sales forecasting competition.

##Description
There is a Kaggle forum post explaining the winning entry. Briefly, it is an unweighted average of 6 component models, all of them weekly time-series models, followed by a transformation around Christmas to reflect that the day of the week that Christmas lands on shifts from year to year. That shift is explained here.
For each model, the function grouped.forecast() is called with a parameter specifying the model type. That function iterates over the possible departments and for each one, it builds a data matrix of size (number of weeks x number of stores). That is, predictions are made per-department, across stores. This is because the pattern of seasonal variation is mainly within-department.

##Requirements

  • R
  • R packages forecast, plyr, and reshape - use install.packages('forecast'), etc. from within R
  • Walmart data - You will need train.csv, test.csv, and sampleSubmission.csv. You may have to accept a set of competition rules to get the data.

##Setup The code assumes a directory structure under the project level of:

  • data/ - with the data from Kaggle
  • R/ - with the code from here
  • submissions/ - the code will write submissions here

##Usage: To regenerate the best performing single model, use the script runOne.R. If you are in the competition (or have accepted the rules), you should be able to submit that for 2366 on the final leaderboard by going to: submit and uploading the .csv file. It should run in ~ 5 minutes.

You can regenerate the winning entry with the script runAll.R. Without the fourier.arima model, the code runs in 30-40 minutes and gets about 2320 on the final leader board. With that model included, it generates the winning score of around 2300, but takes an extra 2 hours or so.

walmart_competition_code's People

Contributors

davidthaler avatar

Watchers

James Cloos avatar hhh 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.