Package: triage
TriageML/Data Science Toolkit for Social Good and Public Policy ProblemsBuilding ML/Data Science systems requires answering many design questions, turning them into modeling choices, which in turn define and machine learning models. Questions such as cohort selection, unit of analysis determination, outcome determination, feature (explanatory variables or predictors) generation, model/classifier training, evaluation, selection, bias audits, interpretation, and list generation are often complicated and hard to make design choices around apriori. In addition, once these choices are made, they have to be combined in different ways throughout the course of a project.Triage is designed to:Guide users (data scientists, analysts, researchers) through these design choices by highlighting critical operational use questions.Provide an integrated interface to components that are needed throughout a ML/data science project workflow.Getting Started with TriageAre you completely new to Triage? Run through a quick tutorial hosted on google colab (no setup necessary) to see what triage can do!Tutorial hosted on Google ColabDirty Duck Tutorial- Want a more in-depth walk through of triage's functionality and concepts? Go through the dirty duck tutorial that you can install on your local machine  with sample dataQuickStart Guide- Try Triage out with your own project and dataTriage Documentation Site- Used Triage before and want more reference documentation?Development- Contribute to Triage development.InstallationTo install Triage locally, you need:Ubuntu/RedHatPython 3.8+A PostgreSQL 9.6+ database with your source data (events,
geographical data, etc) loaded.NOTE: If your database is PostgreSQL 11+ you will get some
speed improvements. We recommend updating to a recent
version of PostgreSQL.Ample space on an available disk, (or for example in Amazon Web
Services's S3), to store the matrices and models that will be created for your
experimentsWe recommend starting with a new python virtual environment and pip installing triage there.$virtualenvtriage-env
$.triage-env/bin/activate(triage-env)$pipinstalltriageIf you get an error related to pg_config executable, run the following command (make sure you have sudo access):(triage-env)$sudoapt-getinstalllibpq-devpython3.9-devThen rerun pip install triage(triage-env)$pipinstalltriageTo test if triage was installed correctly, type:(triage-env)$triage-hDataTriage needs data in a postgres database and a configuration file that has credentials for the database. The Triage CLI defaults database connection information to a file stored in 'database.yaml' (example inexample/database.yaml).If you don't want to install Postgres yourself, trytriage db upto create a vanilla Postgres 12 database using docker. For more details on this command, check outTriage Database ProvisionerConfigure Triage for your projectTriage is configured with a config.yaml file that has parameters defined for each component. You can see somesample configuration with explanationsto see what configuration looks like.Using TriageVia CLI:triageexperimentexample/config/experiment.yamlImport as a python package:fromtriage.experimentsimportSingleThreadedExperimentexperiment=SingleThreadedExperiment(config=experiment_config,# a dictionarydb_engine=create_engine(...),# http://docs.sqlalchemy.org/en/latest/core/engines.htmlproject_path='/path/to/directory/to/save/data'# could be an S3 path too: 's3://mybucket/myprefix/')experiment.run()There are a plethora of options available for experiment running, affecting things like parallelization, storage, and more. These options are detailed in theRunning an Experimentpage.DevelopmentTriag was initially developed atUniversity of Chicago's Center For Data Science and Public Policyand is now being maintained at Carnegie Mellon University.To build this package (without installation), its dependencies may
alternatively be installed from the terminal usingpip:pip install -r requirement/main.txtTestingTo add test (and development) dependencies, usetest.txt:pip install -r requirement/test.txt [-r requirement/dev.txt]Then, to run tests:pytestDevelopment EnvironmentTo quickly bootstrap a development environment, having cloned the
repository, invoke the executabledevelopscript from your system
shell:./developA "wizard" will suggest set-up steps and optionally execute these, for
example:(install) begin

(pyenv) installed

(python-3.9.10) installed

(virtualenv) installed

(activation) installed

(libs) install?
1) yes, install {pip install -r requirement/main.txt -r requirement/test.txt -r requirement/dev.txt}
2) no, ignore
#? 1ContributingIf you'd like to contribute to Triage development, see theCONTRIBUTING.mddocument.