-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from DataResponsibly/development
Development
- Loading branch information
Showing
267 changed files
with
43,467 additions
and
7,536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
*_venv | ||
virny_env | ||
notebooks | ||
*.env | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
docs/api/analyzers/BatchOverallVarianceAnalyzerPostProcessing.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# BatchOverallVarianceAnalyzerPostProcessing | ||
|
||
Analyzer to compute subgroup variance metrics using the defined post-processor. | ||
|
||
|
||
|
||
## Parameters | ||
|
||
- **postprocessor** | ||
|
||
One of postprocessors from aif360 (https://aif360.readthedocs.io/en/stable/modules/algorithms.html#module-aif360.algorithms.postprocessing) | ||
|
||
- **sensitive_attribute** (*str*) | ||
|
||
A sensitive attribute to use for post-processing | ||
|
||
- **base_model** | ||
|
||
Base model for stability measuring | ||
|
||
- **base_model_name** (*str*) | ||
|
||
Model name like 'DecisionTreeClassifier' or 'LogisticRegression' | ||
|
||
- **bootstrap_fraction** (*float*) | ||
|
||
[0-1], fraction from train_pd_dataset for fitting an ensemble of base models | ||
|
||
- **X_train** (*pandas.core.frame.DataFrame*) | ||
|
||
Processed features train set | ||
|
||
- **y_train** (*pandas.core.frame.DataFrame*) | ||
|
||
Targets train set | ||
|
||
- **X_test** (*pandas.core.frame.DataFrame*) | ||
|
||
Processed features test set | ||
|
||
- **y_test** (*pandas.core.frame.DataFrame*) | ||
|
||
Targets test set | ||
|
||
- **target_column** (*str*) | ||
|
||
Name of the target column | ||
|
||
- **dataset_name** (*str*) | ||
|
||
Name of dataset, used for correct results naming | ||
|
||
- **n_estimators** (*int*) | ||
|
||
Number of estimators in ensemble to measure base_model stability | ||
|
||
- **with_predict_proba** (*bool*) – defaults to `True` | ||
|
||
[Optional] A flag if model can return probabilities for its predictions. If no, only metrics based on labels (not labels and probabilities) will be computed. | ||
|
||
- **notebook_logs_stdout** (*bool*) – defaults to `False` | ||
|
||
[Optional] True, if this interface was execute in a Jupyter notebook, False, otherwise. | ||
|
||
- **verbose** (*int*) – defaults to `0` | ||
|
||
[Optional] Level of logs printing. The greater level provides more logs. As for now, 0, 1, 2 levels are supported. | ||
|
||
|
||
|
||
|
||
## Methods | ||
|
||
???- note "UQ_by_boostrap" | ||
|
||
Quantifying uncertainty of the base model by constructing an ensemble from bootstrapped samples and applying postprocessing intervention. | ||
|
||
Return a dictionary where keys are models indexes, and values are lists of correspondent model predictions for X_test set. | ||
|
||
**Parameters** | ||
|
||
- **boostrap_size** (*int*) | ||
- **with_replacement** (*bool*) | ||
- **with_fit** (*bool*) – defaults to `True` | ||
|
||
???- note "compute_metrics" | ||
|
||
Measure metrics for the base model. Save results to a .csv file. | ||
|
||
**Parameters** | ||
|
||
- **save_results** (*bool*) – defaults to `True` | ||
- **with_fit** (*bool*) – defaults to `True` | ||
|
||
???- note "save_metrics_to_file" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# MetricsInteractiveVisualizer | ||
|
||
Class to create an interactive web app based on models metrics. | ||
|
||
|
||
|
||
## Parameters | ||
|
||
- **X_data** (*pandas.core.frame.DataFrame*) | ||
|
||
An original features dataframe | ||
|
||
- **y_data** (*pandas.core.frame.DataFrame*) | ||
|
||
An original target column pandas series | ||
|
||
- **model_metrics** | ||
|
||
A dictionary or a dataframe where keys are model names and values are dataframes of subgroup metrics for each model | ||
|
||
- **sensitive_attributes_dct** (*dict*) | ||
|
||
A dictionary where keys are sensitive attributes names (including attributes intersections), and values are privilege values for these attributes | ||
|
||
|
||
|
||
|
||
## Methods | ||
|
||
???- note "create_web_app" | ||
|
||
Build an interactive web application. | ||
|
||
**Parameters** | ||
|
||
- **start_app** – defaults to `True` | ||
|
Oops, something went wrong.