explaingit

shrutimalik123/the-adherence-predictor-logistic-regression-patient-compliance-engine

Analysis updated 2026-05-18

0PythonAudience · developerComplexity · 1/5Setup · easy

TLDR

An educational Python simulation that teaches logistic regression by having you predict which pharmacy patients are at risk of stopping their medication.

Mindmap

mindmap
  root((repo))
    What it does
      Logistic regression demo
      Sigmoid function
      Risk prediction
    Tech stack
      Python
    Use cases
      Learn ML basics
      Teaching demo
    Audience
      Students
      Developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Learn how logistic regression converts a percentage into a risk prediction.

USE CASE 2

Experiment with slope and bias values to see how they change a model's sensitivity.

USE CASE 3

Use as a teaching demo for the sigmoid function and decision thresholds.

What is it built with?

Python

How does it compare?

shrutimalik123/the-adherence-predictor-logistic-regression-patient-compliance-engine0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultyeasymoderatemoderate
Complexity1/52/54/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Needs only Python 3, no external libraries or frameworks required.

In plain English

This project is an interactive, educational Python program that teaches a statistics and machine learning technique called logistic regression, by wrapping it in a pharmacy themed simulation game. You play the role of a data analyst at a specialty pharmacy building an early warning system that flags patients who are likely to stop taking their prescribed medication. The core idea it teaches is how to turn a continuous number, in this case a patient's percentage of days they actually took their medicine, into a yes or no prediction of whether that patient is at risk of quitting their treatment. It does this using a mathematical curve called a sigmoid function, which takes any number and squeezes it into a probability between zero and one, and a threshold that decides where that probability counts as a warning versus safe. The program lets you adjust two settings yourself, a slope value and a bias value, which together control the shape of the underlying prediction line before it gets converted into a probability. Adjusting these settings changes how sensitive the system is, so you can see directly how the math behind the model responds to different choices. To play, you need only Python 3 installed, no extra libraries or frameworks. You clone the repository, save the provided script, and run it from the command line. Once running, you review sample patient compliance data, enter your own slope and bias values, and watch how the simulation handles a specific borderline patient whose medication compliance has dropped to 62 percent, to see whether your settings would trigger an automatic pharmacist follow up call. Because the project builds everything from basic Python math rather than relying on an existing machine learning library, it is meant as a learning tool for understanding how these prediction models work under the hood, rather than a production ready tool for real healthcare use.

Copy-paste prompts

Prompt 1
Run adherence_predictor.py and explain what the slope and bias values control.
Prompt 2
Walk me through how the sigmoid function turns a linear score into a probability in this code.
Prompt 3
Help me modify this simulation to use a different patient compliance threshold.
Prompt 4
Explain log-odds and decision boundaries using this pharmacy adherence example.

Frequently asked questions

What is the-adherence-predictor-logistic-regression-patient-compliance-engine?

An educational Python simulation that teaches logistic regression by having you predict which pharmacy patients are at risk of stopping their medication.

What language is the-adherence-predictor-logistic-regression-patient-compliance-engine written in?

Mainly Python. The stack also includes Python.

How hard is the-adherence-predictor-logistic-regression-patient-compliance-engine to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is the-adherence-predictor-logistic-regression-patient-compliance-engine for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.