{
  "id": 6762,
  "title": "How do you compute the RMSE for all 37 classes?",
  "url": "/competitions/galaxy-zoo-the-galaxy-challenge/discussion/6762",
  "author_name": "",
  "post_date": "2014-01-06T23:12:31.803Z",
  "votes": null,
  "comment_count": 2,
  "views": 1532,
  "content": "<p>I want to be sure I evaluate correctly my solution.</p>\n<p>I use the formula from <a href=\"https://www.kaggle.com/wiki/RootMeanSquaredError\" target=\"_blank\">the kaggle help</a>&nbsp;to compute RMSE</p>\n<p>Here is the code I use :</p>\n<p><code>% text header has been removed from the csv file</code></p>\n<p><code></code><code><code>solutions = load('solutions_training.csv');&nbsp;</code></code></p>\n<p><code><code>y = solutions(:,2:end); % We remove galaxy ids&nbsp;<br><br>y_pred = zeros(size(y)); <br> <br>RMSE=sqrt(mean((y-y_pred).^2));</code></code></p>\n<p>&nbsp;</p>\n<p>However I end up with a RMSE matrix with 1 line and 37 columns.</p>\n<p>How should I compute the &nbsp;RMSE value for all 37 classes?</p>\n<p>&nbsp;</p>\n<p>Thanks!</p>",
  "messages": [
    {
      "id": "37064",
      "postDate": "01/06/2014 23:12:31",
      "content": "<p>I want to be sure I evaluate correctly my solution.</p>\n<p>I use the formula from <a href=\"https://www.kaggle.com/wiki/RootMeanSquaredError\" target=\"_blank\">the kaggle help</a>&nbsp;to compute RMSE</p>\n<p>Here is the code I use :</p>\n<p><code>% text header has been removed from the csv file</code></p>\n<p><code></code><code><code>solutions = load('solutions_training.csv');&nbsp;</code></code></p>\n<p><code><code>y = solutions(:,2:end); % We remove galaxy ids&nbsp;<br><br>y_pred = zeros(size(y)); <br> <br>RMSE=sqrt(mean((y-y_pred).^2));</code></code></p>\n<p>&nbsp;</p>\n<p>However I end up with a RMSE matrix with 1 line and 37 columns.</p>\n<p>How should I compute the &nbsp;RMSE value for all 37 classes?</p>\n<p>&nbsp;</p>\n<p>Thanks!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "37065",
      "postDate": "01/07/2014 00:12:47",
      "content": "<p>It looks like you're using Matlab. Use <a href=\"http://www.mathworks.com/help/matlab/ref/reshape.html\" target=\"_blank\">reshape</a>() to convert both y and y_pred into vectors and you should end up with a single RMSE.</p>\n<p>&nbsp;</p>\n<p>&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "37551",
      "postDate": "01/18/2014 01:43:06",
      "content": "<p>You should mean the error element-wise, but not simply columns-wise or row-wise.Just to compute the F-norm of the error matrix as</p>\n<p>error =&nbsp;(y-y_pred).^2&#65307;</p>\n<p>RMSE=sqrt(mean(error(:)));</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 37065,
      "author_name": "pbatra",
      "author_url": "",
      "post_date": "01/07/2014 00:12:47",
      "content": "<p>It looks like you're using Matlab. Use <a href=\"http://www.mathworks.com/help/matlab/ref/reshape.html\" target=\"_blank\">reshape</a>() to convert both y and y_pred into vectors and you should end up with a single RMSE.</p>\n<p>&nbsp;</p>\n<p>&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 37551,
      "author_name": "user157844",
      "author_url": "",
      "post_date": "01/18/2014 01:43:06",
      "content": "<p>You should mean the error element-wise, but not simply columns-wise or row-wise.Just to compute the F-norm of the error matrix as</p>\n<p>error =&nbsp;(y-y_pred).^2&#65307;</p>\n<p>RMSE=sqrt(mean(error(:)));</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "37064": "",
    "37065": "",
    "37551": ""
  },
  "source": "meta"
}