Skip to main content

Tools for doing model runs with views

Project description

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:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

views_runs-1.12.3.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

views_runs-1.12.3-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file views_runs-1.12.3.tar.gz.

File metadata

  • Download URL: views_runs-1.12.3.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for views_runs-1.12.3.tar.gz
Algorithm Hash digest
SHA256 f7ad66b684cc2496f35950e0661a9d4d5abffe0dd813c1aa703b68a3a19fc830
MD5 c18f8ba8b384051b2941af9c8594d130
BLAKE2b-256 64333e43e0910db9ebbd59a157f14604d1a0ee3382fe5bcc0422e1468ea85fcb

See more details on using hashes here.

File details

Details for the file views_runs-1.12.3-py3-none-any.whl.

File metadata

  • Download URL: views_runs-1.12.3-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for views_runs-1.12.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0b5a0f781802148269adebb6e9ea7d571e569fee6bab6376d0283f6c347af014
MD5 066ba9fd6f896eb7624b5a50a8f1f3ee
BLAKE2b-256 9611abc6fcc0a0b1fc0bbed2d5b5978c3d09adcaaaf4903f232e638fb5bbf409

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page