temmyfioye / predictingchronickidneydisease

Predicted chronic kidney disease using biomarkers with Random Forest

Home Page:https://www.kaggle.com/code/apttemi/kidney-disease-rfc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Predicting Chronic Kidney Disease

For this project, a random forest classifier was used to predict the presence of chronic kidney disease. The dataset underwent preprocessing steps, such as converting categorical variables like "rbc" (Red Blood Cell count) to binary values (1 or 0) for normal or abnormal, respectively. Additionally,inaccurate values represented as "\t?" were replaced with NaN, which were then filled with the mean value of the respective columns. Duplicate rows were not present.

A pipeline was created using Scikit-learn's MinMaxScaler and RandomForestClassifier after splitting the dataset into training and testing sets. The accuracy score achieved by this algorithm was 92%, indicating a good performance.

A confusion matrix was plotted to evaluate the accuracy of the model. The classification report based on the confusion matrix demonstrated that the model performed well, with high precision, recall, and F1-score for both the "with CKD" and "without CKD" classes. This suggests that the model effectively distinguished between the two classes. The high accuracy and consistent performance across metrics indicate the reliability of the model for this classification task.

cm_ckd

Furthermore, the top 5 features, namely Hemoglobin (hemo), Packed Cell Volume (pcv), Specific Gravity (sg), rbc, and Albumin (al), were identified as the most important features. These features play a significant role in the random forest classifier's decision-making process. They reflect the importance of blood and urine parameters related to kidney function in determining the presence of chronic kidney disease. By considering these features, the model can make accurate predictions and provide insights into the factors that contribute most to the classification task.

features_ckd

The code is available and linked to this repository.

About

Predicted chronic kidney disease using biomarkers with Random Forest

https://www.kaggle.com/code/apttemi/kidney-disease-rfc


Languages

Language:Jupyter Notebook 100.0%