Skip to main content

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

patient-outcome-predictor-0.1.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file patient-outcome-predictor-0.1.2.tar.gz.

File metadata

File hashes

Hashes for patient-outcome-predictor-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d547c4d2b4e46d6d6a79ddd5ef98062f5f5f9b685ee402919bbee8351e766a07
MD5 69f338a0c4c6047bb7598792a6d28358
BLAKE2b-256 d25af4d170469a7a9a35a5e8d880f53d83c6e0d64fa45acf094c56c509cf256a

See more details on using hashes here.

File details

Details for the file patient_outcome_predictor-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for patient_outcome_predictor-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 136895c11d7ef33694bb095b5fe370bff30e0535add61a662855526bac2cc20c
MD5 4c5cd789492d667965c2106781bc2ff6
BLAKE2b-256 a55a5233840e837a715fae0b7e232f00de51b4e9e4735a28a249411eebc8c2a5

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