<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shatabdi Choudhury on Medium]]></title>
        <description><![CDATA[Stories by Shatabdi Choudhury on Medium]]></description>
        <link>https://medium.com/@shatabdichoudhury2017?source=rss-4b7b9d08d776------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uQiT26TDb06zTV6JuHE_6g.jpeg</url>
            <title>Stories by Shatabdi Choudhury on Medium</title>
            <link>https://medium.com/@shatabdichoudhury2017?source=rss-4b7b9d08d776------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 02:02:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shatabdichoudhury2017/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Predicting Extreme Weather with Machine Learning: A Comparative Overview of Random Forest…]]></title>
            <link>https://medium.com/@shatabdichoudhury2017/predicting-extreme-weather-with-machine-learning-a-comparative-overview-of-random-forest-7dae78bfa6c0?source=rss-4b7b9d08d776------2</link>
            <guid isPermaLink="false">https://medium.com/p/7dae78bfa6c0</guid>
            <category><![CDATA[wids]]></category>
            <category><![CDATA[kaggle-competition]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science-for-good]]></category>
            <category><![CDATA[random-forest]]></category>
            <dc:creator><![CDATA[Shatabdi Choudhury]]></dc:creator>
            <pubDate>Sat, 21 Jan 2023 16:30:58 GMT</pubDate>
            <atom:updated>2023-01-21T21:21:25.789Z</atom:updated>
            <content:encoded><![CDATA[<h3>Predicting Extreme Weather with Machine Learning: A Comparative Overview of Random Forest, MLPRegressor, Decision Tree and Linear Regression</h3><p>Participating in a machine learning (ML) hackathon can be a great way to gain experience and learn new skills in ML, as well as network with other individuals interested in the field. However, it can be intimidating for beginners with little or no experience in machine learning. For people interested in data science, hackathons are a great way to learn, collaborate, gain confidence and hone one’s expertise. Remember that you don’t need much experience to participate in a hackathon, and many resources are available to help you prepare.</p><p>This blog post will provide a few steps and the code to help readers participate in the Women in Data Science (WiDS) 2023 ML Hackathon in Kaggle. With this post as a guide, anyone can make the most of the opportunity. Click here to experience the Hackathon <a href="https://www.widsconference.org/datathon.html">https://www.widsconference.org/datathon.html.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7lMmpKIBAsO_RQ4WfX7RNA.png" /></figure><p>Image Credit: <a href="https://www.widsconference.org/datathon.html">https://www.widsconference.org/datathon.html</a></p><p><strong>Problem</strong></p><p>Climate change is causing more extreme weather events, such as heatwaves and cold snaps, which can significantly impact communities. Long-term weather forecasting can help communities prepare for and adapt to these events. Several machine learning models can be used for this task, including Random Forest, MLPRegressor, Decision Tree, and Linear Regression. This blog post will use these different models to predict the arithmetic mean of the maximum and minimum temperature over the next 14 days for each location and start date.</p><p><strong>Code</strong></p><p><a href="https://github.com/shatabdichoudhury/WiDS_2023">https://github.com/shatabdichoudhury/WiDS_2023</a></p><p><a href="https://github.com/shatabdichoudhury/WiDS_2023/blob/main/wids2023_rf_dt_lr_nn.ipynb">https://github.com/shatabdichoudhury/WiDS_2023/blob/main/wids2023_rf_dt_lr_nn.ipynb</a></p><p><strong>Data</strong></p><p>The first step in building any of these predictive models is to collect and prepare the data. You can download the data from Kaggle.</p><p>Here is the shape of the training and test datasets.</p><pre>print(f&#39;Training dataset shape: {train_df.shape}&#39;)<br>print(f&#39;Training dataset shape: {test_df.shape}&#39;)<br>Training dataset shape: (375734, 246)<br>Training dataset shape: (31354, 245)</pre><p>The datasets have a large number of variables.</p><p>Data exploration, cleaning, and preprocessing are necessary to prepare the data for modeling. In the data exploration step, we try to understand the relationships between the different variables in the data by performing correlation analysis. This can help identify patterns that can be used to make predictions. We found many highly correlated pairs with an absolute correlation greater than 0.8. Look at the notebook in the code link for a detailed listing of the correlated variables.</p><p>The target is contest-tmp2m-14d__tmp2m, a continuous variable. The scatterplot of the target and climate regions shows clear temporal patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3pHd3Jkl8ViS40dmX-LMAQ.png" /></figure><p>We consolidated the low-frequency categories of the categorical variable, climate regions, and retained the top five categories, constituting 82% of the data.</p><p>In the feature engineering step, we extracted new features, such as day, month, and year, from the existing data that can be used to improve the model&#39;s accuracy.</p><p><strong>Models</strong></p><p>Once the data was ready, we partitioned the data into training and validation sets and started training the machine learning models.</p><p><strong>MLPRegressor</strong></p><p>MLPRegressor is a neural network model that can handle complex, non-linear relationships and uses multiple layers of artificial neurons to process the input data and make predictions. MLPRegressor can be helpful when many features exist and the relationships between variables are complex.</p><pre>from sklearn.pipeline import make_pipeline<br>from sklearn.preprocessing import QuantileTransformer<br>from sklearn.neural_network import MLPRegressor<br><br>print(&quot;Training MLPRegressor...&quot;)<br><br>est = make_pipeline(<br>    QuantileTransformer(),<br>    MLPRegressor(hidden_layer_sizes=(40,),<br>                 activation=&#39;relu&#39;, <br>                 solver=&#39;adam&#39;, <br>                 learning_rate_init=0.01,<br>                 max_iter=20,<br>                 early_stopping=True,<br>                 n_iter_no_change=5,<br>                 verbose=True,<br>                random_state=0)<br>)<br>est.fit(X_train, y_train)<br><br>mlp_train_r_sq = est.score(X_train, y_train)<br>mlp_val_r_sq = est.score(X_val, y_val)<br><br>predictions_val = est.predict(X_val)<br>mlp_val_mse = mean_squared_error(y_val, predictions_val)<br><br>predictions_train = est.predict(X_train)<br>mlp_train_mse = mean_squared_error(y_train, predictions_train)</pre><p><strong>Decision Tree</strong></p><p>Decision Tree is a simple model that creates a single tree. The tree is built using a set of rules, and the final predictions are made based on the path taken through the tree. Decision Tree can provide a simple visual representation of the decision-making process, which can be useful for interpreting the model’s predictions.</p><pre>from sklearn.tree import DecisionTreeRegressor<br><br>tree_model = DecisionTreeRegressor(max_depth=10, random_state=0)<br><br>tree_model = tree_model.fit(X_train, y_train)<br><br>tree_train_r_sq = tree_model.score(X_train, y_train)<br>tree_val_r_sq = tree_model.score(X_val, y_val)<br><br>predictions_val = tree_model.predict(X_val)<br>tree_val_mse = mean_squared_error(y_val, predictions_val)<br><br>predictions_train = tree_model.predict(X_train)<br>tree_train_mse = mean_squared_error(y_train, predictions_train)</pre><p><strong>Linear Regression</strong></p><p>Linear Regression models are trained by minimizing the sum of the squared errors between the predicted and actual values. Linear Regression models are simple and easy to interpret and can provide a clear understanding of the relationship between the independent and dependent variables.</p><pre>from sklearn.linear_model import LinearRegression<br><br>linear_model = LinearRegression()<br>linear_model = linear_model.fit(X_train, y_train)<br><br>lr_train_r_sq = linear_model.score(X_train, y_train)<br>lr_val_r_sq = linear_model.score(X_val, y_val)<br><br>predictions_val = linear_model.predict(X_val)<br>lr_val_mse = mean_squared_error(y_val, predictions_val)<br><br>predictions_train = linear_model.predict(X_train)<br>lr_train_mse = mean_squared_error(y_train, predictions_train)</pre><p>Evaluating the performance of the models is a crucial step in the process. The most commonly used evaluation metrics for regression problems are Root Mean Squared Error (RMSE) and R-Squared (R²). RMSE measures the average difference between the predicted and actual values, while R² measures the proportion of variance explained by the model. Lower RMSE and higher R² values indicate a better model.</p><p><strong>Random Forest Regression</strong></p><p>Random Forest is an ensemble method that generates many decision trees. The technique aims to develop numerous decision trees and then average their predictions. The main advantage of Random Forest is that it’s relatively robust to outliers and noisy data and performs well with many features.</p><pre>from sklearn.ensemble import RandomForestRegressor</pre><pre>rf_model = RandomForestRegressor(max_depth=10, random_state=0, n_estimators=20)</pre><pre>rf_model = rf_model.fit(X_train, y_train)</pre><pre>rf_train_r_sq = rf_model.score(X_train, y_train)<br>rf_val_r_sq = rf_model.score(X_val, y_val)</pre><pre>predictions_val = rf_model.predict(X_val)<br>rf_val_mse = mean_squared_error(y_val, predictions_val)</pre><pre>predictions_train = rf_model.predict(X_train)<br>rf_train_mse = mean_squared_error(y_train, predictions_train)</pre><p>Overfitting occurs when a machine learning model is trained to perform well on the training data but performs poorly on new, unseen data. It is often caused by a too-complex model with too many parameters, which leads to the model fitting the noise in the training data. One way to detect overfitting is to evaluate the model’s performance on a validation set, a set of data used to assess the model’s performance but not used during training. The validation set simulates the model’s performance on new, unseen data. If a model is overfitting, it performs well on the training set but does not generalize well on the validation set. In this scenario, one solution is to simplify the model by reducing the number of features or parameters. Another solution is to use techniques such as regularization, which penalizes specific model parameters if they are too large, helping the model generalize better. Here are the validation R-squared and RMSE to evaluate the model&#39;s performance on a validation set. We do not see a major difference between the training and validation metrics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L2hbhjA7aa1pvq8vWkCAtw.png" /></figure><p><strong>Summary</strong></p><p>Comparing machine learning models for temperature forecasting can be challenging. Still, by understanding the strengths and weaknesses of different models, such as Random Forest, MLPRegressor, Decision Tree, and Linear Regression, and evaluating their performance using metrics such as RMSE and R-Squared, you can select the best model for your specific problem and make accurate predictions to help communities adapt to the impacts of climate change. It’s important to note that the best model is not always the one with the lowest RMSE or the highest R-Squared.</p><p>It’s also essential to consider the interpretability of the model and its ability to generalize to unseen data.</p><p><strong>Future Work</strong></p><p>We will continue refining the models to perform better on the leaderboard. I will post about the interpretability of the model and feature importance in a later blog post.</p><p>Let me know what you think!</p><p><strong>Acknowledgment</strong></p><p><a href="https://www.kaggle.com/competitions/widsdatathon2023/overview">WiDS Datathon 2023</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7dae78bfa6c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Explainable Machine Learning: Making Sense of Motion Capture Data]]></title>
            <link>https://medium.com/@shatabdichoudhury2017/explainable-machine-learning-making-sense-of-motion-capture-data-1b15dc04baee?source=rss-4b7b9d08d776------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b15dc04baee</guid>
            <category><![CDATA[motion-capture]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[explainability]]></category>
            <dc:creator><![CDATA[Shatabdi Choudhury]]></dc:creator>
            <pubDate>Fri, 23 Dec 2022 21:49:01 GMT</pubDate>
            <atom:updated>2022-12-23T21:50:51.176Z</atom:updated>
            <content:encoded><![CDATA[<p>Explainable Machine Learning: Making Sense of Motion Capture Data</p><p>Machine learning models can analyze expansive amounts of data and make complex predictions, but sometimes it can be challenging to understand precisely how those predictions are made. This lack of explainability can be a problem, especially in fields like sports and healthcare, where the decisions made by a model can have significant consequences.<br>One way to improve the explainability of machine learning models is through techniques like partial dependence plots and feature importance analysis. These techniques allow us to understand how different data features influence the model’s predictions and can help us identify patterns that might not be immediately apparent.<br>When it comes to motion capture data, these techniques can be instrumental in helping us understand how different movements or patterns in the data affect the model’s predictions. For example, we might use a partial dependence plot to understand how changes in a specific movement affect the model’s prediction of an athlete’s performance, or we might use feature importance analysis to identify the most important movements for predicting the likelihood of an injury.<br>Overall, the use of explainable machine learning techniques can be a powerful tool for improving the accuracy and reliability of machine learning models, especially when working with complex and nuanced data like motion capture data. By better understanding the relationships between different features in the data and the model’s predictions, we can gain valuable insights and make more informed decisions.</p><p>Another way to improve the explainability of machine learning models is by using interpretable models. These models are designed to be more transparent and easier to understand, often by using more superficial mathematical structures or limiting the number of features used in the model.<br>Interpretable models can be beneficial when working with motion capture data. They can help us understand how different patterns are identified to make predictions. For example, we might use an interpretable model to identify the specific motions or patterns most important for predicting an athlete’s performance or to understand how different movements are associated with varying levels of risk for injury.<br>Using interpretable models can be a valuable tool for improving the explainability and trustworthiness of machine learning models, especially when working with complex and nuanced data like motion capture data. By using simpler and more transparent models, we can better understand how the model makes its predictions and make more informed decisions about using those predictions in real-world applications.</p><p>Another essential aspect of explainable machine learning is the use of human-readable explanations. These explanations of the model’s predictions are written in a way that is easy for humans to understand rather than just providing raw data or technical details.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b15dc04baee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using machine learning to predict intensive care unit patient survival]]></title>
            <link>https://medium.com/codait/using-machine-learning-to-predict-intensive-care-unit-patient-survival-744397256111?source=rss-4b7b9d08d776------2</link>
            <guid isPermaLink="false">https://medium.com/p/744397256111</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[women-in-data-science]]></category>
            <category><![CDATA[ensemble-learning]]></category>
            <category><![CDATA[kaggle]]></category>
            <dc:creator><![CDATA[Shatabdi Choudhury]]></dc:creator>
            <pubDate>Wed, 01 Jul 2020 22:39:29 GMT</pubDate>
            <atom:updated>2020-07-01T22:39:29.340Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Using machine learning to predict intensive care unit patient survival</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*UywfBmOetOnUBeHX5p22sQ.png" /><figcaption>Image credit: <a href="https://www.widsconference.org/datathon.html">https://www.widsconference.org/datathon.html</a></figcaption></figure><p>Earlier this year we participated in the <a href="https://www.kaggle.com/c/widsdatathon2020/">WiDS Datathon 2020</a>, where we had to solve a business problem with social impact. In this blog post I’ll share our findings.</p><p><strong>The problem</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*AK0uFgvZ9Dpmm7ALqykAmg.png" /><figcaption><strong>Image credit: </strong><a href="https://medicalxpress.com/news/2020-01-hospital-critical-resuscitation-patients-chances.html">https://medicalxpress.com/news/2020-01-hospital-critical-resuscitation-patients-chances.html</a></figcaption></figure><p>The first 24 hours in an intensive care unit (ICU) are extremely critical for any patient. Based on the condition of the patient, the hospital must provide highly advanced critical care tailored to individual patient’s needs to improve their chances of survival. There are many challenges in the functioning and delivery of the ICU of a hospital system, which include the demand for sufficient and specialized intensivists (a board-certified physician who provides special care for critically ill patients), technologies, and material supplies. These challenges directly impact the patient’s survival.</p><p>With the availability of large ICU datasets, we can uncover key patterns from patients’ health records which can be used to predict optimal medical care at the most important time. It can also help the doctors or nurses to build a personal profile of the patient, which can greatly help them to identify the top risk factors associated with patient survival.</p><p><strong>Our goals</strong></p><p>We had two major goals. First, to identify the top risk factors associated with a high mortality rate, that will help the medical system to understand the severity of the patient’s condition and to take quick action. Second, to predict the mortality rate which can help the medical facility to create a better action plan to improve patient survival. We think these may work as an efficient long-term solution for hospitals</p><p><strong>Data</strong></p><p>We downloaded the dataset from the <a href="https://www.kaggle.com/c/widsdatathon2020/data">Women in Data Science Datathon 2020 competition website on Kaggle</a>. The training dataset contains more than 97,000 hospital ICU records from patients, covers a one-year timeframe, and includes 186 attributes. The binary target variable is ‘hospital_death’, which indicates whether the patient died while hospitalized.</p><p>We started with exploratory data analysis, followed by data preparation. We did a few iterations of feature selection and building models. Finally, we compared the model performance and created the predictions. We used Jupyter notebooks using <a href="https://www.anaconda.com/">Anaconda</a> and <a href="https://www.python.org/">Python</a> libraries, especially, <a href="https://scikit-learn.org/stable/">sci-kit learn</a> Machine Learning libraries. The following diagram illustrates the process we followed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*-vhI4lDVRcYZcDFWTluzhQ.png" /></figure><p><strong>Exploratory Data Analysis</strong></p><p>We noticed that the target classes are imbalanced. Only about 8.6% of the observations have hospital_death = 1. That means, if we were to always predict 0, we would achieve an accuracy of 91.4%. That would be easy but useless.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*FZEoS6ivyptHCO2Z4O6v1A.png" /><figcaption>Distribution of target</figcaption></figure><p>That’s why classification accuracy is not generally used to predict imbalanced classes. The quality of models in the Kaggle competition was measured using Area under the ROC (Receiver Operating Characteristic) Curve (AUC) — a popular measure of model quality that is computed as the trade-off between true positive rate (TPR) and false-positive rate (FPR). It is a measure of the separability between the two target classes. Higher AUC indicates a more reliable model.</p><p>There are a few ways to handle imbalanced classes, such as resampling or Synthetic Minority Over-sampling Technique (<a href="https://medium.com/swlh/how-to-use-smote-for-dealing-with-imbalanced-image-dataset-for-solving-classification-problems-3aba7d2b9cad">SMOTE</a>). We tried the resampling approach to upsample the minority class. Up-sampling is the process of randomly resampling observations with replacement from the minority class to reinforce its signal. We used the <a href="https://scikit-learn.org/stable/modules/generated/sklearn.utils.resample.html">scikit-learn resample library</a> to perform the up-sampling.</p><p><strong>Data preparation</strong></p><p>We performed data preparation as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*GoOMZtvhi-NAvo1an8j68g.png" /><figcaption>Our data preparation steps</figcaption></figure><p>For the categorical features, we dropped constant value features and features with all unique values, such as identifiers. We merged categories that looked similar based on their names. For instance, feature ‘apache_2_bodysystem’, has two categories, ‘Undefined Diagnoses’, ‘Undefined diagnoses’, which seemed the same and we, therefore, merged them. We also encoded the categorical features as a one-hot numeric array using a label encoder. For the continuous features, we removed the features with more than 75% missing values. For the remaining features, we imputed missing values using <a href="https://scikit-learn.org/stable/modules/generated/sklearn.impute.SimpleImputer.html">Simple Imputer</a> with imputation strategy = “mean”, which replaces the missing values using the mean.</p><p><strong>Feature Selection</strong></p><p>Since the dataset has many features, our primary focus was feature selection. We initially could not even run all the models using all 186 features due to a lack of resources. We used a Random Forest model to perform feature selection and selected the top 30 features for modeling.</p><p><strong>Modeling</strong></p><p>We partitioned the data set into a 70:30 training/test split.</p><pre>X_train, X_test, y_train, y_test = <br>   train_test_split(X, y, test_size=0.2, random_state=rand_st)</pre><p>We applied various modeling techniques, starting with Logistic Regression.</p><pre>from sklearn.linear_model import LogisticRegression<br>start_ts=time.time()<br>clf = LogisticRegression(random_state=rand_st)<br>scores=cross_validate(clf, X_train,y_train, scoring=scorers, cv=5)</pre><pre>scores_Acc = scores[&#39;test_Accuracy&#39;]<br>print(&quot;Logistic Regression Acc: %0.5f (+/- %0.2f)&quot; % (scores_Acc.mean(), scores_Acc.std() * 2))</pre><pre>scores_AUC= scores[&#39;test_roc_auc&#39;]                                                                      <br>print(&quot;Logistic Regression AUC: %0.5f (+/- %0.2f)&quot; % (scores_AUC.mean(), scores_AUC.std() * 2))<br>print(&quot;CV Runtime:&quot;, time.time()-start_ts)</pre><p>The Logistic Regression model produced the following results:</p><pre>Logistic Regression Acc: 0.92601 (+/- 0.00)</pre><pre>Logistic Regression AUC: 0.86425 (+/- 0.00)<br> <br>CV Runtime: 38.70279788970947</pre><p>Next, we tried the Random Forest classifier.</p><pre>from sklearn.ensemble import RandomForestClassifier,GradientBoostingClassifier, AdaBoostClassifier<br>start_ts=time.time()<br>clf = RandomForestClassifier(criterion=&#39;entropy&#39;, max_depth=None, n_estimators=numTrees, min_samples_split=3, random_state=rand_st)    scores = cross_validate(clf, X_train,y_train, scoring=scorers, cv=5)</pre><pre>scores_Acc = scores[&#39;test_Accuracy&#39;]                                                                                                                                   print(&quot;Random Forest Acc: %0.5f (+/- %0.2f)&quot; % (scores_Acc.mean(), scores_Acc.std() * 2))</pre><pre>scores_AUC= scores[&#39;test_roc_auc&#39;]                                                                     <em>               </em><br>print(&quot;Random Forest AUC: %0.5f (+/- %0.2f)&quot; % (scores_AUC.mean(), scores_AUC.std() * 2))<br>print(&quot;CV Runtime:&quot;, time.time()-start_ts)</pre><p>The Random Forest classifier produced the following results:</p><pre>Random Forest Acc: 0.93008 (+/- 0.00)</pre><pre>Random Forest AUC: 0.88803 (+/- 0.00)</pre><pre>CV Runtime: 51.02054500579834</pre><p>The Random Forest model AUC was better than the Logistic Regression AUC. We also tried Ada Boosting, Gradient Boosting, Support Vector Machines, and Neural network models. In all cases, the goal was to determine the optimal model based on AUC and computation time. The computation time is a critical factor in any modeling since there are trade-offs between the accuracy of the model and time.</p><p>The Gradient Boosting experiment</p><pre>start_ts=time.time() <br>clf=GradientBoostingClassifier(loss=&#39;deviance&#39;, learning_rate=0.1, n_estimators=numTrees, min_samples_split=3, max_depth=3, random_state=rand_st)     <br>scores=cross_validate(clf, X_train,y_train, scoring=scorers, cv=5)</pre><pre>scores_Acc = scores[&#39;test_Accuracy&#39;]                                                                                                                                    <br>print(&quot;Gradient Boosting Acc: %0.5f (+/- %0.2f)&quot; % (scores_Acc.mean(), scores_Acc.std() * 2))</pre><pre>scores_AUC= scores[&#39;test_roc_auc&#39;]<br>print(&quot;Gradient Boosting AUC: <strong>%0.5f</strong> (+/- <strong>%0.2f</strong>)&quot; % (scores_AUC.mean(), scores_AUC.std() * 2))<br>print(&quot;CV Runtime:&quot;, time.time()-start_ts)</pre><p>produced these results:</p><pre>Gradient Boosting Acc: 0.93037 (+/- 0.00)</pre><pre>Gradient Boosting AUC: 0.89271 (+/- 0.01) </pre><pre>CV Runtime: 29.075139045715332</pre><p>The following table summarizes the model comparison using 5-fold cross-validation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l_-o5lMuijovWC_zhT3BJw.png" /><figcaption>Model performance comparison: accuracy, AUC, and runtime</figcaption></figure><p>We found the Gradient Boosting model performing the best based on accuracy and AUC. It might be because the Gradient Boosting uses an ensemble of weak learners to form a strong learner, which outperforms other models in this case. We also found the SVM model taking a super long time to finish.</p><p>Finally, we created a stacking model. <a href="https://medium.com/@gurucharan_33981/stacking-a-super-learning-technique-dbed06b1156d">Stacking is an ensemble technique</a> to combine other models, which are called as base models, by training a meta-model. We used Random Forest, Ada Boosting, and Gradient Boosting as base models and another Random Forest as a meta-model. The reason we tried the stacked model was to get a higher score in kaggle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*5UytlXCIOoB0Y4Y5HwP7tw.png" /><figcaption>Stacking Model</figcaption></figure><p><strong>Feature Importance</strong></p><p>The following figure shows the top features of the final model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*BB1Bi6WJ8HGDZ2IVxBR7-A.png" /><figcaption>Feature Importance</figcaption></figure><p>The top 10 features are two probabilistic predictions of mortality scores, several lab reports, specifically systolic blood pressure, lactate content, heart rate, and others and age of the patient. Based on the correlation analysis, we found that these lab results have negative correlations with the target. We also found that both probabilistic predictions of mortality scores have positive correlations with the patient’s death. As we imagined, the age of the patient has positive correlations with the patient’s death.</p><h4>Summary</h4><p>This framework attempts to address two potential functions: (1) to identify the top factors associated with a high mortality rate (2) to predict the mortality rate. It uses state-of-the-art machine learning techniques to learn from the ICU data. We think this framework will help the medical facility to create a sustainable care system to address the need of an ICU, such as the availability of doctors, nurses, medical resources, which will improve patient survival.</p><p><strong>How our results can be implemented</strong></p><p>With some enhancements, this approach can serve as a real-time data-driven decision-making helper for hospital management. A hospital can use it to build a personalized care plan for each patient. If we can gather future data, then this framework can be updated to learn using new data.</p><p><strong>Future work</strong></p><p>There are many applications of ICU data analysis. We were particularly interested in predicting patients’ survival rates and identifying the top factors of the ICU visit of the patient. However, future work can focus on association analysis of various diseases or diseases and symptoms found in ICU data. Another future work can be to find an optimal scheduling model for the doctors and nurses based on the demand of the ICU patients. It would also be nice to derive new features with the help of a domain expert in medical systems and run the same study again.</p><p><strong>Takeaways</strong></p><p>The first 24 hours in the ICU unit deals with extremes of life and death. We think our predictive framework will be greatly beneficial, which will help the medical system to provide the highest quality care to the patient.</p><p>WiDS competitions allow women to work on great data science challenges with social impact. I have learned a lot while working on this problem and am looking forward to the next WiDS datathon. I want to thank my amazing mentor, colleague, and datathon partner <a href="https://www.linkedin.com/in/svetlanalevitan/">Svetlana Levitan</a> for motivating me to write my first blog post.</p><p>Thank you for reading. Please let me know if you have any questions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=744397256111" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codait/using-machine-learning-to-predict-intensive-care-unit-patient-survival-744397256111">Using machine learning to predict intensive care unit patient survival</a> was originally published in <a href="https://medium.com/codait">Center for Open Source Data and AI Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>