{
  "id": 335787,
  "title": "Multiclass ML, Log Loss and AIS (Acute Ischemic Stroke). Dragon Score. ",
  "url": "/competitions/mayo-clinic-strip-ai/discussion/335787",
  "author_name": "Marília Prata",
  "post_date": "2022-07-07T22:24:58.713000",
  "votes": 12,
  "comment_count": 6,
  "views": 0,
  "content": "<h1>Using a Multiclass Machine Learning Model to Predict the Outcome of Acute Ischemic Stroke Requiring Reperfusion Therapy</h1>\n<p>Authors: I-Min Chiu, Wun-Huei Zeng, Chi-Yung Cheng, Shih-Hsuan Chen, and Chun-Hung Richard Lin</p>\n<p>Diagnostics (Basel). 2021 Jan; 11(1): 80.  - Published online 2021 Jan 6. doi: 10.3390/diagnostics11010080</p>\n<p>\"Prediction of functional outcome in ischemic stroke patients is useful for clinical decisions. Previous studies mostly elaborate on the prediction of favorable outcomes. Miserable outcomes, which are usually defined as modified Rankin Scale (mRS) 5–6, should be considered as well before further invasive intervention. By using a machine learning algorithm, the authors aimed to develop a multiclass classification model for outcome prediction in acute ischemic stroke patients requiring reperfusion therapy.\"</p>\n<p>\" Patients with acute ischemic stroke who visited between January 2016 and December 2019 and who were candidates for reperfusion therapy were included. Clinical outcomes were classified as favorable outcome, intermediate outcome, and miserable outcome.\"</p>\n<p>\"The authors developed four different multiclass machine learning models (Logistic Regression, Supportive Vector Machine, Random Forest, and Extreme Gradient Boosting) to predict clinical outcomes and compared their performance to the DRAGON score.\"</p>\n<p>\"All selected machine learning models outperformed the DRAGON score on accuracy of outcome prediction (Logistic Regression: 0.70, Supportive Vector Machine: 0.67, Random Forest: 0.69, and Extreme Gradient Boosting: 0.67, vs. DRAGON: 0.51, p &lt; 0.001).\"</p>\n<p>\" Among all selected models, Logistic Regression also had a better performance than the DRAGON score on positive predictive value, sensitivity, and specificity. Compared with the DRAGON score, the multiclass machine learning approach showed better performance on the prediction of the 3-month functional outcome of acute ischemic stroke patients requiring reperfusion therapy.\"</p>\n<p><a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7825282/\" target=\"_blank\">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7825282/</a></p>\n<h1>The DRAGON score</h1>\n<p>\"The DRAGON score is a scoring system composed by six different variables evaluated from stroke patients at admission. It was created in 2012 to predict both favorable and miserable functional outcomes 3 months after the stroke , and it has been validated by several studies with good performance.\"</p>\n<p>\"On the other hand, to the best of the autors knowledge, there is no ML approach for the prediction of the whole spectrum functional outcomes in stroke patients. To assist with the generation of accurate treatment decisions, comprehensive outcome prediction for acute stroke patients is needed. Thus, this study aims to develop a multiclass machine learning prediction model on the 3-month outcome of acute ischemic stroke patients who were candidates for reperfusion therapy at the time of admission.\"</p>\n<p><a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7825282/\" target=\"_blank\">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7825282/</a></p>\n<p>Magnetic Resonance Imaging-DRAGON Score</p>\n<p>\"The DRAGON score, which includes clinical and computed tomographic scan parameters, showed a high specificity to predict 3-month outcome in patients with acute ischemic stroke treated by intravenous tissue plasminogen activator. We adapted the score for patients undergoing MRI as the first-line diagnostic tool.\"</p>\n<p><a href=\"https://www.ahajournals.org/doi/10.1161/strokeaha.111.000127#:~:text=The%20DRAGON%20score%2C%20which%20includes,the%20first%2Dline%20diagnostic%20tool\" target=\"_blank\">https://www.ahajournals.org/doi/10.1161/strokeaha.111.000127#:~:text=The%20DRAGON%20score%2C%20which%20includes,the%20first%2Dline%20diagnostic%20tool</a>.</p>\n<h1>On Kaggle (Loss) : RSNA Intracranial Hemorrhage Detection (evaluated by weighted multi-label logarithmic loss)</h1>\n<p>Notebook: Maybe *_any weight is x2 of others By Kambarakun</p>\n<p><a href=\"https://www.kaggle.com/code/kambarakun/maybe-any-weight-is-x2-of-others/script\" target=\"_blank\">https://www.kaggle.com/code/kambarakun/maybe-any-weight-is-x2-of-others/script</a></p>\n<p>Discussion Topic:  \"Tricks for Kaggle log loss\" By the amazing GM hengck23</p>\n<p>\"sampling/weighing is important in training</p>\n<p>when the metric is accuracy, we usually use : predict_label = predict_prob &gt; threshold<br>\nwe do not care about predict_prob, but rather thresholded prediction<br>\nwe sometimes use loss weighing (e.g focal loss) or class balancing to speed up training or improve accuracy. but improving accuracy is \"not the same\" as reducing loss. the loss is modified to improve accuracy by artificially changing the train distribution and affecting the decision boundary.</p>\n<p>\"for this challenge, they care about the actual log loss itself. so it is important to \"calibrate your probability\" to the actual one you expect in the test during training. you may have to use random sampling (instead of balanced sampling) at the final fine tuning. likewise you may need to disable any sample weighing.\"</p>\n<p>probability shaping</p>\n<p>\"this is is very difficult (and very risky in scoring). e.g. a test sample is predicted to be negative with probability 0.0001. you may round it to zero. you will gain a little if the truth is really negative, but you will lose big if it is truth is instead positive.\"</p>\n<p>\"if you can train with \"large margin\" and use some probability calibration trick such that you are almost 100% sure that there cannot be positive truth below a certain low values, you can zero out the values.\"</p>\n<p><a href=\"https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/114627\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/114627</a></p>\n<p>\"Relationship between accuracy and loss?\" By Ryan Epp</p>\n<p><a href=\"https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/114087\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/114087</a></p>\n<p>\"Code of weighted log loss is here\"  By Rajnish Chauhan</p>\n<p>Take care of BATCH_SIZE, it is same as taken in ImageGenerator.</p>\n<p>Use \"custom_log_loss\" in model.compile( loss ='customers_log_loss')</p>\n<p>def custom_log_loss(y_true, y_pred):<br>\nweights_cons = tf.constant([2.0, 1.0, 1.0, 1.0, 1.0, 1.0])<br>\nloss_val = tf.losses.sigmoid_cross_entropy(y_true, y_pred, weights = tf.broadcast_to(weights_cons, [BATCH_SIZE, 6]))</p>\n<p>loss_val = tf.nn.sigmoid_cross_entropy_with_logits(labels=y_true, logits=y_pred)<br>\nloss_val = tf.losses.sigmoid_cross_entropy(y_true, y_pred)<br>\nprint(y_true.shape)<br>\nprint(ck_val)<br>\nreturn loss_val</p>\n<p><a href=\"https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/111719\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/111719</a></p>\n<h1>By the way, what are the weights?  Don't bother to answer that, it's just a rhetorical question.</h1>\n<p>\"Why were the weight values in the evaluation metric not given to us? \"</p>\n<p><a href=\"https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/109447\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/109447</a></p>\n<h1>I hope that can help our community. And I don't have any stroke, since there is a lot to learn in this Competition.</h1>\n<p>Demographic characteristics of included Stroke patients:</p>\n<p>Male, Mean Age (67.9 ± 12.4), Sugar (mg/dL: 141 ± 57), Pre-Stroke, Old Stroke, Atrial fibrillation (227 (38.5)), Diabetes mellitus, <br>\nHypertension, Dyslipidemia, Coronary artery disease, Heart failure, Smoking (Source NIHSS: National Institutes of Health Stroke Scale)</p>\n<h1>Therefore dear kaggler, stand up from your Coding chair and avoid Sedentarism. The cause of many diseases. And Happy kaggling!</h1>",
  "messages": [
    {
      "id": 1847390,
      "postDate": "2022-07-07T22:24:58.713Z",
      "content": "<h1>Using a Multiclass Machine Learning Model to Predict the Outcome of Acute Ischemic Stroke Requiring Reperfusion Therapy</h1>\n<p>Authors: I-Min Chiu, Wun-Huei Zeng, Chi-Yung Cheng, Shih-Hsuan Chen, and Chun-Hung Richard Lin</p>\n<p>Diagnostics (Basel). 2021 Jan; 11(1): 80.  - Published online 2021 Jan 6. doi: 10.3390/diagnostics11010080</p>\n<p>\"Prediction of functional outcome in ischemic stroke patients is useful for clinical decisions. Previous studies mostly elaborate on the prediction of favorable outcomes. Miserable outcomes, which are usually defined as modified Rankin Scale (mRS) 5–6, should be considered as well before further invasive intervention. By using a machine learning algorithm, the authors aimed to develop a multiclass classification model for outcome prediction in acute ischemic stroke patients requiring reperfusion therapy.\"</p>\n<p>\" Patients with acute ischemic stroke who visited between January 2016 and December 2019 and who were candidates for reperfusion therapy were included. Clinical outcomes were classified as favorable outcome, intermediate outcome, and miserable outcome.\"</p>\n<p>\"The authors developed four different multiclass machine learning models (Logistic Regression, Supportive Vector Machine, Random Forest, and Extreme Gradient Boosting) to predict clinical outcomes and compared their performance to the DRAGON score.\"</p>\n<p>\"All selected machine learning models outperformed the DRAGON score on accuracy of outcome prediction (Logistic Regression: 0.70, Supportive Vector Machine: 0.67, Random Forest: 0.69, and Extreme Gradient Boosting: 0.67, vs. DRAGON: 0.51, p &lt; 0.001).\"</p>\n<p>\" Among all selected models, Logistic Regression also had a better performance than the DRAGON score on positive predictive value, sensitivity, and specificity. Compared with the DRAGON score, the multiclass machine learning approach showed better performance on the prediction of the 3-month functional outcome of acute ischemic stroke patients requiring reperfusion therapy.\"</p>\n<p><a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7825282/\" target=\"_blank\">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7825282/</a></p>\n<h1>The DRAGON score</h1>\n<p>\"The DRAGON score is a scoring system composed by six different variables evaluated from stroke patients at admission. It was created in 2012 to predict both favorable and miserable functional outcomes 3 months after the stroke , and it has been validated by several studies with good performance.\"</p>\n<p>\"On the other hand, to the best of the autors knowledge, there is no ML approach for the prediction of the whole spectrum functional outcomes in stroke patients. To assist with the generation of accurate treatment decisions, comprehensive outcome prediction for acute stroke patients is needed. Thus, this study aims to develop a multiclass machine learning prediction model on the 3-month outcome of acute ischemic stroke patients who were candidates for reperfusion therapy at the time of admission.\"</p>\n<p><a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7825282/\" target=\"_blank\">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7825282/</a></p>\n<p>Magnetic Resonance Imaging-DRAGON Score</p>\n<p>\"The DRAGON score, which includes clinical and computed tomographic scan parameters, showed a high specificity to predict 3-month outcome in patients with acute ischemic stroke treated by intravenous tissue plasminogen activator. We adapted the score for patients undergoing MRI as the first-line diagnostic tool.\"</p>\n<p><a href=\"https://www.ahajournals.org/doi/10.1161/strokeaha.111.000127#:~:text=The%20DRAGON%20score%2C%20which%20includes,the%20first%2Dline%20diagnostic%20tool\" target=\"_blank\">https://www.ahajournals.org/doi/10.1161/strokeaha.111.000127#:~:text=The%20DRAGON%20score%2C%20which%20includes,the%20first%2Dline%20diagnostic%20tool</a>.</p>\n<h1>On Kaggle (Loss) : RSNA Intracranial Hemorrhage Detection (evaluated by weighted multi-label logarithmic loss)</h1>\n<p>Notebook: Maybe *_any weight is x2 of others By Kambarakun</p>\n<p><a href=\"https://www.kaggle.com/code/kambarakun/maybe-any-weight-is-x2-of-others/script\" target=\"_blank\">https://www.kaggle.com/code/kambarakun/maybe-any-weight-is-x2-of-others/script</a></p>\n<p>Discussion Topic:  \"Tricks for Kaggle log loss\" By the amazing GM hengck23</p>\n<p>\"sampling/weighing is important in training</p>\n<p>when the metric is accuracy, we usually use : predict_label = predict_prob &gt; threshold<br>\nwe do not care about predict_prob, but rather thresholded prediction<br>\nwe sometimes use loss weighing (e.g focal loss) or class balancing to speed up training or improve accuracy. but improving accuracy is \"not the same\" as reducing loss. the loss is modified to improve accuracy by artificially changing the train distribution and affecting the decision boundary.</p>\n<p>\"for this challenge, they care about the actual log loss itself. so it is important to \"calibrate your probability\" to the actual one you expect in the test during training. you may have to use random sampling (instead of balanced sampling) at the final fine tuning. likewise you may need to disable any sample weighing.\"</p>\n<p>probability shaping</p>\n<p>\"this is is very difficult (and very risky in scoring). e.g. a test sample is predicted to be negative with probability 0.0001. you may round it to zero. you will gain a little if the truth is really negative, but you will lose big if it is truth is instead positive.\"</p>\n<p>\"if you can train with \"large margin\" and use some probability calibration trick such that you are almost 100% sure that there cannot be positive truth below a certain low values, you can zero out the values.\"</p>\n<p><a href=\"https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/114627\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/114627</a></p>\n<p>\"Relationship between accuracy and loss?\" By Ryan Epp</p>\n<p><a href=\"https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/114087\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/114087</a></p>\n<p>\"Code of weighted log loss is here\"  By Rajnish Chauhan</p>\n<p>Take care of BATCH_SIZE, it is same as taken in ImageGenerator.</p>\n<p>Use \"custom_log_loss\" in model.compile( loss ='customers_log_loss')</p>\n<p>def custom_log_loss(y_true, y_pred):<br>\nweights_cons = tf.constant([2.0, 1.0, 1.0, 1.0, 1.0, 1.0])<br>\nloss_val = tf.losses.sigmoid_cross_entropy(y_true, y_pred, weights = tf.broadcast_to(weights_cons, [BATCH_SIZE, 6]))</p>\n<p>loss_val = tf.nn.sigmoid_cross_entropy_with_logits(labels=y_true, logits=y_pred)<br>\nloss_val = tf.losses.sigmoid_cross_entropy(y_true, y_pred)<br>\nprint(y_true.shape)<br>\nprint(ck_val)<br>\nreturn loss_val</p>\n<p><a href=\"https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/111719\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/111719</a></p>\n<h1>By the way, what are the weights?  Don't bother to answer that, it's just a rhetorical question.</h1>\n<p>\"Why were the weight values in the evaluation metric not given to us? \"</p>\n<p><a href=\"https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/109447\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/109447</a></p>\n<h1>I hope that can help our community. And I don't have any stroke, since there is a lot to learn in this Competition.</h1>\n<p>Demographic characteristics of included Stroke patients:</p>\n<p>Male, Mean Age (67.9 ± 12.4), Sugar (mg/dL: 141 ± 57), Pre-Stroke, Old Stroke, Atrial fibrillation (227 (38.5)), Diabetes mellitus, <br>\nHypertension, Dyslipidemia, Coronary artery disease, Heart failure, Smoking (Source NIHSS: National Institutes of Health Stroke Scale)</p>\n<h1>Therefore dear kaggler, stand up from your Coding chair and avoid Sedentarism. The cause of many diseases. And Happy kaggling!</h1>",
      "rawMarkdown": "#Using a Multiclass Machine Learning Model to Predict the Outcome of Acute Ischemic Stroke Requiring Reperfusion Therapy\n\nAuthors: I-Min Chiu, Wun-Huei Zeng, Chi-Yung Cheng, Shih-Hsuan Chen, and Chun-Hung Richard Lin\n\nDiagnostics (Basel). 2021 Jan; 11(1): 80.  - Published online 2021 Jan 6. doi: 10.3390/diagnostics11010080\n\n\"Prediction of functional outcome in ischemic stroke patients is useful for clinical decisions. Previous studies mostly elaborate on the prediction of favorable outcomes. Miserable outcomes, which are usually defined as modified Rankin Scale (mRS) 5–6, should be considered as well before further invasive intervention. By using a machine learning algorithm, the authors aimed to develop a multiclass classification model for outcome prediction in acute ischemic stroke patients requiring reperfusion therapy.\"\n\n\" Patients with acute ischemic stroke who visited between January 2016 and December 2019 and who were candidates for reperfusion therapy were included. Clinical outcomes were classified as favorable outcome, intermediate outcome, and miserable outcome.\"\n\n\"The authors developed four different multiclass machine learning models (Logistic Regression, Supportive Vector Machine, Random Forest, and Extreme Gradient Boosting) to predict clinical outcomes and compared their performance to the DRAGON score.\"\n\n\"All selected machine learning models outperformed the DRAGON score on accuracy of outcome prediction (Logistic Regression: 0.70, Supportive Vector Machine: 0.67, Random Forest: 0.69, and Extreme Gradient Boosting: 0.67, vs. DRAGON: 0.51, p < 0.001).\"\n\n\" Among all selected models, Logistic Regression also had a better performance than the DRAGON score on positive predictive value, sensitivity, and specificity. Compared with the DRAGON score, the multiclass machine learning approach showed better performance on the prediction of the 3-month functional outcome of acute ischemic stroke patients requiring reperfusion therapy.\"\n\nhttps://www.ncbi.nlm.nih.gov/pmc/articles/PMC7825282/\n\n#The DRAGON score\n\n\"The DRAGON score is a scoring system composed by six different variables evaluated from stroke patients at admission. It was created in 2012 to predict both favorable and miserable functional outcomes 3 months after the stroke , and it has been validated by several studies with good performance.\"\n\n\"On the other hand, to the best of the autors knowledge, there is no ML approach for the prediction of the whole spectrum functional outcomes in stroke patients. To assist with the generation of accurate treatment decisions, comprehensive outcome prediction for acute stroke patients is needed. Thus, this study aims to develop a multiclass machine learning prediction model on the 3-month outcome of acute ischemic stroke patients who were candidates for reperfusion therapy at the time of admission.\"\n\nhttps://www.ncbi.nlm.nih.gov/pmc/articles/PMC7825282/\n\nMagnetic Resonance Imaging-DRAGON Score\n\n\"The DRAGON score, which includes clinical and computed tomographic scan parameters, showed a high specificity to predict 3-month outcome in patients with acute ischemic stroke treated by intravenous tissue plasminogen activator. We adapted the score for patients undergoing MRI as the first-line diagnostic tool.\"\n\nhttps://www.ahajournals.org/doi/10.1161/strokeaha.111.000127#:~:text=The%20DRAGON%20score%2C%20which%20includes,the%20first%2Dline%20diagnostic%20tool.\n\n#On Kaggle (Loss) : RSNA Intracranial Hemorrhage Detection (evaluated by weighted multi-label logarithmic loss)\n\nNotebook: Maybe *_any weight is x2 of others By Kambarakun\n\nhttps://www.kaggle.com/code/kambarakun/maybe-any-weight-is-x2-of-others/script\n\nDiscussion Topic:  \"Tricks for Kaggle log loss\" By the amazing GM hengck23\n\n\"sampling/weighing is important in training\n\nwhen the metric is accuracy, we usually use : predict_label = predict_prob > threshold\nwe do not care about predict_prob, but rather thresholded prediction\nwe sometimes use loss weighing (e.g focal loss) or class balancing to speed up training or improve accuracy. but improving accuracy is \"not the same\" as reducing loss. the loss is modified to improve accuracy by artificially changing the train distribution and affecting the decision boundary.\n\n\n\"for this challenge, they care about the actual log loss itself. so it is important to \"calibrate your probability\" to the actual one you expect in the test during training. you may have to use random sampling (instead of balanced sampling) at the final fine tuning. likewise you may need to disable any sample weighing.\"\n\nprobability shaping\n\n\"this is is very difficult (and very risky in scoring). e.g. a test sample is predicted to be negative with probability 0.0001. you may round it to zero. you will gain a little if the truth is really negative, but you will lose big if it is truth is instead positive.\"\n\n\"if you can train with \"large margin\" and use some probability calibration trick such that you are almost 100% sure that there cannot be positive truth below a certain low values, you can zero out the values.\"\n\nhttps://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/114627\n\n\"Relationship between accuracy and loss?\" By Ryan Epp\n\nhttps://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/114087\n\n\"Code of weighted log loss is here\"  By Rajnish Chauhan\n\nTake care of BATCH_SIZE, it is same as taken in ImageGenerator.\n\nUse \"custom_log_loss\" in model.compile( loss ='customers_log_loss')\n\ndef custom_log_loss(y_true, y_pred):\nweights_cons = tf.constant([2.0, 1.0, 1.0, 1.0, 1.0, 1.0])\nloss_val = tf.losses.sigmoid_cross_entropy(y_true, y_pred, weights = tf.broadcast_to(weights_cons, [BATCH_SIZE, 6]))\n\nloss_val = tf.nn.sigmoid_cross_entropy_with_logits(labels=y_true, logits=y_pred)\nloss_val = tf.losses.sigmoid_cross_entropy(y_true, y_pred)\nprint(y_true.shape)\nprint(ck_val)\nreturn loss_val\n\nhttps://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/111719\n\n#By the way, what are the weights?  Don't bother to answer that, it's just a rhetorical question.\n\n\"Why were the weight values in the evaluation metric not given to us? \"\n\nhttps://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/109447\n\n#I hope that can help our community. And I don't have any stroke, since there is a lot to learn in this Competition.\n\nDemographic characteristics of included Stroke patients:\n\nMale, Mean Age (67.9 ± 12.4), Sugar (mg/dL: 141 ± 57), Pre-Stroke, Old Stroke, Atrial fibrillation (227 (38.5)), Diabetes mellitus, \nHypertension, Dyslipidemia, Coronary artery disease, Heart failure, Smoking (Source NIHSS: National Institutes of Health Stroke Scale)\n\n#Therefore dear kaggler, stand up from your Coding chair and avoid Sedentarism. The cause of many diseases. And Happy kaggling!\n\n",
      "votes": 12
    },
    {
      "id": 1848292,
      "postDate": "2022-07-08T13:55:10.763Z",
      "content": "<blockquote>\n  <p>By the way, what are the weights?</p>\n</blockquote>\n<p>The evaluation page says that 'each class is roughly equally important for the final score'. So I'm guessing that both have equal weights. <br>\nThen by simple lb probing (committing 0 and 1), the results of my calculation <strong>support my guess</strong>.</p>",
      "rawMarkdown": "> By the way, what are the weights?\n\nThe evaluation page says that 'each class is roughly equally important for the final score'. So I'm guessing that both have equal weights. \nThen by simple lb probing (committing 0 and 1), the results of my calculation **support my guess**.",
      "votes": 1,
      "replies": [
        {
          "id": 1848303,
          "postDate": "2022-07-08T14:02:23.607Z",
          "content": "<p>Thank you zzy990106.<br>\nI decide to include that topic from the last Competition RSNA Intracranial Hemorrhage Detection.</p>\n<p>\"Why were the weight values in the evaluation metric not given to us? \"<br>\n<a href=\"https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/109447\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/109447</a></p>\n<p>Since here is Ischemic, I found interesting to add that too ;)</p>\n<p>Congrats for you 18th place (till now) <a href=\"https://www.kaggle.com/zzy990106\" target=\"_blank\">@zzy990106</a> </p>",
          "rawMarkdown": "Thank you zzy990106.\nI decide to include that topic from the last Competition RSNA Intracranial Hemorrhage Detection.\n\n\"Why were the weight values in the evaluation metric not given to us? \"\nhttps://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/109447\n\nSince here is Ischemic, I found interesting to add that too ;)\n\nCongrats for you 18th place (till now) @zzy990106 \n",
          "votes": 2
        },
        {
          "id": 1920852,
          "postDate": "2022-08-31T12:53:59.927Z",
          "content": "<p>Each class being roughly equal to me means that the less common class has a higher weight so as to make both classes as important when calculating the loss</p>",
          "rawMarkdown": "Each class being roughly equal to me means that the less common class has a higher weight so as to make both classes as important when calculating the loss"
        },
        {
          "id": 1938546,
          "postDate": "2022-09-14T08:06:02.427Z",
          "content": "<p>The number of samples are already devided before mutiplying by the weights, so each class would be equal important iff weights are equal</p>",
          "rawMarkdown": "The number of samples are already devided before mutiplying by the weights, so each class would be equal important iff weights are equal"
        },
        {
          "id": 1944007,
          "postDate": "2022-09-18T01:35:52.687Z",
          "content": "<p>Thank you <a href=\"https://www.kaggle.com/azirzhang\" target=\"_blank\">@azirzhang</a> , you are right. It is different from the usual definition of weighted log loss</p>",
          "rawMarkdown": "Thank you @azirzhang , you are right. It is different from the usual definition of weighted log loss"
        }
      ]
    },
    {
      "id": 1851831,
      "postDate": "2022-07-11T15:08:04.440Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 1848292,
      "author_name": "Leon",
      "author_url": "",
      "post_date": "2022-07-08T13:55:10.763000",
      "content": "<blockquote>\n  <p>By the way, what are the weights?</p>\n</blockquote>\n<p>The evaluation page says that 'each class is roughly equally important for the final score'. So I'm guessing that both have equal weights. <br>\nThen by simple lb probing (committing 0 and 1), the results of my calculation <strong>support my guess</strong>.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1848303,
          "author_name": "Marília Prata",
          "author_url": "",
          "post_date": "2022-07-08T14:02:23.607000",
          "content": "<p>Thank you zzy990106.<br>\nI decide to include that topic from the last Competition RSNA Intracranial Hemorrhage Detection.</p>\n<p>\"Why were the weight values in the evaluation metric not given to us? \"<br>\n<a href=\"https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/109447\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/109447</a></p>\n<p>Since here is Ischemic, I found interesting to add that too ;)</p>\n<p>Congrats for you 18th place (till now) <a href=\"https://www.kaggle.com/zzy990106\" target=\"_blank\">@zzy990106</a> </p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 1920852,
          "author_name": "cosmosaa",
          "author_url": "",
          "post_date": "2022-08-31T12:53:59.927000",
          "content": "<p>Each class being roughly equal to me means that the less common class has a higher weight so as to make both classes as important when calculating the loss</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1938546,
          "author_name": "Chen Zhang",
          "author_url": "",
          "post_date": "2022-09-14T08:06:02.427000",
          "content": "<p>The number of samples are already devided before mutiplying by the weights, so each class would be equal important iff weights are equal</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1944007,
          "author_name": "cosmosaa",
          "author_url": "",
          "post_date": "2022-09-18T01:35:52.687000",
          "content": "<p>Thank you <a href=\"https://www.kaggle.com/azirzhang\" target=\"_blank\">@azirzhang</a> , you are right. It is different from the usual definition of weighted log loss</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1851831,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-07-11T15:08:04.440000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1847390": "#Using a Multiclass Machine Learning Model to Predict the Outcome of Acute Ischemic Stroke Requiring Reperfusion Therapy\n\nAuthors: I-Min Chiu, Wun-Huei Zeng, Chi-Yung Cheng, Shih-Hsuan Chen, and Chun-Hung Richard Lin\n\nDiagnostics (Basel). 2021 Jan; 11(1): 80.  - Published online 2021 Jan 6. doi: 10.3390/diagnostics11010080\n\n\"Prediction of functional outcome in ischemic stroke patients is useful for clinical decisions. Previous studies mostly elaborate on the prediction of favorable outcomes. Miserable outcomes, which are usually defined as modified Rankin Scale (mRS) 5–6, should be considered as well before further invasive intervention. By using a machine learning algorithm, the authors aimed to develop a multiclass classification model for outcome prediction in acute ischemic stroke patients requiring reperfusion therapy.\"\n\n\" Patients with acute ischemic stroke who visited between January 2016 and December 2019 and who were candidates for reperfusion therapy were included. Clinical outcomes were classified as favorable outcome, intermediate outcome, and miserable outcome.\"\n\n\"The authors developed four different multiclass machine learning models (Logistic Regression, Supportive Vector Machine, Random Forest, and Extreme Gradient Boosting) to predict clinical outcomes and compared their performance to the DRAGON score.\"\n\n\"All selected machine learning models outperformed the DRAGON score on accuracy of outcome prediction (Logistic Regression: 0.70, Supportive Vector Machine: 0.67, Random Forest: 0.69, and Extreme Gradient Boosting: 0.67, vs. DRAGON: 0.51, p < 0.001).\"\n\n\" Among all selected models, Logistic Regression also had a better performance than the DRAGON score on positive predictive value, sensitivity, and specificity. Compared with the DRAGON score, the multiclass machine learning approach showed better performance on the prediction of the 3-month functional outcome of acute ischemic stroke patients requiring reperfusion therapy.\"\n\nhttps://www.ncbi.nlm.nih.gov/pmc/articles/PMC7825282/\n\n#The DRAGON score\n\n\"The DRAGON score is a scoring system composed by six different variables evaluated from stroke patients at admission. It was created in 2012 to predict both favorable and miserable functional outcomes 3 months after the stroke , and it has been validated by several studies with good performance.\"\n\n\"On the other hand, to the best of the autors knowledge, there is no ML approach for the prediction of the whole spectrum functional outcomes in stroke patients. To assist with the generation of accurate treatment decisions, comprehensive outcome prediction for acute stroke patients is needed. Thus, this study aims to develop a multiclass machine learning prediction model on the 3-month outcome of acute ischemic stroke patients who were candidates for reperfusion therapy at the time of admission.\"\n\nhttps://www.ncbi.nlm.nih.gov/pmc/articles/PMC7825282/\n\nMagnetic Resonance Imaging-DRAGON Score\n\n\"The DRAGON score, which includes clinical and computed tomographic scan parameters, showed a high specificity to predict 3-month outcome in patients with acute ischemic stroke treated by intravenous tissue plasminogen activator. We adapted the score for patients undergoing MRI as the first-line diagnostic tool.\"\n\nhttps://www.ahajournals.org/doi/10.1161/strokeaha.111.000127#:~:text=The%20DRAGON%20score%2C%20which%20includes,the%20first%2Dline%20diagnostic%20tool.\n\n#On Kaggle (Loss) : RSNA Intracranial Hemorrhage Detection (evaluated by weighted multi-label logarithmic loss)\n\nNotebook: Maybe *_any weight is x2 of others By Kambarakun\n\nhttps://www.kaggle.com/code/kambarakun/maybe-any-weight-is-x2-of-others/script\n\nDiscussion Topic:  \"Tricks for Kaggle log loss\" By the amazing GM hengck23\n\n\"sampling/weighing is important in training\n\nwhen the metric is accuracy, we usually use : predict_label = predict_prob > threshold\nwe do not care about predict_prob, but rather thresholded prediction\nwe sometimes use loss weighing (e.g focal loss) or class balancing to speed up training or improve accuracy. but improving accuracy is \"not the same\" as reducing loss. the loss is modified to improve accuracy by artificially changing the train distribution and affecting the decision boundary.\n\n\n\"for this challenge, they care about the actual log loss itself. so it is important to \"calibrate your probability\" to the actual one you expect in the test during training. you may have to use random sampling (instead of balanced sampling) at the final fine tuning. likewise you may need to disable any sample weighing.\"\n\nprobability shaping\n\n\"this is is very difficult (and very risky in scoring). e.g. a test sample is predicted to be negative with probability 0.0001. you may round it to zero. you will gain a little if the truth is really negative, but you will lose big if it is truth is instead positive.\"\n\n\"if you can train with \"large margin\" and use some probability calibration trick such that you are almost 100% sure that there cannot be positive truth below a certain low values, you can zero out the values.\"\n\nhttps://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/114627\n\n\"Relationship between accuracy and loss?\" By Ryan Epp\n\nhttps://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/114087\n\n\"Code of weighted log loss is here\"  By Rajnish Chauhan\n\nTake care of BATCH_SIZE, it is same as taken in ImageGenerator.\n\nUse \"custom_log_loss\" in model.compile( loss ='customers_log_loss')\n\ndef custom_log_loss(y_true, y_pred):\nweights_cons = tf.constant([2.0, 1.0, 1.0, 1.0, 1.0, 1.0])\nloss_val = tf.losses.sigmoid_cross_entropy(y_true, y_pred, weights = tf.broadcast_to(weights_cons, [BATCH_SIZE, 6]))\n\nloss_val = tf.nn.sigmoid_cross_entropy_with_logits(labels=y_true, logits=y_pred)\nloss_val = tf.losses.sigmoid_cross_entropy(y_true, y_pred)\nprint(y_true.shape)\nprint(ck_val)\nreturn loss_val\n\nhttps://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/111719\n\n#By the way, what are the weights?  Don't bother to answer that, it's just a rhetorical question.\n\n\"Why were the weight values in the evaluation metric not given to us? \"\n\nhttps://www.kaggle.com/competitions/rsna-intracranial-hemorrhage-detection/discussion/109447\n\n#I hope that can help our community. And I don't have any stroke, since there is a lot to learn in this Competition.\n\nDemographic characteristics of included Stroke patients:\n\nMale, Mean Age (67.9 ± 12.4), Sugar (mg/dL: 141 ± 57), Pre-Stroke, Old Stroke, Atrial fibrillation (227 (38.5)), Diabetes mellitus, \nHypertension, Dyslipidemia, Coronary artery disease, Heart failure, Smoking (Source NIHSS: National Institutes of Health Stroke Scale)\n\n#Therefore dear kaggler, stand up from your Coding chair and avoid Sedentarism. The cause of many diseases. And Happy kaggling!\n\n",
    "1848292": "> By the way, what are the weights?\n\nThe evaluation page says that 'each class is roughly equally important for the final score'. So I'm guessing that both have equal weights. \nThen by simple lb probing (committing 0 and 1), the results of my calculation **support my guess**.",
    "1851831": ""
  }
}