A package that uses machine learning models to predict patient outcomes based on medical data.
Project description
Patient Outcome Predictor
This package uses machine learning models to predict patient outcomes based on various factors such as medical history, treatment plans, and demographic data. It helps in identifying high-risk patients and optimizing treatment strategies.
Installation
pip install patient_outcome_predictor
About Dataset
Description: The dataset used in this demo contains simulated medical records for a fictional group of patients. The dataset was generated using the Python Faker library to create realistic but fake data. The dataset includes the following fields for each patient:
Patient ID: A unique identifier for each patient (integer). Name: A randomly generated full name (string). Date of birth: A randomly generated date of birth with ages between 1 and 100 years old (date). Gender: A randomly selected gender (M or F) (string). Medical conditions: A list of three random, unique words representing medical conditions (string). Medications: A list of three random, unique words representing medications (string). Allergies: A list of three random, unique words representing allergies (string). Last appointment date: A randomly generated date within the range of the last 2 years (date). Please note that this dataset is for demonstration and testing purposes only. The data is entirely fictional and should not be used for any decision-making or analysis.
This enhanced implementation includes real-time prediction, CSV preprocessing, and a Streamlit app for demonstration. The fictional dataset provides a realistic context for testing the package.
#Example Usage
import pandas as pd
from patient_outcome_predictor import DataPreprocessor, ModelTrainer, OutcomePredictor
# this loads dataset
df = pd.read_csv('dataset.csv')
# Preprocess the data
preprocessor = DataPreprocessor()
X_train, X_test, X_val, y_train, y_test, y_val = preprocessor.preprocess(df, 'outcome')
# Train the model
model_trainer = ModelTrainer()
model_trainer.train(X_train, y_train)
# Evaluation of the model
accuracy = model_trainer.evaluate(X_test, y_test)
print(f'Accuracy: {accuracy}')
# Predict outcomes
predictor = OutcomePredictor(model_trainer.get_model(), preprocessor.scaler)
predictions = predictor.predict(X_test)
print(predictions)
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
Built Distribution
File details
Details for the file patient_outcome_predictor-0.1.7.tar.gz
.
File metadata
- Download URL: patient_outcome_predictor-0.1.7.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dcd4bee9d9fd8a63a59475ec334721817e9973f032dd5e6e408e531734d93ab |
|
MD5 | 4c50135e2cad4b34441fd4dbf99ff162 |
|
BLAKE2b-256 | 844e5467d22400e36f3d9d3394230b53b0067b5d476fefc15e8707c7c5f00fb6 |
File details
Details for the file patient_outcome_predictor-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: patient_outcome_predictor-0.1.7-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ce31160f1872ca1c77403caaf647e58e752f49817d2b1ca9831891413b2623c |
|
MD5 | 3d9f60231885aa9f645a284678419033 |
|
BLAKE2b-256 | 142c6140f4f4ab21ce217175b818d74c82a86914483b328f8f7bce8ae01f3d68 |