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.client import Client

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

# Creating a Preprocessor (creates both ID and version)
preprocessor_id, version_id = client.preprocessing.create_preprocessor(
    preprocessor_name="Preprocessor Name",
    preprocessor_description="Preprocessor Description",
    pipeline=pipeline,  # <-- Pass the pipeline
    df=df  # <-- Pass the raw dataframe
)

# Loading the Preprocessor Client
pp_cloud = client.preprocessing.load_preprocessor(
    preprocessor_id,
    version_id,
)

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 (creates both ID and version)
model_id, version_id = client.models.create_model(
    model=model,
    model_name="Model Name",
    model_description='Model Description',
    x=X_train,
    y=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 = client.deployments.deploy(model_version_id=version_id)

# Activating the Deployment
client.deployments.activate_deployment(deployment.deployment_id)

# Generating an API Key
deploy_key = client.deployments.create_deployment_key(
    deployment_id=deployment.deployment_id,
    description='API Key Name',
    expiry_days=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()

Release Process

The xplainable-client uses automated release scripts to streamline version management and integrate with the Xplainable MCP Server.

Creating a New Release

Use the automated release scripts in the scripts/ directory:

# Quick patch release (1.2.3 → 1.2.4)
./scripts/release.sh --increment patch

# Minor release with new features (1.2.3 → 1.3.0)
./scripts/release.sh --increment minor

# Major release with breaking changes (1.2.3 → 2.0.0)
./scripts/release.sh --increment major

# Specific version
./scripts/release.sh --version 1.5.0

# Test what would happen (dry run)
./scripts/release.sh --increment patch --dry-run

What Happens During a Release

  1. Validation: Checks git repository state and current version
  2. Cleanup: Removes build artifacts (build/, dist/, *.egg-info/)
  3. Version Update: Updates version in pyproject.toml and other files
  4. Git Operations: Commits changes, creates tag, and pushes to GitHub
  5. Package Build: Creates wheel and source distributions in dist/
  6. PyPI Publish: Uploads to PyPI (if --publish flag used)
  7. GitHub Release: Creates release with changelog (if GitHub CLI available)
  8. 🤖 MCP Server Sync: Automatically triggers MCP server update workflow

When you create a release, the GitHub Actions workflow will automatically:

  • Install the new client version
  • Scan for @mcp_tool() decorated methods
  • Generate updated MCP server tools
  • Create a pull request in the MCP server repository

See scripts/README.md for detailed documentation and troubleshooting.





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.3.2.tar.gz (72.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xplainable_client-1.3.2-py3-none-any.whl (71.2 kB view details)

Uploaded Python 3

File details

Details for the file xplainable_client-1.3.2.tar.gz.

File metadata

  • Download URL: xplainable_client-1.3.2.tar.gz
  • Upload date:
  • Size: 72.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.7

File hashes

Hashes for xplainable_client-1.3.2.tar.gz
Algorithm Hash digest
SHA256 ab23ec8f42f8d4601c0a3b5dd1b3208f2fc6109e53237421b3a50c278ef79849
MD5 fc43983992ea069dd325a52865fff9f9
BLAKE2b-256 f07c13727b5da0f0c05864334f71f9f77f9d874d0e225d0c63ac112538966a66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xplainable_client-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1a87f7310d1827059ff0d9df5c35d6707d079b076b714ee1e44eb3eb32fe72e3
MD5 2900d2ec9b0fe5ae4dd15fe44acb0434
BLAKE2b-256 068f6e4591b2d76d36cadb09e7ac4e56366f963aaf6f3f289435b061b9f6c4fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page