Skip to main content

A tool to facilitate standard and adaptive sampling.

Project description

Trata Sampling Methods Package

Trata offers a large number of general sampling strategies that can be used to explore parameter spaces or improve a model's predictive ability.

Trata contains 4 modules:

  • composite_samples
  • kosh_sampler
  • sampler
  • adaptive_sampler

composite_samples

The composite_samples module enables a user to parse a tab or csv file and create a "variable", or parameter, class object that represents discrete discrete-ordered, or continuous samples. The parse_file function returns a Samples object containing the points from the file. Other file types would need to be parsed with a custom function.

kosh_sampler

The kosh_samples module allows a user to easily interact with data from a Sina catalog. Based on the Kosh datasets and trained model, the adaptive sampling methods below will choose the next best samples for the model.

  • Delta
  • ExpectedImprovement
  • LearningExpectedImprovement

To learn more about Kosh, please visit their GitHub.

sampler

The sampler module enables a user to select the type of sampling method they would like to perform across a design parameter space. The available options include:

  • CartesianCross
  • Centered
  • Corner
  • Dakota
  • DefaultValue
  • Face
  • LatinHyperCube
  • MonteCarlo
  • MultiNormal
  • OneAtATime
  • ProbabilityDensityFunction
  • QuasiRandomNumber
  • Rejection
  • SamplePoint
  • Uniform
  • UserValue

adaptive_sampler

The number of samples required to build an accurate surrogate model is a posteriori knowledge determined by the complexity of the approximated input-output relation. Therefore enriching the training dataset as training progresses is performed and is known as active learning.

The adaptive_sampler module allows a user to specify learning functions to help identify the next sample with the highest information value. Those learning functions are designed to allocate samples to regions where the surrogate model is thought to be inaccurate or uncertain, or the regions where particularly interesting combinations of design parameters lie, such as the region that possibly contains the globally optimum values of the design parameters. The available options include:

  • ActiveLearning
  • Delta
  • ExpectedImprovement
  • LearningExpectedImprovement

Getting Started

To get the latest public version:

pip install trata

To get the latest stable from a cloned repo, simply run:

pip install .

Alternatively, add the path to this repo to your PYTHONPATH environment variable or in your code with:

import sys
sys.path.append(path_to_trata_repo)

Documentation

The Trata documentation.

The documentation can be built from the docs directory using:

make html

Contact Info

Trata maintainer can be reached at: olson59@llnl.gov

Contributing

Contributing to Trata is relatively easy. Just send us a pull request. When you send your request, make develop the destination branch on the Trata repository.

Your PR must pass Trata's unit tests and documentation tests, and must be PEP 8 compliant. We enforce these guidelines with our CI process. To run these tests locally, and for helpful tips on git, see our Contribution Guide.

Trata's develop branch has the latest contributions. Pull requests should target develop, and users who want the latest package versions, features, etc. can use develop.

Contributions should be submitted as a pull request pointing to the develop branch, and must pass Trata's CI process; to run the same checks locally, use:

pytest tests/test_*.py

Releases

See our change log for more details.

Code of Conduct

Please note that Trata has a Code of Conduct. By participating in the Trata community, you agree to abide by its rules.

License

Trata is distributed under the terms of the MIT license. All new contributions must be made under the MIT license. See LICENSE and NOTICE for details.

LLNL-CODE-838977

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

trata-1.1.0.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

trata-1.1.0-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file trata-1.1.0.tar.gz.

File metadata

  • Download URL: trata-1.1.0.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.16

File hashes

Hashes for trata-1.1.0.tar.gz
Algorithm Hash digest
SHA256 2cf6d63bbd848c9bf60b92f9e2d892e57a61b5b77ff9922ca950d88082e1d28b
MD5 2996a3ccdf352420f22b41d3f4fac88c
BLAKE2b-256 cba3e22c0ab71aa16db54115d595837d36dadc31a4f891de63badb2bf16b0a1b

See more details on using hashes here.

File details

Details for the file trata-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: trata-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.16

File hashes

Hashes for trata-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e2c0876f0ca260583ea5a84cab33046bfd86e5bb2cc8f11187e2d5dfc6af34e
MD5 6f074c251f89da03bbef7231125b61e7
BLAKE2b-256 f3be916d1dc95b3d5717f52bcd35245ec518324b6d7752e36ed0832ce3d6f900

See more details on using hashes here.

Supported by

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