{
  "id": 6491,
  "title": "Solution Sharing",
  "content": "<p>I wasn't too high, but I learn a lot from seeing how different people approached the problem, so I'll hopefully get this thread going.</p>\n<p>&nbsp;</p>\n<p>I initially handled it as a regression problem, but ended up doing better when I treated it as classification. &nbsp;There were two basic approaches I used: one was scikit-learn's LogisticRegression, and the other was an SGD variant I've been working on in Java library. &nbsp;</p>\n<p>For the python version, I drew labels from a distribution specified by the confidence scores. For S and W, I drew from a multinomial, and for the K's, treated each as a separate Bernoulli draw. L1 regularization seemed to work best here. &nbsp;The number of models was driven mostly by patience--I used 12 different draws of Y, then averaged the predicted probabilities.</p>\n<p>In the Java version, I don't have sparsity penalties implemented yet, so those models had dense coefficients. Each time an example is presented to the learner, I pick a random +/- 1 label again according to the confidence score. &nbsp;For some reason, this worked well for the S and W variables, but not for K.</p>\n<p>My final submission was a simple average of the predictions from each of these two, with some different preprocessing steps (bigrams vs. trigrams, some cleaning vs. very little text cleaning). &nbsp;I'm not sure which preprocessing steps added the most, but it was largely inspired by&nbsp;<a href=\"http://sentiment.christopherpotts.net/tokenizing.html\">this page</a>. &nbsp;The only thing I added which might be reasonably clever was normalizing temperatures and rounding to the nearest 10 degree. &nbsp;The rationale is that it's hard to learn 21.34F from 102.12F, but if you have a lot of 20F and 100F's, there should be a more reliable signal.</p>\n<p>Hopefully some others will share some more successful approaches!</p>",
  "comments": [],
  "comment_count": 0,
  "messages": [
    {
      "id": 35612,
      "postDate": "2013-12-02T00:28:08.650Z",
      "content": "<p>I wasn't too high, but I learn a lot from seeing how different people approached the problem, so I'll hopefully get this thread going.</p>\n<p>&nbsp;</p>\n<p>I initially handled it as a regression problem, but ended up doing better when I treated it as classification. &nbsp;There were two basic approaches I used: one was scikit-learn's LogisticRegression, and the other was an SGD variant I've been working on in Java library. &nbsp;</p>\n<p>For the python version, I drew labels from a distribution specified by the confidence scores. For S and W, I drew from a multinomial, and for the K's, treated each as a separate Bernoulli draw. L1 regularization seemed to work best here. &nbsp;The number of models was driven mostly by patience--I used 12 different draws of Y, then averaged the predicted probabilities.</p>\n<p>In the Java version, I don't have sparsity penalties implemented yet, so those models had dense coefficients. Each time an example is presented to the learner, I pick a random +/- 1 label again according to the confidence score. &nbsp;For some reason, this worked well for the S and W variables, but not for K.</p>\n<p>My final submission was a simple average of the predictions from each of these two, with some different preprocessing steps (bigrams vs. trigrams, some cleaning vs. very little text cleaning). &nbsp;I'm not sure which preprocessing steps added the most, but it was largely inspired by&nbsp;<a href=\"http://sentiment.christopherpotts.net/tokenizing.html\">this page</a>. &nbsp;The only thing I added which might be reasonably clever was normalizing temperatures and rounding to the nearest 10 degree. &nbsp;The rationale is that it's hard to learn 21.34F from 102.12F, but if you have a lot of 20F and 100F's, there should be a more reliable signal.</p>\n<p>Hopefully some others will share some more successful approaches!</p>",
      "votes": 3
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-19T20:44:27Z",
  "competition_id": 3586,
  "competition_slug": "crowdflower-weather-twitter",
  "team_id": 65713,
  "solution_url": "/competitions/crowdflower-weather-twitter/writeups/mike-scarpati-solution-sharing"
}