Search This Blog

Wednesday, August 5, 2015

10 Years with 9 Digits




Left one is a picture of me (2nd from right) winning my first sudoku competition (U-16 category) at the age of 14yrs in August, 2005, and the right one is a picture of me (2nd from left) winning the Times National Sudoku Championship in August, 2015.

Its been a decade.

I'm now a three-time National Sudoku Champion (2010, 2011, 2012), having won the Times Sudoku Championship twice (2012, 2015). I've been representing India at the World Sudoku Championship since 2009, and my ranks have been 25th, 15th, 12th, 8th, 16th, 14th.
I'll be representing India for the 7th straight year at the WSC 2015 in Bulgaria in mid-October.

In 2012, I became the first and only Indian to break into the top-10 in the World (8th rank).

So much has happened in the decade. Started off as a casual past-time... which turned into a damn serious hobby but gave me an opportunity to excel at something. I'm glad all the time and effort that I put into this has resulted in success and happiness. Making my country proud and starting many new friendships with my foreign sudoku friends is an experience that will remain in my heart all my life.

Logic Masters India, the national organization that conducts the national events in India has had immense trust and faith in me, and I've tried to do my best and help them out in whichever way possible. Its very creditable that Deb Mohanty and Amit Sowani have been able to run LMI for all these years, and supported the team in various ways.
Its been so much fun competing with some of the most talented people in the country... Sumit Bothra, Ritesh Gupta, Gaurav Korde during the early years, and Rishi Puri, Prasanna Seshadri in recent years.
Kudos to you guys and all the folks who are part of LMI and the puzzling community in India!

I hope I can pursue this for at least few more years, I feel old, but I'm not done yet :-)
My aim is to encourage new talent and potential top solvers to achieve even greater success in the years to come.

I thank Mom, Dad, Sis and family for their continuous support and help. I am extremely fortunate to have been exposed to a wide varieties of activities of my interest and been given the freedom to pursue some of them as successful hobbies :-)
I also thank one more person, she's been there for me, inspiring and motivating me, witnessing and experiencing all these memories and being an integral part of this incredible journey, as a partner, mentor, friend and much more. I dedicate the TSC 2015 win to her, which coincidently was held on Friendships Day! :-)

Sudoku is my passion and if there is one message I want to put out to the world, it is Pursue Your Passion (PYP). Don't let anything stop you from doing what you enjoy the most.

I hope some day someone can better my 8th rank at WSC, and hoist the Indian flag on the podium.

Friday, July 31, 2015

Exacerbation Prediction of COPD


The Exacerbation Prediction of COPD patients competition was held on CrowdAnalytix in May-Jul, 2015.
Seems like this was a sequel to the first Exacerbation Prediction competition in which I stood 2nd.

Objective
Smoking related diseases like chronic pulmonary obstructive disease (COPD) are a severe global medical problem which have affected over 50 million people worldwide. As their condition worsens, a fraction of patients experience “exacerbations”. Exacerbation is defined by sudden worsening of symptoms such as shortness of breath and increased airway inflammation often requiring immediate medical treatment and emergency room visits.

The objective was to build a predictive model using medical data which predicts beforehand which patients will experience 'exacerbation' so that they can be provided appropriate medical treatment to prevent/control it.

Data
The train data consisted of 1935 patients and 62 variables related to medical and smoking history, demographics, lung functions, etc. along with the true labels of whether they experienced Exacerbation or not.
The test data consisted of 1324 patients for which we had to predict the probability of Exacerbation.

Approach
Being one of the toppers of the previous Exacerbation Prediction competition, I followed a similar approach. My approach was to build 3-4 models and ensemble.

Unfortunately, it was very hard since the CV and LB scores did not go hand-in-hand. I finally tried various subsets and combinations of XGBoost, RandomForest, Logistic Regression and k-NearestNeighbours.

Model
My best model on the public LB was a simple average of XGBoost and Logistic Regression. Which is the exact same ensemble I used in the previous Exacerbation contest.
My best model on the private LB was Logistic Regression on the PCA-transformed variables (using the top-7 components).

Results
My public LB gave an AUC score of 0.767 (XGB + LR) putting me in 11th place, whereas, my private LB gave an AUC of 0.769 (LR) putting me in 4th place.

So, I stood 4th and won some more prize money! (Who wants a party?)
This also means I've been in the Top-5 in 3 of the 4 CrowdAnalytix competitions I've participated in.

Views
I think the evaluation system is absolutely useless. The winners were decided solely based on the best private LB score. Kaggle does the same, but forces players to choose two submissions for evaluation. Here, ALL private submissions were evaluated and the best one was chosen.

I see a lot of cons here:

1. Players can try out all sorts of models and submit, and the more submissions a player makes, the likelier is one of them to be among the top.
2. Players don't know which model will be the final best model. So, if they made 100 submissions, are they supposed to track all 100 of them and submit the one that CA chooses as best? Are you kidding me? I had a tough time identifying which model of mine finally gave the best private LB score.
3. What sense does it make when one model fits best to public LB and another fits best to private LB?
4. Winners are more based on luck. Models are likely to be the luckiest fit to the private test set. I'm not sure how useful this would be to the client.

Kaggle has a much better, robust and stable evaluation system, and I really hope CrowdAnalytix figures something out soon, else its just going to be a series of lottery competitions.

Nonetheless, I'm happy with my performance. Another win up my sleeve and looking forward to add more in the future!

Read a blog post about the 7th place solution by Triskelion on ML Wave.

Check out My Best CrowdAnalytix Performances

Saturday, July 11, 2015

Times Sudoku Championship 2015


The Times Sudoku Championship will be held in July/August. This championship will select four players who will be sponsored to represent India at the World Sudoku Championship 2015 (WSC).

Note: This will be the 'sponsored' team for the WSC. The main A-Team that will represent India for the WSC has been selected from the Indian Sudoku Championship 2015 held last month.

--- Rishi Puri, Prasanna Seshadri, Kishore Kumar and Me are in the A-Team ---

Read Rules and Regulations

The schedule is as follows:

Regional Round in Delhi (12th July, 2015)
Regional Round in Mumbai (12th July, 2015)
Regional Round in Chennai (19th July, 2015)
Regional Round in Bengaluru (26th July, 2015)

National Finals in Mumbai (August, 2015)

Top-3 players from each regional round will be selected for the National Finals. Last year's TSC winners (Prasanna, Rishi, Sumit and Me) get wild cards for the National Finals.


Mumbai Regionals (12th July, 2015)
Who better to take the Mumbai crown than Tejal Phatak! Congratulations for finally making it on the Mumbai podium! Congrats to Prabha Joshi and Jaykumar Patel for qualifying too. See you all during the finals!

Read the Mumbai Article

The regional rounds in Mumbai and Delhi will be held simultaneously on 12th July. I won the Mumbai regionals last three years. Since I have a wild card this year and so does Prasanna Seshadri, its an open door for newcomers. I have no idea who could be in the top-3 unless someone is planning to travel from another city, maybe Tejal.


Delhi Regionals (12th July, 2015)
Delhi results are not surprising. Congrats to Akash Doulani, who has been in good touch lately, followed by Rajesh Aggarwal and Ritesh Gupta. Lets lock horns at the finals!

Read the Delhi Article

The regional rounds in Mumbai and Delhi will be held simultaneously on 12th July. Among the top known solvers of India, I expect Akash Doulani and Ritesh Gupta to qualify from Delhi (if they participate). Maybe Himani Shah, who's not been in the sudoku circuit recently or even Dileep Singh.


Chennai Regionals (19th July, 2015)
Chennai results were as expected too. Congrats to Rakesh Rai and Kishore Kumar for their consistent performances at the sudoku circuit, and Pranav Kamesh for coming in third. Looking forward to the finals!

Read the Chennai Article

I'm expecting and hoping Rakesh Rai and Kishore Kumar qualify from Chennai, they've been among the top solvers of India in recent times. There are some upcoming names from Chennai, so I wouldn't be surprised to see a new name in the top-3 this year.


Bengaluru Regionals (26th July, 2015)
The Bengaluru regionals is going to be a cracker! There are many potentials players who could make it in the top-3 this year. Some usual suspects are Rajesh Kumar, Harmeet Singh, Kunal Verma, Jayant Ameta, Gaurav Kumar Jain, Zalak Ghetia... and some more who's names are not on the top of my head! I would've loved to be there and see you guys battle it out, but unfortunately, I'm in Mumbai over the weekend.
Good Luck and may the best-3 qualify!


Wednesday, June 24, 2015

Indian Sudoku Championship 2015


The Indian Sudoku Championship 2015 was held online on 28th June, 2015.


Information
View Championship Page

Download Instruction Booklet
Download Puzzle Booklet

View Forum
View Results

The top-4 from ISC will represent India at the World Sudoku Championship (WSC) 2015, which will be held in October. There will be a separate event Times Sudoku Championship (TSC) conducted later by TOI and LMI to sponsor four players for the WSC.

Yes, its a little complicated (with a 2-experienced + 2-inexperienced rule being enforced in TSC this year), but I'll come to that later once TSC is announced. Right now, its more about practising for this Sunday, enjoying the afternoon solving some wonderful sudokus (like its always been during ISC) and crowning the national champion.


Personal
I've finished in the top-3 of ISC for the last 5 years and hoping to do the same this year too. Its going to be a tough and interesting contest battling it out with Rishi and Prasanna, who have been in great form recently.

There are many other good contenders who have the potential to make it to the team this year. Let's hope we have the best team that will get India into the top-5 in the World!

Good Luck to all participants!


Results
View Complete Results

Congrats to Rishi Puri, for retaining the National Title with a impressive performance of completing all sudokus in 97mins, to Prasanna Seshadri, who's been in top form, for completing all sudokus in 112mins and to Kishore Kumar, who has missed the top-4 closely last couple of years, for finally making it.

I finished all sudokus in 119mins, making me 3rd.

Really nice set of sudokus (as usual), and it was an enjoyable contest. Thanks to Deb and all the authors for organizing another successful ISC.

Even though Kishore completed 26 / 27 sudokus, it was good enough to get him into 4th place. I'm really happy he's on the team after narrowly missing out last year.

So, Rishi, Prasanna, Kishore and me. I think this is a strong team, definitely the best 4 sudoku solvers in India today and hope we can get India into the top-5 this year!


Practise Sudokus
I'll upload some practise sudokus as and when I get time. Feel free to comment if you want any particular sudoku type to practise, I'll try creating some.

Here's are some sudokus that I created for practise.

Shape Sudoku (using colours instead of shapes):






Filler Sudoku:





Links to some more practise sudokus:

Triomino Sudoku (Ashish Kumar)
Triomino Sudoku (Prasanna Seshadri)
True Or Lie Sudoku (Rishi Puri)
Search-9 Sudoku (Rishi Puri)

LMI Forum (Links to practise puzzles are generally shared)

You always have Google for more :-)

Wednesday, May 6, 2015

TFI Restaurant Revenue Prediction


The TFI Restaurant Revenue Prediction competition was held on Kaggle in Mar-May, 2015.

Objective
New restaurant sites take large investments of time and capital to get up and running. When the wrong location for a restaurant brand is chosen, the site closes within 18 months and operating losses are incurred.

The objective was to predict the annual restaurant sales of a restaurant.

Data
The train data consisted of 137 rows with restaurant data pertaining to opening date, city, type and anonymous variables related to demographic, real estate and commercial data along with the corresponding annual revenue.

The test data consisted of 100000 rows with restaurant data for which we had to predict the annual revenue. Most of the test data was junk, a popular technique used to prevent hand-labeling in such competitions. The actual size of the test set is rumoured to be around 320.

Approach
What can you do when you have just 137 data points? And some of them that look like outliers? You have to make a choice and bank on some luck :-)

I chose to build a model which gives relatively stable CV and a decent LB. I tried out a few models and found RandomForest giving decent/stable results, like many other participants found after reading the forums.

I tried some simple features, nothing too complex, since over-fitting is highly likely on such datasets.
I also shuffled the train data and built RF models on different subsets to remove noise and the effect of outliers.

Also, training the model on log-transformed 'revenue' was much better than the raw 'revenue'.

Model
My final model was an average of many RFs built on different subsets of the data.

'days' variable (Number of days back the restaurant was opened) was the most important variable. I also converted some of the anonymous variables into dummy variables, treating them as categorical. These two ideas gave the best improvements.

Github
View Github repository

Results
My model scored 16.2L on the public LB which ranked 66th, and 17.6L on the private LB which ranked 14th! There were totally 2256 teams.

This is my best individual performance on Kaggle! :-)
Not the best competition on Kaggle, but it was certainly the biggest one in terms of teams. This also becomes the first competition to cross the 2000-participants mark. Of course, the Otto competition is going to beat this soon.

View Final Results
View Public LB

Views
Working with a small data-set is always challenging in many aspects. Choosing the model, training the model appropriately, preventing over-fitting, etc.

I'm glad I stuck with RF and made it as stable as possible.

The BAYZ team built a 'perfect submission' which scored 0 on the public LB, putting them in 1st place. How? You can keep track of their forum post and learn how to become a master at over-fitting! Of course, their final private LB rank is way below, but I still think they came up with a winning model (to overfit, not to predict revenue!) and I'm looking forward to know how they cracked it.

So, this gets me to 105th in overall Kaggle rankings and among the Top-3 Indians.
Next target is Top-50 and then Top-Indian.

Check out My Best Kaggle Performances

Saturday, April 18, 2015

Women's Healthcare Prediction


The Women's Healthcare Prediction competition was held on DrivenData from Feb-2015 to Apr-2015.

Objective
The challenge was to predict which healthcare services (like household, pregnancy, family, medical, etc.) were opted by women. Essentially, it was a multi-label, multi-class classification.

Data
The train data consisted of ~14600 rows (or women) along with various numeric and categorical variables and which of the 14 services were opted by them. Each woman could've opted for more than one service.

The test data consisted of ~3600 rows (or women) for which we had to predict which all services would they have opted for.

Approach
There were 1300+ variables, so my general approach was to do some form of FS along with an ensemble of classification models.

I started off with the usual suspects and found the tree-based models performing better than the linear models. None of the other models came even close to the accuracy received using XGBoost or RandomForest.

I tried multiple ways of doing feature selection and reducing the dimension, but they didn't improve the results significantly.

Once I exhausted all ideas, I used the brute-force approach to optimize my model performance by tweaking the parameters of each of the 14 individual labels.

Model
My final model was an ensemble of XGBoost and RandomForest with some standard data cleaning and FS. I optimized the parameters for each of the 14 labels, but that gave very minor improvement.

Results
I stood 11th on the public LB out of 104 teams. Just missed the Top-10 and also the Top-10% !
My model achieved logloss of 0.2588 while the topper was 0.2539.

View Complete Results

Views
This is the first competition where I really struggled for a long time. Tried lots of ideas, but nothing seemed to work. Ensembles hardly gave any improvement and I was literally stuck during the last 2 weeks.

The public/private LB split seemed excellent with the ranks remaining almost the same. Even the CV and LB scores moved in the same direction.

Feels like I missed out here, but it only motivates me to come harder next time. This was my first competition on DrivenData, and I'm hoping there are better ones to come soon!

Wednesday, April 1, 2015

Unlucky 13


I authored a Sudoku contest Unlucky 13 on LMI. It was held from 1st - 6th April, 2015 and consists of 13 sudokus to be solved in 65 minutes.

View Championship Page

Download Instruction Booklet
Download Puzzle Booklet
Password is LuckyYou

View Forum

View Results

"13 is my favourite number and I created this themed test in late-2014 during some easy days at work. Incidently, this is also the 13th test I'm authoring at LMI. Lot of special moments and memories along the way... and I hope players enjoy this set and make it a success!"

Congrats to Jan Zverina, Hideaki Jo and Jakub Ondrousek for the top-3 overall players.
Congrats to Prakhar Gupta, Kishore Kumar and Rishi Puri for the top-3 Indian players.

"Good artists copy, great artists steal" - Pablo Picasso.

Few months back, a couple of my friends created some sudoku variants and asked me to test solve them. It was their first try at creating sudokus and they did quite a decent job, since they were all unique. Only problem was, all the variants could be solved like Classics without having to use the variant rule and I had a hearty laugh while solving them. For example, there was an Odd Even Sudoku with 42 givens... a Non-Consecutive Sudoku with 33 givens... etc. :-)

That's how the idea was formed for this test. If I enjoyed it so much, maybe other solvers would enjoy it too, in its own humorous way. It was subtle April 'fooling', unlike last year's total surprise (which was awesome in its own way). Thanks to Deb Mohanty and Prasanna Seshadri for test-solving and other inputs and 'contributions'. I'm happy many players were able to complete the test and get the bonus, it was intentionally left longer and the difficulty such that a large portion of solvers would finish.

Thanks for all the messages, and hope to see some more exciting Sudoku solving in the months to come! :-)

Friday, March 20, 2015

Hotel Demand Forecasting


The Hotel Demand Forecasting competition was held on CrowdAnalytix in Feb, 2015.

Objective
The objective was to build a forecasting model to predict the demand in hotel using historic inquiries.

Data
The train data consisted of historic inquiries (reservation, denial, regret) for five different hotels in 2011, 2012, 2013.

The test data was predicting the demand for the hotels in 2014.

Approach
I found the historic demand having strong weekly trends (like you would intuitively expect) and a naive submission of using previous year's demand for the same weekday (eg: using previous year's Friday demand to predict this year's Friday demand in the corresponding week) gave a very good score. So, I decided to play with and optimize the historic averages. I ended up using two different versions of historic averages and made it to the top-5 without a sophisticated model. I wouldn't be surprised if the other toppers used similar ideas.

The first method of historic averages was using a weighted average of the previous three years' demand on the same weekday of the week.

The second method of historic averages was aggregating the weekly demand of the previous three years in the corresponding week and splitting it based on the historic demand proportion for each weekday, which was calculated separately for each quarter.

Model
The final model was an average of the two historic averages, along with some smoothing. The smoothing was redistributing the predictions across three weeks (the week before, the current week and the week after) using a weighted average. This smoothing gave me the biggest jump in my LB score, which pushed me into the top-5.

Code
View on Github

Results
I stood 5th on the public LB out of 45 teams. My model achieved MAPE score of ~ 0.26 and the best was ~ 0.25

The top-5 models were evaluated further and I still stood 5th :-|

Views
This is my second competition on CrowdAnalytix (after Exacerbation) and I'm glad I could finish in the top-5 in both of them. Though these are not as popular as the ones on Kaggle, I enjoyed exploring this forecasting model especially since it was one without any features.

Check out My Best CrowdAnalytix Performances

Tuesday, February 24, 2015

Avazu Click-Through Rate Prediction



The Avazu Click-Through Rate Prediction competition was held on Kaggle from Nov-2014 to Feb-2015.

Objective
Click-through rate is a very important measure for performance of ads and the challenge was to predict how likely an ad will be clicked.

Data
Train data consisted of ~ 40 million ads (which is just 10 days of Avazu data!) along with a label indicating whether they were clicked or not. The variables were about the website/app where the ad appeared, some features of the ad (like size, position, etc.), demographics of the user to whom the ad was shown and some anonymous variables.
The test data consisted of ~ 6 million ads (11th day of Avazu data).

Approach/Model
This is the largest data set I've worked with till date and 40 million rows of data meant memory issues right from the start.

Wait a minute. What about that awesome online-lr code? Of course... that's the same beauty I used for the Tradeshift competition and its the same one I used for this competition too. Well, isn't it just fabulous?

I started off playing around with the parameters of the code and adding interaction variables and generating some features. Some of the anonymous variables were decoded (by some Kagglers) and I tried using them more smartly.

There were massive number of participants and after 2-3 weeks, I was ranked in the top-20 with 600-700 teams. I had some work assignment for which I travelled to US, and wasn't sure if I would have time to try out new ideas, so I decided not to pursue it further.

Not much to share here, no particularly nice model ideas, but I still managed to secure 79th place out of a whopping 1604 teams scoring 0.3908 / 0.3889 using the logloss metric.

Views
It was a challenge to work with this data, and not having access to much RAM, it is all the more tricky. Thanks again to pypy and tinrtgu for the online-lr code and I'm glad I still made it into the top-10%

Congrats to 4-Idiots, Owen and Random Walker for the top-3 spots. What can you say about Owen? Leading the overall Kaggle rankings with more than double the points over 2nd place David Thaler. Some feat that it!

And for me, moved to 185th in overall rankings. The race is on to finish in the top-100 (or top-50) by end of this year.

Check out My Best Kaggle Performances

Saturday, January 10, 2015

Exacerbation Prediction


The Exacerbation Prediction competition was held on CrowdAnalytix in Nov-Dec, 2014.

Objective
Respiratory diseases (asthma, cystic fibrosis, smoking diseases, etc.) are one of the leading causes of deaths globally. As the condition of patients deteriorate, they experience 'exacerbations', which is sudden worsening of symptoms, requiring immediate emergency and medical attention.

The objective was to build a predictive model using medical and genetic data which predicts beforehand which patients will experience 'exacerbation' so that they can be provided appropriate medical treatment to prevent/control it.

Data
The train data consisted of ~ 4000 patients and 1300 variables along with the true labels of whether they experienced Exacerbation or not.
The test data consisted of ~ 2000 patients for which we had to predict the probability of Exacerbation.

Approach
My main idea was to build 2-3 strong classifiers and then build an ensemble with them. With 1300 variables, variable selection / dimension reduction became a must.

I tried tree-based models like Random Forest, GBM, Extra Trees, XG-Boost, etc., regression based models like Logistic Regression, Ridge Regression, etc., and some others like k-NearestNeighbours, SVM, NaiveBayes, etc.

RF and XGB gave the best results while LR and k-NN were decent. I explored and optimized these. After some tuning, XGB and LR gave much better scores, and k-NN didn't add any improvement.

Model
My final model was a weighted average of XG-Boost and Logistic Regression.

The XG-Boost was built on 150 variables, which were selected based on the variable importance of some sample tree models.

The Logistic Regression was built on the top-50 Principal Components.

Results
I stood 4th on the Public LB out of 101 teams, 1st on the Private LB, and finally 2nd on the Private Evaluation. I'm not sharing the scores (since they are not public), but my models achieved AUC scores of ~ 0.845

So, I stood 2nd! This is the first time I've got a ranking with some prize money! Yay!

Views
When I started this competition, I was looking at all numeric features of anonymized variables. I wasn't sure how much I could squeeze out from the data, but I put in a lot of time and effort and found some wonderful ideas in the process.

I think my model was a very robust and competitive one, and I was surprised it scored so consistently across multiple test sets.

Overall, it was fun. The Public LB evaluation on CrowdAnalytix is not absolutely ideal, since you can tune your model to overfit the LB. I still love Kaggle's method of evaluating winners.

Thanks to my family, friends and colleagues (especially my flat-mate and colleague Shashwat) for their help and support, this is a big achievement for me and I'm hoping to perform better in the years to come, and hopefully call myself one of the best Data Scientists of India :-)

Check out My Best CrowdAnalytix Performances