No project description provided
Project description
Using HBAC to detect biased data segments
- Hierarchical Bias-Aware Clustering (HBAC) on regression models.
- Input: a trained model and a model's test data.
- Output: analysis of biased/discriminated data segment according to HBAC:
- Comparing distributions of discriminated and remaining data.
- Segment predictor: trains a XGBoost binary classifier to evaluate distinguishability of discriminated and remaining data with descriptive features.
# Initialize HBAC
hbac = HBAC_analyser()
# In this case, input includes model path, X data and Y data
hbac.hbac_on_model(model_path, X_test, y_test)
hbac.pca_plot()
discrimated_cluster, bias = hbac.get_max_bias_cluster(print_results=True)
# Displaying results in dataframes
hbac.clustered_data
# Mean per feature 'discrimnated' cluster vs 'remaining' clusters
hbac.mean_clusters
# Plot 3 most different features' distributions
hbac.plot_distributions(plot_top_features = 3)
# Train XGBoost a binary classifier to predict whther a datapoint will be discrimnated or not, without using error as feature.
hbac.segment_predictor(plot_roc_auc=True,shap_analysis=True)
Also see example.ipynb.
For the use of HBAC on classification models, see https://github.com/Sm2468/msc_thesis/tree/master/hbac%20scripts, on which this project was based.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hbac_bias_detection-0.2.0.tar.gz
(11.3 kB
view details)
Built Distribution
File details
Details for the file hbac_bias_detection-0.2.0.tar.gz
.
File metadata
- Download URL: hbac_bias_detection-0.2.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4ea0106093d7d8d0149c63d086013f40332002396815b09260b5f85ce59536c |
|
MD5 | 8e2dd271cec1305aae15999ca5e9d28d |
|
BLAKE2b-256 | 698cdac0ead5b0567ec1a4cec2ab2324b40f5ff7589ea742210c357b7d754323 |
File details
Details for the file hbac_bias_detection-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: hbac_bias_detection-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 755b248a666d7dbe83b82f6d41678ff8968f193f0bb384f1ef9497ff7d687a61 |
|
MD5 | 32484b34e7552b6e43148a979b025da8 |
|
BLAKE2b-256 | 6640e5c036553744953677c1df0944a6c217a70de4ae32b899ff6db5b4010a1f |