Skip to main content

Brain Stroke Classfier using Machine Learning!

Project description

BrainStrokeClassifier API

forthebadge made-with-python
Python 3.9

Functionality of the BrainStrokeClassifier

The package includes a trained Machine Learning model to predict Brain Stroke vulnerability. The model can be accessed as BStClassifier utility. You can use BStClassifier.predict(X) to make predictions. Where X is the input consisting of 7 characteristics:

  1. Gender ("Male", "Female", "Other")
  2. Age
  3. Do you have hypertension (Yes/NO)
  4. Do you have any heart disease (Yes/NO)
  5. What type of work you do? ("Private job", "Self Employed", "Govt. Job", "Never Worked", "You are a Child")
  6. Your average blood glucose level
  7. Your Body Mass Index (BMI)

It classifies whether you are vulnerable to or had brain stroke, or not.

Input type

The input can be:

  1. NumPy array a. 1D array of shape (7,) b. 2D array of shape (S,7); where S is number of samples
  2. Pandas Series of shape (7,)
  3. Pandas DataFrame of shape (S,7); where S is number of columns

About the Machine Learning model

The Machine Learning model is a Pipeline of Strandard Scaler and XGBoost Classifier. You can check the notebook where the model is trained through the github

Package Installation

Make sure you have Python installed in your system. Run Following command in the command window.

 !pip install BrainStrokeClassifier

Example Code

# test.py


# Package installation
!pip install BrainStrokeClassifier

# Loading package
from BrainStrokeClassifier import BStClassifier
import numpy as np
import pandas as pd

# Creating some test input

x = np.array([[0,67,0,1,0,228.69,36.6],
             [0,58,1,0,0,87.96,39.2]])

df = pd.DataFrame(x)
prediction = BStClassifier(df)
print(prediction)

For Suggestions

If you have any suggestions or improvements, please fork the package on github

Credits

The Umair Akram | MUmairAB

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

BrainStrokeClassifier-0.2.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

BrainStrokeClassifier-0.2.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file BrainStrokeClassifier-0.2.1.tar.gz.

File metadata

  • Download URL: BrainStrokeClassifier-0.2.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for BrainStrokeClassifier-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0c0e5a4a487005d80658271fa09fe7f082f8d409e7e7695a9d4a5b9110c678b5
MD5 5084cef001df90ed7b25969002a6c439
BLAKE2b-256 ff24ca92090c741d8584fbeda0054116ada42e942420c3171672f801d5ab8a18

See more details on using hashes here.

File details

Details for the file BrainStrokeClassifier-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for BrainStrokeClassifier-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d94afac1a7962d4b607b87e2de9f99b652b3c4a3db84ac0e35aaede0617ba012
MD5 0c2fd878dab2f8ea6175bedd6e4c9f42
BLAKE2b-256 57419d426652260153eb2f1eaeb46f55c310c415e97e1d8865fd1f6e7d0b05aa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page