{
  "fetched_at": "2026-10-24T23:23:51Z",
  "source_url": "https://www.kaggle.com/competitions/cml2-length-of-stay-prediction-with-decision-trees/data",
  "pages": [
    {
      "name": "data-description",
      "content": "<p>The dataset comes from MIMIC project (<a href=\"https://mimic.physionet.org/\"> https://mimic.physionet.org/</a>). MIMIC-III (Medical Information Mart for Intensive Care III) is a large, freely-available database comprising deidentified health-related data associated with over forty thousand patients who stayed in critical care units of the Beth Israel Deaconess Medical Center between 2001 and 2012.</p>\n\n<p>Each row of *mimic_train.csv* correponds to one ICU stay (*hadm_id*+*icustay_id*) of one patient (*subject_id*). Column LOS is the length of stay of the current hospital stay, equal to discharge time minus admit time; this is the outcome to predict in our modelling exercise. The remaining columns correspond to vitals of each patient (when entering the ICU), plus some general characteristics (age, gender, etc.), and their explanation can be found at *mimic_patient_metadata.csv*.</p>\n\n<p>Please don't use any feature that you infer you don't know the first day of a patient in an ICU.</p>\n\n<p>Note that the main cause/disease of patient condition is embedded as a code at *ICD9_diagnosis* column. The meaning of this code can be found at *MIMIC_metadata_diagnose.csv*. But this is only the main one; a patient can have co-occurrent diseases (comorbidities). These secondary codes can be found at *extra_data/MIMIC_diagnoses.csv*.</p>\n\n<p>There is an extra test dataset, mimic_test_los.csv. Apply your final model to this extra dataset and produce a prediction csv file in same format as mimic_kaggle_los_sample_submission.csv.</p>\n\n",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    },
    {
      "name": "Description",
      "content": "## **Length of stay prediction**\nIn this project, you have to predict the length of stay (in days) of a patient that is entering an ICU (Intensive Care Unit) using decision tree models.\n\n<p>The dataset comes from MIMIC project (https://mimic.physionet.org/). MIMIC-III (Medical Information Mart for Intensive Care III) is a large, freely-available database comprising deidentified health-related data associated with over forty thousand patients who stayed in critical care units of the Beth Israel Deaconess Medical Center between 2001 and 2012.</p>\n\n<p>Each row of mimic_train.csv corresponds to one ICU stay (<i>hadm_id+ icustay_id</i>) of one patient (<i>subject_id</i>). Column <i>HOSPITAL_EXPIRE_FLAG</i> is the indicator of death (=1) as a result of the current hospital stay; this is the outcome to predict in our modelling exercise.\nThe remaining columns correspond to vitals of each patient (when entering the ICU), plus some general characteristics (age, gender, etc.), and their explanation can be found at <i>mimic_patient_metadata.csv</i>.</p>\n\n<p>Please don't use any feature that you infer you don't know the first day of a patient in an ICU, e.g. <i>HOSPITAL_EXPIRE_FLAG</i></p>\n\n<p>Note that the main cause/disease of patient condition is embedded as a code at <i>ICD9_diagnosis column</i>. The meaning of this code can be found at <i>MIMIC_metadata_diagnose.csv</i>. But this is only the main one; a patient can have co-occurrent diseases (comorbidities). These secondary codes can be found at <i>extra__data/MIMIC_diagnoses.csv</i>.</p>\n\nAs performance metric, please use RMSE (root mean squared error).\n\nMain tasks are:\n\n- Using *mimictrain.csv* file build a predictive model for *HOSPITALEXPIRE_FLAG *.\n- For this analysis there is an extra test dataset, mimic_test_los.csv. Apply your final model to this extra dataset and generate predictions following the same format as mimic_kaggle_los_sample_submission.csv. Once ready, you can submit to our Kaggle competition and iterate to improve the accuracy.\n\n\nAs a bonus, try different decision trees algorithms, even combine with other prediction models. Try to assess which features are more important, and if possible the confidence interval of predictions.\n\nYou can follow those steps in your first implementation:\n\n1. Explore and understand the dataset.\n2. Manage missing data.\n3. Manage categorical features. E.g. create dummy variables for relevant categorical features, or build an ad hoc distance function.\n4. Build a prediction model\n5. Assess expected accuracy of previous models using cross-validation.\n6. Predict on the test file, following same preparation steps (missing data, dummies, etc). Remember that you should be able to yield a prediction for all the rows of the test dataset. Submit to Kaggle to check performance.",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    },
    {
      "name": "Evaluation",
      "content": "<p>The evaluation metric for this competition is <a href=\"https://scikit-learn.org/stable/modules/generated/sklearn.metrics.auc.html\"> RMSE (Root Mean Squared Error)</a>. The RMSE, commonly used in regression models, gives an idea of the prediction error in the same units as the target, in our case length of stay in days. It's the root square of Mean Squared Error, which is another popular measure of error.</p>\n\n<p>Overall, RMSE is a measure of accuracy, to compare forecasting errors of different models for a particular dataset and not between datasets, as it is scale-dependent.&lt;\\p&gt;\n\n</p><h2>Submission Format</h2>\n<p><strong>For every patient in the test dataset</strong>, submission files should contain two columns: icustayid (this defines the individual prediction, and it's extracted from the test dataset) and LOS (float positive number, length of stay in days).</p>\n<p>The file should contain a header and have the following format:</p>\n<pre>icustay_id,LOS<br>1346,2.3<br></pre>\n<p>You can check the sample submission file mimic_kaggle_los_sample_submission.csv.</p>",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    },
    {
      "name": "rules",
      "content": "Please observe the following rules:\n\n- This is an Individual work! Don't share code with classmates (you'll be able to share code at the end of the competition)\n- Observe the deadlines!\n- Experiment as much as you can!\n- Have fun!",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    }
  ]
}