{"id":49933558,"url":"https://github.com/xplainable/xplainable","last_synced_at":"2026-05-17T05:01:21.843Z","repository":{"id":171668616,"uuid":"540210377","full_name":"xplainable/xplainable","owner":"xplainable","description":"Real-time explainable machine learning for business optimisation","archived":false,"fork":false,"pushed_at":"2026-05-13T22:35:11.000Z","size":32956,"stargazers_count":64,"open_issues_count":19,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-05-13T22:37:13.224Z","etag":null,"topics":["auto-ml","data-analytics","data-science","explainable-ai","explainable-ml","machine-learning","machine-learning-algorithms","prediction","predictions","python","shap","statistics","xai","xplainable"],"latest_commit_sha":null,"homepage":"https://www.xplainable.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xplainable.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-22T23:49:20.000Z","updated_at":"2026-05-13T22:24:26.000Z","dependencies_parsed_at":"2023-09-25T04:21:23.024Z","dependency_job_id":"c45d0f3f-b776-40a4-b178-6f29f691c7c6","html_url":"https://github.com/xplainable/xplainable","commit_stats":null,"previous_names":["xplainable/xplainable"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/xplainable/xplainable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xplainable%2Fxplainable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xplainable%2Fxplainable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xplainable%2Fxplainable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xplainable%2Fxplainable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xplainable","download_url":"https://codeload.github.com/xplainable/xplainable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xplainable%2Fxplainable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33128022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"online","status_checked_at":"2026-05-17T02:00:05.366Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auto-ml","data-analytics","data-science","explainable-ai","explainable-ml","machine-learning","machine-learning-algorithms","prediction","predictions","python","shap","statistics","xai","xplainable"],"created_at":"2026-05-17T05:01:05.158Z","updated_at":"2026-05-17T05:01:21.833Z","avatar_url":"https://github.com/xplainable.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![Contributors](https://img.shields.io/badge/Contributors-3-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/xplainable/xplainable/main/docs/assets/logo/xplainable-logo.png\"\u003e\n\u003ch1 align=\"center\"\u003explainable\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eReal-time explainable machine learning for business optimisation\u003c/h3\u003e\n\n[![Python](https://img.shields.io/pypi/pyversions/xplainable)](https://pypi.org/project/xplainable/)\n[![PyPi](https://img.shields.io/pypi/v/xplainable?color=blue)](https://pypi.org/project/xplainable/)\n[![Downloads](https://static.pepy.tech/badge/xplainable)](https://pepy.tech/project/xplainable)\n\n**Xplainable** makes tabular machine learning transparent, fair, and actionable.\n\u003c/div\u003e\n\n## Why Xplainable?\n\nIn machine learning, there has long been a trade-off between accuracy and\nexplainability. Libraries like [Shap](https://github.com/slundberg/shap) and [Lime](https://github.com/marcotcr/lime) estimate model decisions after the fact, but they're slow and add complexity.\n\n**xplainable** takes a different approach: models that are explainable *by design*. Our algorithms match the performance of black-box models like [XGBoost](https://github.com/dmlc/xgboost) and [LightGBM](https://github.com/microsoft/LightGBM) while providing complete transparency in real-time — no surrogate models, no approximations.\n\nEvery prediction comes with per-feature contribution scores that explain *why* the model made that decision. These contributions are exact (not estimates) and can be used to drive business actions like retention campaigns, risk routing, and cost optimisation.\n\n## Installation\n\n```bash\npip install xplainable\n```\n\nFor preprocessing pipelines (spec-driven, JSON-serializable):\n```bash\npip install xplainable-preprocessing\n```\n\nFor cloud model management, deployment, and collaboration:\n```bash\npip install xplainable-client\n```\n\n## Quick Start\n\n```python\nimport xplainable as xp\nfrom xplainable.core.models import XClassifier\nfrom xplainable.core.optimisation.bayesian import XParamOptimiser\nfrom sklearn.model_selection import train_test_split\n\n# Load and split data\ndata = xp.load_dataset('titanic')\nX, y = data.drop(columns=['Survived']), data['Survived']\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=42)\n\n# Optimise hyperparameters\nopt = XParamOptimiser()\nparams = opt.optimise(X_train, y_train)\n\n# Train\nmodel = XClassifier(**params)\nmodel.fit(X_train, y_train)\n\n# Predict\ny_pred = model.predict(X_test)\n\n# Explain — interactive feature importances and contribution plots\nmodel.explain()\n```\n\n## Models\n\n| Model | Class |\n|:------|:------|\n| Binary Classification | `XClassifier` |\n| Regression | `XRegressor` |\n| Partitioned Classification | `PartitionedClassifier` |\n| Partitioned Regression | `PartitionedRegressor` |\n\n## Key Features\n\n### Explainability — Built In, Not Bolted On\n\nEvery xplainable model provides:\n\n- **Feature importances** — which features matter most\n- **Partition contributions** — how each feature value range shifts the prediction\n- **Per-instance explanations** — why this specific prediction was made\n\n```python\n# Global explanation\nmodel.explain()\n\n# Per-instance contributions\ncontributions = model._transform(X_test)\n\n# Model profile (all partition details)\nprofile = model.profile\n```\n\n### Preprocessing with `xplainable-preprocessing`\n\nSpec-driven, JSON-serializable pipelines that can be versioned, previewed, and persisted to Xplainable Cloud.\n\n```python\nfrom xplainable_preprocessing import PipelineSpec, StepSpec, compile_spec\n\nspec = PipelineSpec(steps=[\n    StepSpec(\n        id=\"lowercase\",\n        type=\"TextCleanTransformer\",\n        columns=[\"country\", \"category\"],\n        params={\"operations\": [\"lowercase\"]},\n    ),\n    StepSpec(\n        id=\"fill_missing\",\n        type=\"FillMissingTransformer\",\n        params={\"strategy\": \"median\"},\n    ),\n    StepSpec(\n        id=\"drop_ids\",\n        type=\"DropColumnsTransformer\",\n        params={\"columns\": [\"customer_id\", \"order_id\"]},\n    ),\n])\n\npipeline = compile_spec(spec)\ndf_transformed = pipeline.fit_transform(df)\n```\n\nAvailable transformers: `TextCleanTransformer`, `DropColumnsTransformer`, `FillMissingTransformer`, `TypeCastTransformer`, `CategoryCondenseTransformer`, `ExpressionTransformer`, `DateTimeExtractTransformer`, `RenameColumnsTransformer`, `GroupByAggTransformer`, `GroupedLagTransformer`, `RollingAggTransformer`, plus all standard sklearn transformers (StandardScaler, OneHotEncoder, etc.)\n\n### Hyperparameter Optimisation\n\nBayesian optimisation finds the best parameters automatically.\n\n```python\nfrom xplainable.core.optimisation.bayesian import XParamOptimiser\n\nopt = XParamOptimiser(metric='roc-auc')\nparams = opt.optimise(X_train, y_train)\n\nmodel = XClassifier(**params)\nmodel.fit(X_train, y_train)\n```\n\n### Rapid Refitting\n\nFine-tune model parameters on individual features without retraining from scratch.\n\n```python\nmodel.update_feature_params(\n    features=['Age'],\n    max_depth=6,\n    min_info_gain=0.01,\n    min_leaf_size=0.03,\n    weight=0.05,\n    power_degree=1,\n    sigmoid_exponent=1,\n    x=X_train,\n    y=y_train\n)\n```\n\n### Contribution-Driven Optimisation\n\nUse the model's per-feature contributions to identify controllable business levers and calculate the expected value of interventions — derived from the data, not assumed.\n\n```python\n# Get per-feature contributions\ncontributions = model._transform(X_test)\n\n# Model profile shows partition boundaries and scores\nprofile = model.profile\n\n# For controllable features, compute counterfactual lever effects:\n# \"How much would churn drop if we moved this customer to the best partition?\"\nbest_score = min(p['score'] for p in profile['numeric']['orders_count'])\nlever_effect = current_contribution - best_score\n```\n\nSee the [Shopify Customer Churn](examples/Shopify_Customer_Churn.ipynb) notebook for a complete example.\n\n## Xplainable Cloud\n\nDeploy models, persist preprocessing pipelines, and collaborate with your team through the Xplainable Cloud platform.\n\n```python\nfrom xplainable_client.client.client import XplainableClient\n\nclient = XplainableClient(\n    api_key=\"your-api-key\",\n    hostname=\"https://platform.xplainable.io\"\n)\n\n# Persist preprocessing\nclient.preprocessing.create_preprocessor(\n    name=\"My Preprocessor\",\n    description=\"Feature transforms for churn model\",\n    spec=preprocessing_spec.model_dump(),\n    sample_df=df,\n)\n\n# Persist model\nclient.models.create_model(\n    model=model,\n    model_name=\"Churn Prediction\",\n    model_description=\"Customer churn classifier\",\n    x=X_train, y=y_train\n)\n\n# Deploy\ndeployment = client.deployments.deploy(model_version_id=version_id)\n```\n\n## Examples\n\n| Notebook | Type | Description |\n|:---------|:-----|:------------|\n| [Shopify Customer Churn](examples/Shopify_Customer_Churn.ipynb) | Classification | Churn prediction with contribution-driven retention optimisation |\n| [Shopify Order Returns](examples/Shopify_Order_Returns.ipynb) | Classification | Return prediction with intervention routing |\n| [Telco Churn](examples/Telco_Churn.ipynb) | Classification | IBM Telco customer churn |\n| [HELOC Credit Risk](examples/HELOC_Credit_Risk.ipynb) | Classification | Credit risk assessment |\n| [Lead Scoring](examples/Lead_Scoring_Prediction.ipynb) | Classification | Lead conversion prediction |\n| [House Prices](examples/House_Prices_Regression.ipynb) | Regression | Property price prediction |\n| [Concrete Strength](examples/Concrete_Compressive_Strength.ipynb) | Regression | Material strength prediction |\n| [Power Plant Output](examples/Power_Plant_Energy_Output.ipynb) | Regression | Energy output prediction |\n\n## Documentation\n\n- [General Documentation](https://docs.xplainable.io)\n- [API Documentation](https://xplainable.readthedocs.io)\n\n## Contributing\n\nWe welcome contributions. If you're interested, reach out at contact@xplainable.io.\n\n\u003cdiv align=\"center\"\u003e\n\u003cbr\u003e\n\u003cstrong\u003eMade with care in Australia\u003c/strong\u003e\n\u003cbr\u003e\n\u003chr\u003e\n\u0026copy; xplainable pty ltd\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxplainable%2Fxplainable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxplainable%2Fxplainable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxplainable%2Fxplainable/lists"}