.. raw:: html
APLUS ML
A Python Library for Usefulness Simulations of Machine Learning Models
.. image:: _static/graphical_abstract.png
:width: 700
:alt: APLUS graphical abstract
🧑💻 Installation
---------------------
First, install the **aplusml** package:
.. code-block:: bash
pip install aplusml
Second, install **graphviz** to enable workflow visualization:
.. code-block:: bash
brew install graphviz
Please see the :doc:`intro/background` for a high-level conceptual overview of APLUS, or jump straight to :doc:`usage/quick` for a step-by-step walkthrough of using APLUS to model a clinical workflow.
🚀 Quick Start
---------------
.. code-block:: python
import aplusml
# Create config
config = aplusml.config.Config(
metadata = aplusml.config.ConfigMetadata(
name = 'My Simulation',
),
states = {
'start' : aplusml.config.ConfigState(
type = 'start',
transitions = [
aplusml.config.ConfigTransition(dest = 'end_1', prob = 0.5),
aplusml.config.ConfigTransition(dest = 'end_2', prob = 0.5),
],
),
'end_1' : aplusml.config.ConfigState(
type = 'end',
utilities = [
aplusml.config.ConfigUtility(
value = 1,
unit = 'qaly',
),
],
),
'end_2' : aplusml.config.ConfigState(
type = 'end',
utilities = [
aplusml.config.ConfigUtility(
value = 2,
unit = 'qaly',
),
],
),
},
)
# Create simulation
sim = aplusml.Simulation.create_from_config(config)
# Run simulation
patients = sim.create_patients_for_simulation([ aplusml.Patient(id=1, start_timestep=0) ])
patients = sim.run(patients)
# Visualize first patient's trajectory through workflow
print(patients[0].history)
Key Features
------------
APLUS ML (**A** **P**\ ython **L**\ ibrary for **U**\ sefulness **S**\ imulations of **M**\ achine **L**\ earning Models) is a simulation framework for conducting usefulness assessments of machine learning models in workflows, as originally published in this `2023 JBI paper