- Notifications
You must be signed in to change notification settings - Fork5
Real-time explainable machine learning for business optimisation
License
xplainable/xplainable
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
In machine learning, there has long been a trade-off between accuracy andexplainability. This drawback has led to the creation of explainable MLlibraries such asShap andLime which make estimations of model decision processes. These can be incredibly time-expensive and often present steeplearning curves making them challenging to implement effectively in productionenvironments.
To solve this problem, we createdxplainable.xplainable presents asuite of novel machine learning algorithms specifically designed to match theperformance of popular black box models likeXGBoost andLightGBM whileproviding complete transparency, all in real-time.
You can interface with xplainable either through a typical Pythonic API, orusing a notebook-embedded GUI in your Jupyter Notebook.
Xplainable has each of the fundamental tabular models used in data scienceteams. They are fast, accurate, and easy to use.
| Model | Python API | Jupyter GUI |
|---|---|---|
| Regression | ✅ | ✅ |
| Binary Classification | ✅ | ✅ |
| Multi-Class Classification | ✅ | 🔜 |
You can install the core features ofxplainable with:
pip install xplainableto use thexplainable gui in a jupyter notebook, install with:
pip install xplainable[gui]- Visit ourGeneral Documentation to learn how to get the best out of xplainable
- Vist ourAPI Documentation for additional support with using our API
Basic Example
importxplainableasxpfromxplainable.core.modelsimportXClassifierimportpandasaspdfromsklearn.model_selectionimporttrain_test_split# Load datadata=xp.load_dataset('titanic')X,y=data.drop(columns=['Survived']),data['Survived']X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.25,random_state=42)# Train a modelmodel=XClassifier()model.fit(X_train,y_train)# Explain the modelmodel.explain()
Xplainable helps to streamline development processes by making model tuningand deployment simpler than you can imagine.
We built a comprehensive suite of preprocessing transformers for rapid andreproducible data preprocessing.
| Feature | Python API | Jupyter GUI |
|---|---|---|
| Data Health Checks | ✅ | ✅ |
| Transformers Library | ✅ | ✅ |
| Preprocessing Pipelines | ✅ | ✅ |
| Pipeline Persistance | ✅ | ✅ |
fromxplainable.preprocessing.pipelineimportXPipelinefromxplainable.preprocessingimporttransformersasxtfpipeline=XPipeline()# Add stages for specific featurespipeline.add_stages([ {"feature":"age","transformer":xtf.Clip(lower=18,upper=99)}, {"feature":"balance","transformer":xtf.LogTransform()}])# add stages on multiple featurespipeline.add_stages([ {"transformer":xtf.FillMissing({'job':'mode','age':'mean'})}, {"transformer":xtf.DropCols(columns=['duration','campaign'])}])# Fit and transform the datatrain_transformed=pipeline.fit_transform(train)# Apply transformations on new datatest_transformed=pipeline.transform(test)
pp=xp.Preprocessor()pp.preprocess(train)
Xplainable models can be developed, optimised, and re-optimised using PythonicAPIs or the embedded GUI.
| Feature | Python API | Jupyter GUI |
|---|---|---|
| Classic Vanilla Data Science APIs | ✅ | - |
| AutoML | ✅ | ✅ |
| Hyperparameter Optimisation | ✅ | ✅ |
| Partitioned Models | ✅ | ✅ |
| Rapid Refitting (novel to xplainable) | ✅ | ✅ |
| Model Persistance | ✅ | ✅ |
importxplainableasxpfromxplainable.core.modelsimportXClassifierfromxplainable.core.optimisation.bayesianimportXParamOptimiserfromsklearn.model_selectionimporttrain_test_splitimportpandasaspd# Load your datadata=xp.load_dataset('titanic')# note: the data requires preprocessing, so results may be poorX,y=data.drop('Survived',axis=1),data['Survived']X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.2)# Optimise paramsopt=XParamOptimiser(metric='roc-auc')params=opt.optimise(X_train,y_train)# Train your modelmodel=XClassifier(**params)model.fit(X_train,y_train)# Predict on the test sety_pred=model.predict(X_test)# Explain the modelmodel.explain()
model=xp.classifier(train)
Fine tune your models by refitting model parameters on the fly, even onindividual features.
new_params= {"features": ['Age'],"max_depth":6,"min_info_gain":0.01,"min_leaf_size":0.03,"weight":0.05,"power_degree":1,"sigmoid_exponent":1,"x":X_train,"y":y_train}model.update_feature_params(**new_params)
Models are explainable and real-time, right out of the box, without having to fitsurrogate models such asShap orLime.
| Feature | Python API | Jupyter GUI |
|---|---|---|
| Global Explainers | ✅ | ✅ |
| Regional Explainers | ✅ | ✅ |
| Local Explainers | ✅ | ✅ |
| Real-time Explainability | ✅ | ✅ |
model.explain()
We leverage the explainability of our models to provide real-timerecommendations on how to optimise predicted outcomes at a local and globallevel.
| Feature | |
|---|---|
| Automated Local Prediction Optimisation | ✅ |
| Automated Global Decision Optimisation | 🔜 |
Xplainable brings transparency to API deployments, and it's easy. By the timeyour finger leaves the mouse, your model is on a secure server and ready to go.
| Feature | Python API | Xplainable Cloud |
|---|---|---|
| < 1 Second API Deployments | ✅ | ✅ |
| Explainability-Enabled API Deployments | ✅ | ✅ |
| A/B Testing | - | 🔜 |
| Champion Challenger Models (MAB) | - | 🔜 |
We promote fair and ethical use of technology for all machine learning tasks.To help encourage this, we're working on additional bias detection and fairnesstesting classes to ensure that everything you deploy is safe, fair, andcompliant.
| Feature | Python API | Xplainable Cloud |
|---|---|---|
| Bias Identification | ✅ | ✅ |
| Automated Bias Detection | 🔜 | 🔜 |
| Fairness Testing | 🔜 | 🔜 |
This Python package is free and open-source. To add more value to data teamswithin organisations, we also created Xplainable Cloud that brings your modelsto a collaborative environment.
importxplainableasxpimportosxp.initialise(api_key=os.environ['XP_API_KEY'])
We'd love to welcome contributors to xplainable to keep driving forward moretransparent and actionable machine learning. We're working on our contributordocs at the moment, but if you're interested in contributing, please send us amessage atcontact@xplainable.io.
Thanks for trying xplainable!
Made with ❤️ in Australia
© copyright xplainable pty ltd
About
Real-time explainable machine learning for business optimisation
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.





