Giter Site home page Giter Site logo

temmyfioye / predictingchronickidneydisease Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 376 KB

Predicted chronic kidney disease using biomarkers with Random Forest

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

Jupyter Notebook 100.00%
kidney kidney-disease kidney-disease-prediction random-forest random-forest-classifier

predictingchronickidneydisease's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.