Skip to main content
Version: Next

Installation

Quick Start​

The fastest way to get started with xplainable is through PyPI:

1pip install xplainable
Installation Complete!

That's it! You now have the core xplainable package installed and ready to use for transparent machine learning.

Installation Options​

Core Package​

The core package includes all essential features for transparent machine learning:

1pip install xplainable

Includes:

  • XClassifier and XRegressor models
  • Partitioned models (PartitionedClassifier, PartitionedRegressor)
  • Bayesian hyperparameter optimization (XParamOptimiser)
  • Model explainability

Preprocessing​

For data preprocessing pipelines and transformers, install the separate preprocessing package:

1pip install xplainable-preprocessing

Features:

  • Preprocessing pipeline (XPipeline)
  • Built-in transformers for data transformation
  • Pipeline persistence and reusability

Advanced Plotting​

For enhanced visualization capabilities:

1pip install xplainable[plotting]

Additional features:

  • Advanced Altair-based visualizations
  • Custom plot themes and styling
  • Interactive explanation plots
  • Enhanced model inspection tools

Cloud Integration​

For cloud deployment and collaboration features:

1pip install xplainable-client
Cloud Package

The cloud client is a separate package that provides integration with Xplainable Cloud for model deployment, collaboration, and production management.

Cloud features:

  • Model deployment and management
  • Team collaboration
  • Model versioning
  • Production monitoring
  • Secure API deployments

Complete Installation​

For all features, install all packages:

1pip install xplainable[plotting]
2pip install xplainable-preprocessing
3pip install xplainable-client

Environment Setup​

Python Version

Python 3.8+ -- Python 3.8 or later is required.

Environment

Virtual Environment -- Always use virtual environments to avoid package conflicts.

Setting Up Virtual Environment​

1# Create virtual environment
2python -m venv xplainable-env
3
4# Activate environment
5# On Windows:
6xplainable-env\Scripts\activate
7# On macOS/Linux:
8source xplainable-env/bin/activate
9
10# Install xplainable
11pip install xplainable[plotting]
12pip install xplainable-preprocessing
13pip install xplainable-client

Using conda​

1# Create conda environment
2conda create -n xplainable-env python=3.8
3
4# Activate environment
5conda activate xplainable-env
6
7# Install xplainable
8pip install xplainable[plotting]
9pip install xplainable-preprocessing
10pip install xplainable-client

Jupyter Notebook Setup​

Installation​

If you don't have Jupyter installed:

1pip install jupyter

JupyterLab Setup​

For JupyterLab users:

1pip install jupyterlab

Known Issues & Solutions​

Import Errors​

If you encounter import errors:

1# Upgrade pip and reinstall
2pip install --upgrade pip
3pip install --force-reinstall xplainable

Verification​

Test Core Installation​

1import xplainable as xp
2print(f"Xplainable version: {xp.__version__}")
3
4# Test basic functionality
5from xplainable.core.models import XClassifier
6model = XClassifier()
7print("Core installation successful!")

Test Cloud Client​

1try:
2 from xplainable_client import Client
3 print("Cloud client installation successful!")
4except ImportError as e:
5 print(f"Cloud client not installed: {e}")
6 print("Install with: pip install xplainable-client")

Docker Setup​

For containerized environments:

1FROM python:3.8-slim
2
3# Install system dependencies
4RUN apt-get update && apt-get install -y \
5 build-essential \
6 && rm -rf /var/lib/apt/lists/*
7
8# Install xplainable
9RUN pip install xplainable[plotting] xplainable-preprocessing xplainable-client
10
11# Set working directory
12WORKDIR /app
13
14# Copy your code
15COPY . .
16
17# Expose Jupyter port
18EXPOSE 8888
19
20# Start Jupyter
21CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]

Troubleshooting​

Common Issues​

ModuleNotFoundError: No module named 'xplainable'

Solution:

  • Check that you're in the correct virtual environment
  • Reinstall: pip install xplainable
  • Verify installation: pip list | grep xplainable
Cloud client import errors

Solution:

  • Install cloud client: pip install xplainable-client
  • Check that both packages are in the same environment
  • Verify installation: pip list | grep xplainable

Next Steps​

Ready to Build?

Now that you have xplainable installed, check out our Python API documentation or jump straight into our tutorials for hands-on examples.

Quick Start Example​

1import pandas as pd
2from xplainable.core.models import XClassifier
3from sklearn.model_selection import train_test_split
4
5# Load your data
6data = pd.read_csv('data.csv')
7X, y = data.drop('target', axis=1), data['target']
8X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
9
10# Train a transparent model
11model = XClassifier()
12model.fit(X_train, y_train)
13
14# Get explanations
15model.explain()

Cloud Integration Example​

1from xplainable_client import Client
2import os
3
4# Initialize cloud client
5client = Client(api_key=os.environ['XP_API_KEY'])
6
7# Create model in the cloud
8result = client.models.create_model(
9 model=model,
10 model_name="My First Model",
11 model_description="Transparent classification model",
12 x=X_train,
13 y=y_train
14)

Support​

Need help with installation?

  • Documentation: Check our comprehensive guides
  • Community: Join our user community
  • Issues: Report bugs on GitHub
  • Enterprise: Contact us for enterprise support