AntiNex Python Client
Python API Client for training deep neural networks with the REST API running
https://github.com/jay-johnson/train-ai-with-django-swagger-jwt
Install
pip install antinex-client
AntiNex Stack Status
AntiNex client is part of the AntiNex stack:
Component |
Build |
Docs Link |
Docs Build |
|---|---|---|---|
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
Run Predictions
These examples use the default user root with password 123321. It is advised to change this to your own user in the future.
Train a Deep Neural Network with a JSON List of Records
ai -u root -p 123321 -f examples/predict-rows-scaler-django-simple.json
Train a Deep Neural Network to Predict Attacks with the AntiNex Datasets
Please make sure the datasets are available to the REST API, Celery worker, and AntiNex Core worker. The datasets are already included in the docker container ai-core provided in the default compose.yml file:
If you’re running outside docker make sure to clone the repo with:
git clone https://github.com/jay-johnson/antinex-datasets.git /opt/antinex/antinex-datasets
Train the Django Defensive Deep Neural Network
Please wait as this will take a few minutes to return and convert the predictions to a pandas DataFrame.
ai -u root -p 123321 -f examples/scaler-full-django-antinex-simple.json ... [30200 rows x 72 columns]
Using Pre-trained Neural Networks to make Predictions
The AntiNex Core manages pre-trained deep neural networks in memory. These can be used with the REST API by adding the "publish_to_core": true to a request while running with the REST API compose.yml docker containers running.
Run:
ai -u root -p 123321 -f examples/publish-to-core-scaler-full-django.json
Here is the diff between requests that will run using a pre-trained model and one that will train a new neural network:
antinex-client$ diff examples/publish-to-core-scaler-full-django.json examples/scaler-full-django-antinex-simple.json 5d4 < "publish_to_core": true, antinex-client$
Prepare a Dataset
ai_prepare_dataset.py -u root -p 123321 -f examples/prepare-new-dataset.json
Get Job Record for a Deep Neural Network
Get a user’s MLJob record by setting: -i <MLJob.id>
This include the model json or model description for the Keras DNN.
ai_get_job.py -u root -p 123321 -i 4
Get Predictions Results for a Deep Neural Network
Get a user’s MLJobResult record by setting: -i <MLJobResult.id>
This includes predictions from the training or prediction job.
ai_get_results.py -u root -p 123321 -i 4
Get a Prepared Dataset
Get a user’s MLPrepare record by setting: -i <MLPrepare.id>
ai_get_prepared_dataset.py -u root -p 123321 -i 15
Using a Client Built from Environment Variables
This is how the Network Pipeline streams data to the AntiNex Core to make predictions with pre-trained models.
Export the example environment file:
source examples/example-prediction.env
Run the client prediction stream script
ai_env_predict.py -f examples/predict-rows-scaler-full-django.json
Development
virtualenv -p python3 ~/.venvs/antinexclient && source ~/.venvs/antinexclient/bin/activate && pip install -e .
Testing
Run all
python setup.py test
Linting
flake8 .
pycodestyle .
License
Apache 2.0 - Please refer to the LICENSE for more details
Metadata
Release files for antinex-client 1.3.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| antinex-client-1.3.6.tar.gz | 21.5 kB | Without provenance | Details for antinex-client-1.3.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| antinex_client-1.3.6-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for antinex_client-1.3.6-py2.py3-none-any.whl |
Total release size: 67.5 kB
Release files / antinex-client-1.3.6.tar.gz
| Download URL | antinex-client-1.3.6.tar.gz |
|---|---|
| Size | 21.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
543f1d8f14f83199d72164f4915a0ce8df764085557b6246ca04ff69db2da0f6
|
|
BLAKE2b-256 checksum How to use checksums |
4b98be2e5be6dbe8753ca7a3c7b69a3303d3642cca6da45256d98e2e9ede8add
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.0
|
Release files / antinex_client-1.3.6-py2.py3-none-any.whl
| Download URL | antinex_client-1.3.6-py2.py3-none-any.whl |
|---|---|
| Size | 46.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
22484799b030e3f4ca93d7c66ea396c06461965082eb4541f84eeea11cf2b4b6
|
|
BLAKE2b-256 checksum How to use checksums |
c152d5a04adbc48b8f50b7f1da02190e7a2e8a552015646b6e1780bdabc0b0d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.0
|
Security for antinex-client 1.3.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.