Skip to main content

Tangram for Python

Project description

Tangram for Python

The Tangram Python package makes it easy to make predictions with your Tangram machine learning model from Python.

Usage

$ pip install tangram
import tangram

model = tangram.Model.from_path('./heart_disease.tangram')

input = {
  'age': 63,
  'gender': 'male',
  # ...
}

output = model.predict(input)

For more information, read the docs.

Platform Support

Tangram for Python is currently supported on Linux, macOS, and Windows with AMD64 CPUs. Are you interested in another platform? Open an issue or send us an email at help@tangram.xyz.

Examples

The source for this package contains two examples, examples/basic.py and examples/advanced.py.

Basic

The basic example demonstrates loading a model from a .tangram file and making a prediction.

To run the example:

$ python3 examples/basic.py

Advanced

The advanced example demonstrates logging predictions and true values to the Tangram app. Before running the example, run tangram app to start the app running locally, open http://localhost:8080 in your browser, and upload the file examples/heart_disease.tangram to it.

To run the example:

$ TANGRAM_URL=http://localhost:8080 python3 examples/advanced.py

Now if you refresh the production stats or production metrics tabs for the model you uploaded, you should see predictions and true values.

For more information, read the docs.

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

tangram-0.4.0-cp36-abi3-win_amd64.whl (1.9 MB view hashes)

Uploaded CPython 3.6+ Windows x86-64

tangram-0.4.0-cp36-abi3-manylinux_2_24_x86_64.whl (2.6 MB view hashes)

Uploaded CPython 3.6+ manylinux: glibc 2.24+ x86-64

tangram-0.4.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl (2.5 MB view hashes)

Uploaded CPython 3.6+ manylinux: glibc 2.17+ ARM64 manylinux: glibc 2.24+ ARM64

tangram-0.4.0-cp36-abi3-macosx_11_0_universal2.whl (4.3 MB view hashes)

Uploaded CPython 3.6+ macOS 11.0+ universal2 (ARM64, 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