Skip to content

Latest commit

 

History

History
99 lines (70 loc) · 1.78 KB

File metadata and controls

99 lines (70 loc) · 1.78 KB

Getting Started with WhiteBoxAI SDK

Installation

Install the WhiteBoxAI SDK using pip:

pip install whiteboxai-sdk

Optional Dependencies

Install with specific framework support:

# Scikit-learn support
pip install whiteboxai-sdk[sklearn]

# PyTorch support
pip install whiteboxai-sdk[pytorch]

# TensorFlow support
pip install whiteboxai-sdk[tensorflow]

# All integrations
pip install whiteboxai-sdk[all]

Quick Start

1. Initialize the Client

from whiteboxai import WhiteBoxAI

client = WhiteBoxAI(api_key="your-api-key")

You can also set the API key via environment variable:

export EXPLAINAI_API_KEY=your-api-key

2. Create a Monitor

from whiteboxai import ModelMonitor

monitor = ModelMonitor(client)

3. Register Your Model

model_id = monitor.register_model(
    name="my_model",
    model_type="classification",
    framework="sklearn"
)

4. Log Predictions

monitor.log_prediction(
    inputs={"feature1": 1.0, "feature2": 2.0},
    output={"prediction": 1, "probability": 0.85}
)

Next Steps

Configuration

Configure the client with various options:

client = WhiteBoxAI(
    api_key="your-api-key",
    base_url="https://api.whiteboxai.io",
    timeout=30,
    max_retries=3,
    enable_caching=True,
    enable_privacy_filters=True,
    enable_offline=True
)

Support

For help and support: