statistic
Handle statistics.
Classes:
Name | Description |
---|---|
Stat |
Represents a statistic for the explainable model. |
HistogramStat |
Histogram statistics metric. |
VarianceStat |
Histogram statistics metric. |
DistributionStat |
Distribution statistics metric. |
DictStats |
Dictionary of statistics (torch eval etc...) used in training or explain. |
Stat
#
Represents a statistic for the explainable model.
HistogramStat
#
Histogram statistics metric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Literal['input', 'target', 'prediction', 'prediction_error']
|
Data type to compute the statistic on. |
required |
|
int
|
Number of bins linearly spaced to compute from the sampled items. |
required |
|
int
|
Number total of items to sample from the data to approximate a histogram, as not all samples are used for memory efficiency. |
required |
|
bool
|
Whether to compute the statistic on the raw spce or on the preprocessed space. |
required |
|
str | None
|
In case of "input" data type, the statistic will be computed only for the feature named feature_name. If None, it will compute the statistic on the schema first feature. |
None
|
Attributes:
Name | Type | Description |
---|---|---|
on |
Literal['input', 'target', 'prediction', 'prediction_error']
|
|
num_bins |
int
|
|
num_items |
int
|
|
on_raw_data |
bool
|
|
feature_name |
str | None
|
|
VarianceStat
#
Histogram statistics metric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Literal['input', 'target', 'prediction', 'prediction_error']
|
Data type to compute the statistic on. |
required |
|
bool
|
Whether to compute the statistic on the raw spce or on the preprocessed space. |
required |
|
str | None
|
In case of "input" data type, the statistic will be computed only for the feature named feature_name. If None, it will compute the statistic on the schema first feature. |
None
|
Attributes:
Name | Type | Description |
---|---|---|
on |
Literal['input', 'target', 'prediction', 'prediction_error']
|
|
on_raw_data |
bool
|
|
feature_name |
str | None
|
|
DistributionStat
#
Distribution statistics metric.
The distribution is always computed on the preprocessed space as it requires one-hot vectors for the categorical feature.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Literal['input', 'target', 'prediction', 'prediction_error']
|
Data type to compute the statistic on. |
required |
|
str | None
|
In case of "input" data type, the statistic will be computed only for the feature named feature_name. If None, it will compute the statistic on the schema first feature. |
None
|
Attributes:
Name | Type | Description |
---|---|---|
on |
Literal['input', 'target', 'prediction', 'prediction_error']
|
|
feature_name |
str | None
|
|
DictStats
#
Dictionary of statistics (torch eval etc...) used in training or explain.
Each stat will be computed globally (for the whole model) and per leaf.
Stats are displayed in XpViz along with explanations. Dictionary keys are will be used as metric names in XpViz.