Cirrhosis Prediction

Notes and Code for implementation of Neural Networks


Project maintained by yashkathe Hosted on GitHub Pages — Theme by mattgraham

Cirrhosis Prediction

Table of Content

Overview

In this project, I have developed a predictive model to classify cirrhosis into four categories using a neural network built with PyTorch.

I’m using the Cirrhosis Prediction Dataset.

What is Cirrhosis?

Cirrhosis is a chronic liver disease characterized by scarring (fibrosis) of the liver tissue, leading to impaired liver function.
It is commonly caused by long-term liver damage from factors like alcohol abuse, hepatitis, and fatty liver disease.
Early detection and classification of cirrhosis stages are essential for timely intervention.

Cirrhosis stages

Credits to the respective owner of the image

Files

Neural Network From Scratch

The files for this section include complete data preprocessing steps:

  1. Drop columns with excessive missing values
  2. Fill rows with missing values
  3. Data mapping
  4. Handle outliers
  5. Normalize the data
  6. Oversampling with SMOTE

Shallow Neural Network Using NumPy Only
=> Accuracy = 56%

Plot for Neural Network from Scratch

Shallow Neural Network With Updated Hyperparameters
=> Accuracy = 66%

Plot for Neural Network With Updated Hyperparameters

Neural Network Using PyTorch

Neural Network With Gradient Descent

Accuracy Plot
Loss Plot

Neural Network With Stochastic Gradient Descent

Accuracy Plot
Loss Plot

Neural Network With Stochastic Gradient Descent and Dropout Layers

Accuracy Plot
Loss Plot

Random Forest Implementation

Random Forest With 275 Estimators
=> Accuracy = 44%

Notes on How Neural Network Works (From Scratch)

Notes Page 1
Notes Page 2
Notes Page 3
Notes Page 4
Notes Page 5
Notes Page 6
Notes Page 7
Notes Page 8
Notes Page 9
Notes Page 10
Notes Page 11
Notes Page 12
Notes Page 13

Download the Whole PDF

Extra

Open an issue if there are any improvements or errors in the code and notes.

⭐ Star the repository if you like the notes and approach.