TrustScoreComparison¶
- class TrustScoreComparison[source]¶
Compares the model’s trust score for the train dataset with scores of the test dataset.
The Trust Score algorithm and code was published in the paper: “To Trust or not to trust c classifier”. See the original paper at arxiv 1805.11783, or see the version of the paper presented at NeurIPS in 2018: https://proceedings.neurips.cc/paper/2018/file/7180cffd6a8e829dacfc2a31b3f72ece-Paper.pdf
The process is as follows:
Pre-process the train and test data into scaled numerics.
Train a TrustScore regressor based on train data + label.
Predict on test data using the model.
Use TrustScore to score the prediction of the model.
- Parameters
- k_filterint , default: 10
used in TrustScore (Number of neighbors used during either kNN distance or probability filtering)
- alphafloat , default: 0.001
used in TrustScore (Fraction of instances to filter out to reduce impact of outliers)
- max_number_categoriesint , default: 10
Indicates the maximum number of unique categories in a single categorical column (rare categories will be changed to a form of “other”)
- min_test_samplesint , default: 300
Minimal number of samples in train data to be able to run this check
- sample_sizeint , default: 10_000
Number of samples to use for the check for train and test. if dataset contains less than sample_size than all the dataset will be used.
- random_stateint , default: 42
The random state to use for sampling.
- n_to_showint , default: 5
Number of samples to show of worst and best trust score.
- percent_top_scores_to_hidefloat , default: 0.05
- __init__(k_filter: int = 10, alpha: float = 0.001, max_number_categories: int = 10, min_test_samples: int = 300, sample_size: int = 10000, random_state: int = 42, n_to_show: int = 5, percent_top_scores_to_hide: float = 0.05)[source]¶
- __new__(*args, **kwargs)¶
Methods
|
Add new condition function to the check. |
|
Add condition. |
Remove all conditions from this check instance. |
|
Run conditions on given result. |
|
Name of class in split camel case. |
|
|
Return parameters to show when printing the check. |
Remove given condition by index. |
|
|
Run check. |
|
Run check. |