Code Monkey home page Code Monkey logo

halekpetigo / biof509 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 16.09 MB

Can heart attacks be predicted? This project attempts to answer that using machine learning algorithms? This project first implements 3 unsupervised learning algorithms (K-Means, density based clustering, and hierarchical clustering) to group the studied population into observable clusters. Then 3 supervised learning algorithms (SVM, Decision Tree and Bayesian) are used to predict at risk patients. The implemented algorithms efficiency are compared.

Jupyter Notebook 100.00%
ml machine-learning svm kmeans decision-tree density-based-clustering hierarchical-clustering bayesian heart-attack

biof509's Introduction

BIOF509 Final Project

Can heart attacks be predicted? This project attempts to answer that using machine learning algorithms? This project first implements 3 unsupervised learning algorithms (K-Means, density based clustering, and hierarchical clustering) to group the studied population into observable clusters. Then 3 supervised learning algorithms (SVM, Decision Tree and Bayesian) are used to predict at risk patients. The implemented algorithms efficiency are compared.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

This tool uses numpy, pandas, seaborn, umap, matplotlib and sklearn. If you do not have all the needed libraries to run the project, please install using pip install.

pip install missing_library

example to install seaborn
pip install seaborn

Getting latest version of the tool on your local environment

Step by step instruction on how to get a development env running

Clone project on your local machine.

git clone https://github.com/halekpetigo/BIOF509

Open FAES-BIOF-509-Hale_Kpetigo-FinalProject.ipynb with Jupyter Lab.

There are two classes in the tool. BIOF509Unsupervised and BIOF509Supervised.

BIOF509Unsupervised is used to analyze and classify the two example datasets provided. BIOF509Supervised is used to analyze and classify the two example datasets provided.

The two datasets provided are heart.csv and heart 2.csv. heart.csv is the complete Heart Disease Dataset from the University of California, Irvine. It contains 1025 records of patients from Cleveland, Hungarian, Switzerland and Long Beach VA. heart 2.csv contains 303 records which are the dataset from Cleveland.

BIOF509Unsupervised has four main methods.

  • data_analysis: Used to provide general analysis of the dataset
  • BIOF509Kmeans: Used to classify data using K-Means
  • BIOF509Density: Used to classify data using Density clustering
  • BIOF509Hierarchical: Used to classify data using Hierarchical Clustering

BIOF509Supervised has three main methods.

  • BIOF509SVM: Used to predict using SVM
  • BIOFDecisionTree: Used to predict using Decision Tree
  • BIOFBayesian: Used to predict using Gaussian Naive Bayes
  • BIOF509Unsupervised

Running BIOF509Unsupervised data_analysis. Play Cell 2 and Cell 3. In Cell 4 run the code below

# Load Cleveland only dataset
FinalProject = BIOF509Unsupervised("heart 2.csv")
# Second dataset used for comparision. Uncomment to use whole 1025 dataset
# FinalProject = BIOF509Unsupervised("heart.csv")
FinalProject.data_analysis()

Running BIOF509Unsupervised BIOF509Kmeans. Play Cell 2 and Cell 3. In Cell 4 run the code below

# Load Cleveland only dataset
FinalProject = BIOF509Unsupervised("heart 2.csv")
# Second dataset used for comparision. Uncomment to use whole 1025 dataset
# FinalProject = BIOF509Unsupervised("heart.csv")

FinalProject.BIOF509Kmeans()

Running BIOF509Unsupervised BIOF509Density. Play Cell 2 and Cell 3. In Cell 4 run the code below

# Load Cleveland only dataset
FinalProject = BIOF509Unsupervised("heart 2.csv")
# Second dataset used for comparision. Uncomment to use whole 1025 dataset
# FinalProject = BIOF509Unsupervised("heart.csv")

FinalProject.BIOF509Density()

Running BIOF509Unsupervised BIOF509Hierarchical. Play Cell 2 and Cell 3. In Cell 4 run the code below

# Load Cleveland only dataset
FinalProject = BIOF509Unsupervised("heart 2.csv")
# Second dataset used for comparision. Uncomment to use whole 1025 dataset
# FinalProject = BIOF509Unsupervised("heart.csv")

FinalProject.BIOF509Hierarchical()
  • BIOF509Supervised

Running BIOF509Supervised BIOF509SVM. Play Cell 2 and Cell 5. In Cell 20 run the code below

# Load Cleveland only dataset
FinalSupProject = BIOF509Supervised("heart 2.csv")
# Second dataset used for comparision. Uncomment to use whole 1025 dataset
#FinalSupProject = BIOF509Supervised("heart.csv")

FinalSupProject.BIOF509SVM()

Running BIOF509Supervised BIOFDecisionTree. Play Cell 2 and Cell 5. In Cell 20 run the code below

# Load Cleveland only dataset
FinalSupProject = BIOF509Supervised("heart 2.csv")
# Second dataset used for comparision. Uncomment to use whole 1025 dataset
#FinalSupProject = BIOF509Supervised("heart.csv")

FinalSupProject.BIOFDecisionTree()

Running BIOF509Supervised BIOFBayesian. Play Cell 2 and Cell 5. In Cell 20 run the code below

# Load Cleveland only dataset
FinalSupProject = BIOF509Supervised("heart 2.csv")
# Second dataset used for comparision. Uncomment to use whole 1025 dataset
#FinalSupProject = BIOF509Supervised("heart.csv")

FinalSupProject.BIOFBayesian()

Built With

Datasets

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Special thanks to James Anibal and Christina

biof509's People

Contributors

halekpetigo avatar

Watchers

 avatar

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.