# Cat & Dog solution Hi everyone, You will find our code and documentation for our solution on [this repo](https://github.com/alexandrebarachant/Grasp-and-lift-EEG-challenge) The key of this challenge was ensembling. We ended up with a 3-levels pipeline : Level1 models are trained independently on each subjects, with features based on low-pass filtered signal and/or covariance matrices estimated in different frequency band. we have around 50 lvl1 models, with different combination of features and classifiers. Our best lvl1 model score around 0.95 LB and is an adaptation of Tim's CNN script. We had a couple of other models scoring around 0.94, and most of the other are in the 0.90-0.91 range. Level2 models are trained globally (all subject put together) on predictions from lvl1 models. They are mainly based on XGB and Recurrent Neural Networks. We have around 30 of these models, and the highest scoring model is a RNN with 8s of history on the prediction and bagged with subset of lvl1 model. it score around 0.98. Level3 models are just different weighted mean of lvl2 model where the weights are optimized to maximize AUC. With such a high level of ensembling, a main concern was overfitting. Our two final pick were 2 submissions we called "YOLO" and "Safe1". The YOLO submission was our submission with the highest CV and scored 0.98128 / 0.98109. The Safe1 submission was optimized to reduce variance on the CV and was composed of a subset of lvl2 models hand-picked for their stability. This submission scored 0.98108 / 0.98095 The code is quite computationaly expensive, and it will take you up to one week to generate the final results. Our solution is well applicable in real world and works in real time, provided that the patient with prosthesis is constantly connected to 15 Amazon high-end instances via Google Fiber. All jokes apart, the final solution is a bit overkill. Judging by a visual inspection of lvl2 predictions, all of the events should be correctly detected, and the lvl3 ensembling only help to increase the sharpness of the predictions (reduce error on the edges of the 300ms frames) We did not focus too much on producing very high scoring lvl1 models. Instead, we tried to produce a maximum of diversity in the lvl1 predictions. We stopped working on lvl1 models a couple of weeks before the deadline to focus entirely on lvl2 models and later on lvl3 models. RNNs turns out to be very effective on lvl2 ensembling, they were able to catch sequential structure of the events. However, they were not very successful on lvl1 features. Finally, we also tried semi-supervised adaptation without any success. Seems that the signals were stable enough across series to not have to rely on such procedure. Best, Cat & Dog