Package: xplainable
xplainableReal-time explainable machine learning for business optimisationXplainablemakes 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 asShapandLimewhich 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 createdxplainable.xplainablepresents a
suite of novel machine learning algorithms specifically designed to match the
performance of popular black box models likeXGBoostandLightGBMwhile
providing complete transparency, all in real-time.Simple InterfaceYou can interface with xplainable either through a typical Pythonic API, or
using a notebook-embedded GUI in your Jupyter Notebook.ModelsXplainable has each of the fundamental tabular models used in data science
teams. They are fast, accurate, and easy to use.ModelPython APIJupyter GUIRegression✅✅Binary Classification✅✅Multi-Class Classification✅🔜InstallationYou can install the core features ofxplainablewith:pip install xplainableto use thexplainablegui in a jupyter notebook, install with:pip install xplainable[gui]Vist ourDocumentationfor additional
support.Getting StartedBasic Exampleimportxplainableasxpfromxplainable.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()FeaturesXplainable helps to streamline development processes by making model tuning
and deployment simpler than you can imagine.PreprocessingWe built a comprehensive suite of preprocessing transformers for rapid and
reproducible data preprocessing.FeaturePython APIJupyter GUIData Health Checks✅✅Transformers Library✅✅Preprocessing Pipelines✅✅Pipeline Persistance✅✅Using the APIfromxplainable.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)Using the GUIpp=xp.Preprocessor()pp.preprocess(train)ModellingXplainable models can be developed, optimised, and re-optimised using Pythonic
APIs or the embedded GUI.FeaturePython APIJupyter GUIClassic Vanilla Data Science APIs✅-AutoML✅✅Hyperparameter Optimisation✅✅Partitioned Models✅✅Rapid Refitting(novel to xplainable)✅✅Model Persistance✅✅Using the APIimportxplainableasxpfromxplainable.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()Using the GUImodel=xp.classifier(train)Rapid RefittingFine tune your models by refitting model parameters on the fly, even on
individual features.Using the APInew_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)Using the GUIExplainabilityModels are explainable and real-time, right out of the box, without having to fit
surrogate models such asShaporLime.FeaturePython APIJupyter GUIGlobal Explainers✅✅Regional Explainers✅✅Local Explainers✅✅Real-time Explainability✅✅model.explain()Action & OptimisationWe leverage the explainability of our models to provide real-time
recommendations on how to optimise predicted outcomes at a local and global
level.FeatureAutomated Local Prediction Optimisation✅Automated Global Decision Optimisation🔜DeploymentXplainable brings transparency to API deployments, and it's easy. By the time
your finger leaves the mouse, your model is on a secure server and ready to go.FeaturePython APIXplainable Cloud< 1 Second API Deployments✅✅Explainability-Enabled API Deployments✅✅A/B Testing-🔜Champion Challenger Models (MAB)-🔜#FairMLWe promote fair and ethical use of technology for all machine learning tasks.
To help encourage this, we're working on additional bias detection and fairness
testing classes to ensure that everything you deploy is safe, fair, and
compliant.FeaturePython APIXplainable CloudBias Identification✅✅Automated Bias Detection🔜🔜Fairness Testing🔜🔜Xplainable CloudThis 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.importxplainableasxpimportosxp.initialise(api_key=os.environ['XP_API_KEY'])ContributorsWe'd love to welcome contributors to xplainable to keep driving forward more
transparent and actionable machine learning. We're working on our contributor
docs at the moment, but if you're interested in contributing, please send us a
message atcontact@xplainable.io.Thanks for trying xplainable!Made with ❤️ in Australia© copyright xplainable pty ltd