{
  "id": 159649,
  "title": "kappa: invalid value encountered in true_divide",
  "url": "/competitions/prostate-cancer-grade-assessment/discussion/159649",
  "author_name": "Dracarys",
  "post_date": "2020-06-18T07:10:04.065000",
  "votes": 0,
  "comment_count": 1,
  "views": 0,
  "content": "<p>While training i have encountered this weird error,  i am not sure why the denominator is getting 0.</p>\n\n<p><code>\nconda\\envs\\pytorch\\lib\\site-packages\\sklearn\\metrics\\_classification.py:600: RuntimeWarning: invalid value encountered in true_divide\n  k = np.sum(w_mat * confusion) / np.sum(w_mat * expected)\n</code></p>\n\n<p>does anyone else encountered same error? any help will be appreciated, thanks in advance.</p>",
  "messages": [
    {
      "id": 892570,
      "postDate": "2020-06-19T02:34:57.273Z",
      "content": "<p>k =( np.sum(w_mat * confusion) +1e-7)/ (np.sum(w_mat * expected)+1e-7) \neps=1e-7 #eps is a very small float</p>",
      "rawMarkdown": "k =( np.sum(w_mat * confusion) +1e-7)/ (np.sum(w_mat * expected)+1e-7) \neps=1e-7 #eps is a very small float",
      "votes": 1
    },
    {
      "id": 891426,
      "postDate": "2020-06-18T07:10:04.067Z",
      "content": "<p>While training i have encountered this weird error,  i am not sure why the denominator is getting 0.</p>\n\n<p><code>\nconda\\envs\\pytorch\\lib\\site-packages\\sklearn\\metrics\\_classification.py:600: RuntimeWarning: invalid value encountered in true_divide\n  k = np.sum(w_mat * confusion) / np.sum(w_mat * expected)\n</code></p>\n\n<p>does anyone else encountered same error? any help will be appreciated, thanks in advance.</p>",
      "rawMarkdown": "While training i have encountered this weird error,  i am not sure why the denominator is getting 0.\n\n```\nconda\\envs\\pytorch\\lib\\site-packages\\sklearn\\metrics\\_classification.py:600: RuntimeWarning: invalid value encountered in true_divide\n  k = np.sum(w_mat * confusion) / np.sum(w_mat * expected)\n```\n\ndoes anyone else encountered same error? any help will be appreciated, thanks in advance."
    }
  ],
  "comments": [
    {
      "id": 892570,
      "author_name": "zhangeng",
      "author_url": "",
      "post_date": "2020-06-19T02:34:57.273000",
      "content": "<p>k =( np.sum(w_mat * confusion) +1e-7)/ (np.sum(w_mat * expected)+1e-7) \neps=1e-7 #eps is a very small float</p>",
      "votes": 1,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "892570": "k =( np.sum(w_mat * confusion) +1e-7)/ (np.sum(w_mat * expected)+1e-7) \neps=1e-7 #eps is a very small float",
    "891426": "While training i have encountered this weird error,  i am not sure why the denominator is getting 0.\n\n```\nconda\\envs\\pytorch\\lib\\site-packages\\sklearn\\metrics\\_classification.py:600: RuntimeWarning: invalid value encountered in true_divide\n  k = np.sum(w_mat * confusion) / np.sum(w_mat * expected)\n```\n\ndoes anyone else encountered same error? any help will be appreciated, thanks in advance."
  }
}