9th place solution in "Santa 2020 - The Candy Cane Contest"

Overview

Santa 2020 - The Candy Cane Contest

My solution in this Kaggle competition "Santa 2020 - The Candy Cane Contest", 9th place.

Basic Strategy

In this competition, the reward was decided by comparing the threshold and random generated number. It was easy to calculate the probability of getting reward if we knew the thresholds. But the agents can't see the threshold during the game, we had to estimate it.

Like other teams, I also downloaded the history by Kaggle API and created a dataset for supervised learning. We can see the true value of threshold at each round in the response of API. So, I used it as the target variable.

In the middle of the competition, I found out that quantile regression is much better than conventional L2 regression. I think it can adjust the balance between Explore and Exploit by the percentile parameter.

Features

        #         Name Explanation
#1 round number of round in the game (0-1999)
#2 last_opponent_chosen whether the opponent agent chose this machine in the last step or not
#3 second_last_opponent_chosen whether the opponent agent chose this machine in the second last step or not
#4 third_last_opponent_chosen whether the opponent agent chose this machine in the third last step or not
#5 opponent_repeat_twice whether the opponent agent continued to choose this machine in the last two rounds (#2 x #3)
#6 opponent_repeat_three_times whether the opponent agent continued to choose this machine in the last three rounds (#2 x #3 x #4)
#7 num_chosen how many times the opponent and my agent chose this machine
#8 num_chosen_mine how many times my agent chose this machine
#9 num_chosen_opponent how many time the opponent agent chose this machine (#7 - #8)
#10 num_get_reward how many time my agent got rewards from this machine
#11 num_non_reward how many time my agent didn't get rewarded from this machine
#12 rate_mine ratio of my choices against the total number of choices (#8 / #7)
#13 rate_opponent ratio of opponent choices against the total number of choices (#9 / #7)
#14 rate_get_reward ratio of my rewarded choices against the total number of choices (#10 / #7)
#15 empirical_win_rate posterior expectation of threshold value based on my choices and rewords
#16 quantile_10 10% point of posterior distribution of threshold based on my choices and rewords
#17 quantile_20 20% point of posterior distribution of threshold based on my choices and rewords
#18 quantile_30 30% point of posterior distribution of threshold based on my choices and rewords
#19 quantile_40 40% point of posterior distribution of threshold based on my choices and rewords
#20 quantile_50 50% point of posterior distribution of threshold based on my choices and rewords
#21 quantile_60 60% point of posterior distribution of threshold based on my choices and rewords
#22 quantile_70 70% point of posterior distribution of threshold based on my choices and rewords
#23 quantile_80 80% point of posterior distribution of threshold based on my choices and rewords
#24 quantile_90 90% point of posterior distribution of threshold based on my choices and rewords
#25 repeat_head how many times my agent chose this machine before the opponent agent chose this agent for the first time
#26 repeat_tail how many times my agent chose this machine after the opponent agent chose this agent last time
#27 repeat_get_reward_head how many times my agent got reward from this machine before my agent didn't get rewarded or the opponent agent chose this agent for the first time
#28 repeat_get_reward_tail how many times my agent got reward from this machine after my agent didn't get rewarded or the opponent agent chose this agent last time
#29 repeat_non_reward_head how many times my agent didn't get rewarded from this machine before my agent got reward or the opponent agent chose this agent for the first time
#30 repeat_non_reward_tail how many times my agent didn't get rewarded from this machine after my agent got reward or the opponent agent chose this agent last time
#31 opponent_repeat_head how many times the opponent agent chose this machine before my agent chose this machine for the first time
#32 opponent_repeat_tail how many times the opponent agent chose this machine after my agent chose this machine last time

Software

  • Python 3.7.8
  • numpy==1.18.5
  • pandas==1.0.5
  • matplotlib==3.2.2
  • lightgbm==3.1.1
  • catboost==0.24.4
  • xgboost==1.2.1
  • tqdm==4.47.0

Usage

  1. download data from Kaggle by /src/01_downlaod/download.py

  2. create a dataset by /src/02_[regressor]/preprocess.py

  3. train a model by /src/02_[regressor]/train.py

Top Agents

Regressor Loss NumRound LearningRate LB Score SubmissionID
LightBGM Quantile (0.65) 4000 0.05 1449.4 19318812
LightBGM Quantile (0.65) 4000 0.10 1442.1 19182047
LightBGM Quantile (0.65) 3000 0.03 1438.8 19042049
LightBGM Quantile (0.66) 3500 0.04 1433.9 19137024
CatBoost Quantile (0.65) 4000 0.05 1417.6 19153745
CatBoost Quantile (0.67) 3000 0.10 1344.5 19170829
LightGBM MSE 4000 0.03 1313.3 19093039
XGBoost Pairwised 1500 0.10 1173.5 19269952
Owner
toshi_k
toshi_k
Cluttered MNIST Dataset

Cluttered MNIST Dataset A setup script will download MNIST and produce mnist/*.t7 files: luajit download_mnist.lua Example usage: local mnist_clutter

DeepMind 50 Jul 12, 2022
Pytorch implementation of the paper "Class-Balanced Loss Based on Effective Number of Samples"

Class-balanced-loss-pytorch Pytorch implementation of the paper Class-Balanced Loss Based on Effective Number of Samples presented at CVPR'19. Yin Cui

Vandit Jain 697 Dec 29, 2022
Fast (simple) spectral synthesis and emission-line fitting of DESI spectra.

FastSpecFit Introduction This repository contains code and documentation to perform fast, simple spectral synthesis and emission-line fitting of DESI

5 Aug 02, 2022
This source code is implemented using keras library based on "Automatic ocular artifacts removal in EEG using deep learning"

CSP_Deep_EEG This source code is implemented using keras library based on "Automatic ocular artifacts removal in EEG using deep learning" {https://www

Seyed Mahdi Roostaiyan 2 Nov 08, 2022
A Text Attention Network for Spatial Deformation Robust Scene Text Image Super-resolution (CVPR2022)

A Text Attention Network for Spatial Deformation Robust Scene Text Image Super-resolution (CVPR2022) https://arxiv.org/abs/2203.09388 Jianqi Ma, Zheto

MA Jianqi, shiki 104 Jan 05, 2023
Semi-supervised Domain Adaptation via Minimax Entropy

Semi-supervised Domain Adaptation via Minimax Entropy (ICCV 2019) Install pip install -r requirements.txt The code is written for Pytorch 0.4.0, but s

Vision and Learning Group 243 Jan 09, 2023
Face uncertainty quantification or estimation using PyTorch.

Face-uncertainty-pytorch This is a demo code of face uncertainty quantification or estimation using PyTorch. The uncertainty of face recognition is af

Kaen 3 Sep 16, 2022
Official pytorch implementation of "Feature Stylization and Domain-aware Contrastive Loss for Domain Generalization" ACMMM 2021 (Oral)

Feature Stylization and Domain-aware Contrastive Loss for Domain Generalization This is an official implementation of "Feature Stylization and Domain-

22 Sep 22, 2022
Implementations of orthogonal and semi-orthogonal convolutions in the Fourier domain with applications to adversarial robustness

Orthogonalizing Convolutional Layers with the Cayley Transform This repository contains implementations and source code to reproduce experiments for t

CMU Locus Lab 36 Dec 30, 2022
This is a official repository of SimViT.

SimViT This is a official repository of SimViT. We will open our models and codes about object detection and semantic segmentation soon. Our code refe

ligang 57 Dec 15, 2022
AWS documentation corpus for zero-shot open-book question answering.

aws-documentation We present the AWS documentation corpus, an open-book QA dataset, which contains 25,175 documents along with 100 matched questions a

Sia Gholami 2 Jul 07, 2022
MlTr: Multi-label Classification with Transformer

MlTr: Multi-label Classification with Transformer This is official implement of "MlTr: Multi-label Classification with Transformer". Abstract The task

程星 38 Nov 08, 2022
Official Tensorflow implementation of U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation (ICLR 2020)

U-GAT-IT — Official TensorFlow Implementation (ICLR 2020) : Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization fo

Junho Kim 6.2k Jan 04, 2023
PyTorch package for the discrete VAE used for DALL·E.

Overview [Blog] [Paper] [Model Card] [Usage] This is the official PyTorch package for the discrete VAE used for DALL·E. Installation Before running th

OpenAI 9.5k Jan 05, 2023
InferPy: Deep Probabilistic Modeling with Tensorflow Made Easy

InferPy: Deep Probabilistic Modeling Made Easy InferPy is a high-level API for probabilistic modeling written in Python and capable of running on top

PGM-Lab 141 Oct 13, 2022
Official Pytorch implementation of paper "Reverse Engineering of Generative Models: Inferring Model Hyperparameters from Generated Images"

Reverse_Engineering_GMs Official Pytorch implementation of paper "Reverse Engineering of Generative Models: Inferring Model Hyperparameters from Gener

100 Dec 18, 2022
FaceAnon - Anonymize people in images and videos using yolov5-crowdhuman

Face Anonymizer Blur faces from image and video files in /input/ folder. Require

22 Nov 03, 2022
Unoffical implementation about Image Super-Resolution via Iterative Refinement by Pytorch

Image Super-Resolution via Iterative Refinement Paper | Project Brief This is a unoffical implementation about Image Super-Resolution via Iterative Re

LiangWei Jiang 2.5k Jan 02, 2023
KAPAO is an efficient multi-person human pose estimation model that detects keypoints and poses as objects and fuses the detections to predict human poses.

KAPAO (Keypoints and Poses as Objects) KAPAO is an efficient single-stage multi-person human pose estimation model that models keypoints and poses as

Will McNally 664 Dec 30, 2022
LRBoost is a scikit-learn compatible approach to performing linear residual based stacking/boosting.

LRBoost is a sckit-learn compatible package for linear residual boosting. LRBoost combines a linear estimator and a non-linear estimator to leverage t

Andrew Patton 5 Nov 23, 2022