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_file('./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
Built Distributions
Hashes for tangram-0.3.0-cp36-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64c7116d1f0a84ed9f78b40abce45bc7b2d2c9cef8d61241465a7676ab6059e3 |
|
MD5 | e7f306f9ea92165144413eb7870ad8ab |
|
BLAKE2b-256 | e6960c96d49bac26a9ab23b0c0dcc009d5440431f072f29f5bc247eae341a21c |
Hashes for tangram-0.3.0-cp36-abi3-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7821c1bb92eaf3be1216bf0a71cef54b0f5a117bfaf0149d2355f1e1cde74d30 |
|
MD5 | 176fe48321b54537bc28ecf04f9d849a |
|
BLAKE2b-256 | 6afbbb4e9157b18f4dddd4f856d5ca020fbbe94bb0b65d9c61ffb62e819783b2 |
Hashes for tangram-0.3.0-cp36-abi3-macosx_11_0_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e0e1795fd818929fa1fb3faa56f33332ce64a9f30b1fd6961b49caca0643741 |
|
MD5 | da19185b6590e26799c0680f5b00c645 |
|
BLAKE2b-256 | 503c40d57a1a719f231710fbb624eb196de2f7393010e30328e8565358b8102d |