BrainStrokeClassifier API
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(X) to make predictions. Where X is the input consisting of 7 characteristics:
- Gender ("Male"=0, "Female"=1, "Other"=-1)
- Age
- Do you have hypertension (Yes=1/No=0)
- Do you have any heart disease (Yes=1/No=0)
- What type of work you do? ("Private job"=0, "Self Employed"=1, "Govt. Job"=2, "Never Worked"=-2, "You are a Child"=-1)
- Your average blood glucose level
- Your Body Mass Index (BMI)
It classifies whether you are vulnerable to or had brain stroke, or not.
Input type
The input can be:
-
NumPy array
a. 1D array of shape (7,) b. 2D array of shape (S,7); where S is number of samples -
Pandas Series of shape (7,)
-
Pandas DataFrame of shape (S,7); where S is number of samples
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
Metadata
Release files for BrainStrokeClassifier 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| BrainStrokeClassifier-0.2.2.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| BrainStrokeClassifier-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / BrainStrokeClassifier-0.2.2.tar.gz
| Download URL | BrainStrokeClassifier-0.2.2.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff1f0084fe990821da39f480a4dd9bdc991907297307ca6259c2f1d19c0f76e5
|
|
BLAKE2b-256 checksum How to use checksums |
69365e46aaa987b903ca8bf3ab3335e39282365f1afe6f4cfbf237aa38ddc56d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Release files / BrainStrokeClassifier-0.2.2-py3-none-any.whl
| Download URL | BrainStrokeClassifier-0.2.2-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ffb0ee0b2b66c08a0f971810ef4e8d55bf482d1200021118052def889ae2996
|
|
BLAKE2b-256 checksum How to use checksums |
e09bd3b079d3b24a95b7f924930c8ede6310bef86dc48a383c6610856dacc638
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|