Skip to main content

views-runs

This package is meant to help views researchers with training models, by providing a common interface for data partitioning and stepshift model training. It also functions as a central hub package for other classes and functions used by views researchers, including stepshift (StepshiftedModels) and views_partitioning (DataPartitioner).

Installation

To install views-runs, use pip:

pip install views-runs

This also installs the vendored libraries stepshift and views_partitioning.

Usage

The library offers a class imported at views_runs.ViewsRun, that wraps the to central components of a ViEWS 3 run: A partitioning scheme expressed via a views_partitioning.DataPartitioner instance, and a stepshifted modelling process expressed via a stepshift.views.StepshiftedModels instance. For documentation on the data partitioner, see views_partitioning. For documentation on stepshifted modelling, see views.StepshiftedModels.

The wrapper takes care of applying these two classes to your data, in order to produce predictions in a familiar and predictable format, as well as ensuring that there is no overlap between training and testing partitions. Instantiating a run requires instances of both of these classes, like so:

run = ViewsRun(
   DataPartitioner({"A":{"train":(1,100),"test":(101,200)}}),
   StepshiftedModels(LogisticRegression,[1,2,3,4,5,6],"my_dependent_variable"),
)

This instance can then be applied to a time-unit indexed dataframe to train the models, and produce predictions for the timespans defined in the data partitioner:

run.fit("A","train",dataframe)
predictions = run.predict("A","test",dataframe)

Examples

There are notebooks that show various workflows with views_runs and the vendored libraries:

Funding

The contents of this repository is the outcome of projects that have received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (Grant agreement No. 694640, ViEWS) and Horizon Europe (Grant agreement No. 101055176, ANTICIPATE; and No. 101069312, ViEWS (ERC-2022-POC1)), Riksbankens Jubileumsfond (Grant agreement No. M21-0002, Societies at Risk), Uppsala University, Peace Research Institute Oslo, the United Nations Economic and Social Commission for Western Asia (ViEWS-ESCWA), the United Kingdom Foreign, Commonwealth & Development Office (GSRA – Forecasting Fatalities in Armed Conflict), the Swedish Research Council (DEMSCORE), the Swedish Foundation for Strategic Environmental Research (MISTRA Geopolitics), the Norwegian MFA (Conflict Trends QZA-18/0227), and the United Nations High Commissioner for Refugees (the Sahel Predictive Analytics project).

Metadata

Release files for views-runs 1.14.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for views-runs 1.14.2
File Size Uploaded Provenance
views_runs-1.14.2.tar.gz 16.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for views-runs 1.14.2
File Interpreter ABI Platform
views_runs-1.14.2-py3-none-any.whl Python 3 none any Details

Total release size: 34.5 kB

Release files / views_runs-1.14.2.tar.gz

Download URL views_runs-1.14.2.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f2fc3ac8fc56be82bf497c834c57a058d4af09848a8211d23f12d5cc3c9b5ac9
BLAKE2b-256 checksum
How to use checksums
2e8e582763217cd92e91c646f544a642e16912ac49a9c9211904bcf6986cf3bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / views_runs-1.14.2-py3-none-any.whl

Download URL views_runs-1.14.2-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ed7cfab8f0e0d0eb23a942854bf3aa950143cab4903f41bc4c100791937e38e
BLAKE2b-256 checksum
How to use checksums
a432434e4a0f5fb829eed9ad7e87cd5bd334242925746a105544412c16133d66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Security for views-runs 1.14.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page