A Python package for data analysis and model optimization.
Project description
apyxl
The apyxl
package (Another PYthon package for eXplainable Learning) is a simple wrapper around xgboost
, hyperopt
, and shap
. It provides the user with the ability to build a performant regression or classification model and use the power of the SHAP analysis to gain a better understanding of the links the model builds between its inputs and outputs. With apyxl
, processing categorical features, fitting the model using Bayesian hyperparameter search, and instantiating the associated SHAP explainer can all be accomplished in a single line of code, streamlining the entire process from data preparation to model explanation.
Current Features:
- Automatic One-Hot-Encoding for categorical variables
- Basic hyperparameter optimization using
hyperopt
with K-Folds cross-validation - Simple explainability visualizations using
shap
(beeswarm
,decision
,force
,scatter
) - Focus on classification and regression tasks
Planned Enhancements:
- Time-series data handling and normalization
- A/B test analysis capabilities
Installation
To install the package, use:
pip install apyxl
Basic Usage
Here's a simple example of how to use the XGBRegressorWrapper
class:
from apyxl import XGBRegressorWrapper
from sklearn.datasets import load_diabetes
# Load the diabetes dataset
X, y = load_diabetes(return_X_y=True, as_frame=True)
# Initialize and fit the model
xgb = XGBRegressorWrapper()
xgb.fit(X, y)
# Generate a beeswarm plot
xgb.beeswarm(X)
# Generate a dependence plot
xgb.scatter(X, feature='s5')
Please note that this package is still under development, and features may change or expand in future versions.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file apyxl-0.1.tar.gz
.
File metadata
- Download URL: apyxl-0.1.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57f8294703db902c365e054e0b787d8f36fa7b55a1f7b9b7779079481a0fcbea |
|
MD5 | cb510710609983fc3d9f5c2b1ffff6b4 |
|
BLAKE2b-256 | dbb17c669ec3fb14320ae2f46413eba1e70518abc78c2a974bcbbde644d73044 |