Skip to main content

A probabalistic programming ML tool for science

Project description

pylace

Python bindings to lace

Install

Install latest from PyPI

$ python3 -m pip install pylace

Install latest from GitHub

Building from source requires the Rust compiler (git it here).

$ python3 -m pip install git+https://git@github.com/promised-ai/lace.git#egg=pylace&subdirectory=pylace

Use

Note that the engine currently only supports loading from an existing metadata file. The following lace functions are supported:

  • rowsim
  • depprob
  • predict
  • logp
  • simulate
  • append_rows
  • update
import polars as pl
import lace

# The required files can be found here: https://github.com/promised-ai/lace/tree/master/pylace/lace/resources/datasets/satellites
df = pl.read_csv("./data.csv")
engine = lace.Engine.from_df(df, codebook="codebook.yaml")

# Train the model for 10_000 steps
engine.update(10_000)

# Predict the orbit's class based on the orbit's period.
engine.predict('Class_of_Orbit', given={'Period_minutes': 1436.0})
# ('GEO', 0.13583714831550336)

Tests

To run tests, use pytest

$ pytest -x

To run doctets:

$ python tests/test_docs.py

To prevent plotly from displaying

$ LACE_DOCTEST_NOPLOT=1 python tests/test_docs.py

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pylace-0.7.1-cp312-none-win_amd64.whl (4.6 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

pylace-0.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pylace-0.7.1-cp312-cp312-macosx_11_0_arm64.whl (4.6 MB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pylace-0.7.1-cp312-cp312-macosx_10_7_x86_64.whl (5.0 MB view hashes)

Uploaded CPython 3.12 macOS 10.7+ x86-64

pylace-0.7.1-cp311-none-win_amd64.whl (4.6 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

pylace-0.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pylace-0.7.1-cp311-cp311-macosx_11_0_arm64.whl (4.6 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pylace-0.7.1-cp311-cp311-macosx_10_7_x86_64.whl (5.0 MB view hashes)

Uploaded CPython 3.11 macOS 10.7+ x86-64

pylace-0.7.1-cp310-none-win_amd64.whl (4.6 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

pylace-0.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pylace-0.7.1-cp310-cp310-macosx_11_0_arm64.whl (4.6 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pylace-0.7.1-cp310-cp310-macosx_10_7_x86_64.whl (5.0 MB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

pylace-0.7.1-cp39-none-win_amd64.whl (4.6 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

pylace-0.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pylace-0.7.1-cp39-cp39-macosx_11_0_arm64.whl (4.6 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylace-0.7.1-cp39-cp39-macosx_10_7_x86_64.whl (5.0 MB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

pylace-0.7.1-cp38-none-win_amd64.whl (4.6 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

pylace-0.7.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pylace-0.7.1-cp38-cp38-macosx_11_0_arm64.whl (4.6 MB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylace-0.7.1-cp38-cp38-macosx_10_7_x86_64.whl (5.0 MB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

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