Package: checkrs
checkrsTools for simulation-based model checking.DescriptionThe checkrs package contains functions for creating 7 model checking/diagnostic plots described inBrathwaite, Timothy. "Check yourself before you wreck yourself: Assessing
discrete choice models through predictive simulations" arXiv preprint
arXiv:1806.02307 (2018).https://arxiv.org/abs/1806.02307.Beyond the plots described in this paper, checkrs enables the creation of reliability and marginal model plots that use continuous scatterplot smooths based onExtremely Randomized Treesas kernel estimators, as opposed to only allowing discrete smooths based on binning.As for the name, checkrs is a play on the word "checkers," i.e., those tools one uses to check, or one who checks.
The name is also a play on the phrases "check the research of scientists" and "check research scientists."Installationpip install checkrsUsageNote thatexample_projectis fictitious! This example is, literally, just an example.from checkrs import ChartData, ViewSimCDF

from example_project import load_data

design, targets_observed, targets_simulated = load_data()

chart_data = ChartData.from_raw(
  targets=targets_observed,  # 1D Ndarray or Tensor
  targets_simulated=targets_simulated, # 2D Ndarray or Tensor
  design=design # DataFrame or None
)

chart = ViewSimCDF.from_chart_data(chart_data)

chart_plotnine = chart.draw(backend="plotnine")
chart_altair = chart.draw(backend="altair")

####
## Save to a variety of formats
####
# chart.save("temp_plot.png")
# chart.save("temp_plot.pdf")
# chart.save("temp_plot.json")
# chart.save("temp_plot.html")See docstrings forChartData.from_raw,ViewSimCDF.from_chart_data, andViewSimCDF.save.To-Do:Add package to conda and conda-forgeDevelopment installationTo work on and edit checkrs, the following setup process may be useful.from the project root, create an environmentcheckrswith the help ofconda,cd checkrs
conda env create -n checkrs -f environment.ymlactivate the new environment withconda activate checkrsinstallcheckrsin an editable fashion using:flit install --pth-fileOptional and needed only once aftergit clone:install severalpre-commitgit hooks with:pre-commit installand checkout the configuration under.pre-commit-config.yaml.
The-n, --no-verifyflag ofgit commitcan be used to deactivate pre-commit hooks temporarily.Then take a look into thescriptsandnotebooksfolders.Dependency Management & ReproducibilityAlways keep your abstract (unpinned) dependencies updated inenvironment.yml,requirements.in, and eventually inpyproject.tomlif you want to ship and install the package viapiplater on.Useenvironment.ymlfor dependencies that cannot be installed viapip.Userequirements.infor dependencies that can be installed viapip.Usepyproject.tomlfor dependencies that are needed forcheckrsto function at all, not just in development.Create concrete dependencies asrequirements.txtfor the exact reproduction of your environment with:pip-compile requirements.inManually update any non-pip dependencies inenvironment.yml, being sure to pin any such dependencies to a specific version.Update your current environment using:conda env update -f environment.ymlOrpip install -r requirements.txtif you did not update any non-pip dependencies.Project Organization├── AUTHORS.rst             <- List of developers and maintainers.
├── CHANGELOG.rst           <- Changelog to keep track of new features and fixes.
├── LICENSE.txt             <- License as chosen on the command-line.
├── README.md               <- The top-level README for developers.
├── configs                 <- Directory for configurations of model & application.
├── data
│   ├── external            <- Data from third party sources.
│   ├── interim             <- Intermediate data that has been transformed.
│   ├── processed           <- The final, canonical data sets for modeling.
│   └── raw                 <- The original, immutable data dump.
├── docs                    <- Directory for Sphinx documentation in rst or md.
├── environment.yaml        <- The conda environment file for reproducibility.
├── models                  <- Trained and serialized models, model predictions,
│                              or model summaries.
├── notebooks               <- Jupyter notebooks. Naming convention is a number (for
│                              ordering), the creator's initials and a description,
│                              e.g. `1.0-fw-initial-data-exploration`.
├── references              <- Data dictionaries, manuals, and all other materials.
├── reports                 <- Generated analysis as HTML, PDF, LaTeX, etc.
│   └── figures             <- Generated plots and figures for reports.
├── scripts                 <- Analysis and production scripts which import the
│                              actual PYTHON_PKG, e.g. train_model.
├── setup.cfg               <- Declarative configuration of your project.
├── setup.py                <- Use `python setup.py develop` to install for development or
|                              or create a distribution with `python setup.py bdist_wheel`.
├── src
│   └── checkrs             <- Actual Python package where the main functionality goes.
├── tests                   <- Unit tests which can be run with `py.test`.
├── .coveragerc             <- Configuration for coverage reports of unit tests.
├── .isort.cfg              <- Configuration for git hook that sorts imports.
└── .pre-commit-config.yaml <- Configuration of pre-commit git hooks.NoteThis project has been set up using PyScaffold 3.3a1 and thedsproject extension0.4.
For details and usage information on PyScaffold seehttps://pyscaffold.org/.