Skip to main content

The client for persisting and deploying models to Xplainable cloud.

Project description

xplainable

Real-time explainable machine learning for business optimisation

Xplainable makes tabular machine learning transparent, fair, and actionable.

Why Was Xplainable Created?

In machine learning, there has long been a trade-off between accuracy and explainability. This drawback has led to the creation of explainable ML libraries such as Shap and Lime which make estimations of model decision processes. These can be incredibly time-expensive and often present steep learning curves making them challenging to implement effectively in production environments.

To solve this problem, we created xplainable. xplainable presents a suite of novel machine learning algorithms specifically designed to match the performance of popular black box models like XGBoost and LightGBM while providing complete transparency, all in real-time.

Xplainable Cloud

This Python package is free and open-source. To add more value to data teams within organisations, we also created Xplainable Cloud that brings your models to a collaborative environment.

Preprocessing with Xplainable Cloud

Before modeling, it's essential to preprocess your data. Xplainable Cloud facilitates this process by allowing you to create and manage preprocessors in the cloud.

import xplainable as xp
import os
from xplainable_client import Client

#Initialising the client
XClient = Client(api_key=os.environ['XP_API_KEY'])

#Creating a Preprocessor ID
preprocessor_id = XClient.create_preprocessor_id(
    preprocessor_name="Preprocessor Name",
    preprocessor_description="Preprocessor Description",
)

#Creating a Preprocessor Version
preprocessor_version = XClient.create_preprocessor_version(
    preprocessor_id, #preprocessor_id,
    pipeline, # <-- Pass the pipeline
    df # <-- Pass the raw dataframe
)

#Loading the Preprocessor Client
pp_cloud = XClient.load_preprocessor(
    preprocessor_id,
    preprocessor_version["version_id"],
    gui_object=False # Set to true to load the GUI object, keep as False for pipeline
    )

Modelling with Xplainable Cloud

After preprocessing, the next step is to create and train your model. Xplainable Cloud supports model versioning and ID creation to streamline this process.

#Creating a Model Id
model_id = XClient.create_model_id(
    model,
    model_name="Model Name",
    model_description='Model Description'
)

#Creating a Model Version
version_id = XClient.create_model_version(
    model,
    model_id,
    X_train,
    y_train
)

Deployments with Xplainable Cloud

Once your model is ready, deploying it is straightforward with Xplainable Cloud. You can deploy, activate, and manage API keys for your model deployment keys within your IDE or environment.

#Creating a Model Deployment
deployment = XClient.deploy(
    hostname="https://inference.xplainable.io", 
    model_id=model_id, 
    version_id=version_id 
)

#Activating the Deployment
XClient.activate_deployment(deployment['deployment_id'])

#Generating an API Key
deploy_key = XClient.generate_deploy_key(
    'API Key Name', 
    deployment['deployment_id'], 
    7 #-> Days until expiration
    )

#Hitting the endpoint
response = requests.post(
    url="https://inference.xplainable.io/v1/predict",
    headers={'api_key': deploy_key['deploy_key']},
    json=body
)

#Obtaining the value response
value = response.json()




Thanks for trying xplainable!

Made with ❤️ in Australia


© copyright xplainable pty ltd

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

xplainable-client-1.2.4.tar.gz (57.7 kB view details)

Uploaded Source

Built Distribution

xplainable_client-1.2.4-py3-none-any.whl (51.0 kB view details)

Uploaded Python 3

File details

Details for the file xplainable-client-1.2.4.tar.gz.

File metadata

  • Download URL: xplainable-client-1.2.4.tar.gz
  • Upload date:
  • Size: 57.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.7

File hashes

Hashes for xplainable-client-1.2.4.tar.gz
Algorithm Hash digest
SHA256 7d56a855cc8029fc19215f2e3ff0aecd5dee79efaafef1572dc95666732a579f
MD5 8007221a3dc6e8b047aafa1beef503c4
BLAKE2b-256 8009db1f94701e19018758525bca122015e880b4fba6d954762c48a588d2a2f9

See more details on using hashes here.

File details

Details for the file xplainable_client-1.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for xplainable_client-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ae5c074f03a8f4f8923d517ac3773e8e25a8b58aa9ebcbcfae94516c63630345
MD5 d12850cd820e7fc6324ce285fc8e6e1a
BLAKE2b-256 23e424c3b4debaf6ffeeeb6fe7e013308c3c9976ca828e31fa8b3205c534e177

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