Giter VIP home page Giter VIP logo

santabag's Introduction

santabag

This repository contains my C code for solving the Santa's Uncertain Bags competition at Kaggle.

It currently contains three tools and some common code.

Tools

  • checker - a tool that takes a submission file and runs a MC simulations of it.
  • simulate_bags - a tool that simulates all possible bag combinations of toy types.
  • santabag_glpk - a tool that solved the MIP problem and writes out a solution.

Dependencies

Build

There is a Makefile in the repository. It is really plain simple. If you have installed GLPK and GSL in default paths, I guess typing make should build the tools. I've only tried GCC but the code is pretty standard C99, so if you use the GCC on command line remember to set -std=c99 or -std=gnu99. I guess other compilers will work as well.

Threading

The simulating tools uses OpenMP to do naïve multithreading. You therefore need a compiler that supports OpenMP (Most modern C compilers does). If you do not want multithreading or do not want support for this, simply remove the -fopenmp compile flag and the -lgomp link library. (And ignore the pragma warning)

Bugs

Oh my! I just realized that the $+mu + \alpha \sigma$ logic may be wrong! Please use $\alpha=0.0$ while I check how I could make such a mistake.

TODO

Add lpsolve code. Code cleanup. Use better command line options for the tools. (getopt?)

Example usage

$ git clone https://github.com/oysteijo/santabag.git
$ cd santabag
$ make
$ ./simulate_bags 1000000
$ ./santabag_glpk simulations.csv

That should create a submission file submission.csv which can be submittet to the competition.

santabag's People

Contributors

oysteijo avatar

Watchers

 avatar  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.