Module ethik.regression_explainer
Expand source code
from .cache_explainer import CacheExplainer
__all__ = ["RegressionExplainer"]
class RegressionExplainer(CacheExplainer):
pass
Classes
class RegressionExplainer (alpha=0.05, n_taus=41, n_samples=1, sample_frac=0.8, conf_level=0.05, max_iterations=15, tol=0.0001, n_jobs=1, memoize=False, verbose=True)
-
Explains the influence of features on model predictions and performance.
Parameters
alpha
:float
- A
float
between0
and0.5
which indicates by how close theCacheExplainer
should look at extreme values of a distribution. The closer to zero, the more so extreme values will be accounted for. The default is0.05
which means that all values beyond the 5th and 95th quantiles are ignored. n_taus
:int
- The number of τ values to consider. The results will be more fine-grained the
higher this value is. However the computation time increases linearly with
n_taus
. The default is41
and corresponds to each τ being separated by it's neighbors by0.05
. n_samples
:int
- The number of samples to use for the confidence interval.
If
1
, the default, no confidence interval is computed. sample_frac
:float
- The proportion of lines in the dataset sampled to
generate the samples for the confidence interval. If
n_samples
is1
, no confidence interval is computed and the whole dataset is used. Default is0.8
. conf_level
:float
- A
float
between0
and0.5
which indicates the quantile used for the confidence interval. Default is0.05
, which means that the confidence interval contains the data between the 5th and 95th quantiles. max_iterations
:int
- The maximum number of iterations used when applying the Newton step
of the optimization procedure. Default is
5
. tol
:float
- The bottom threshold for the gradient of the optimization
procedure. When reached, the procedure stops. Otherwise, a warning
is raised about the fact that the optimization did not converge.
Default is
1e-4
. n_jobs
:int
- The number of jobs to use for parallel computations. See
joblib.Parallel()
. Default is-1
. memoize
:bool
- Indicates whether or not memoization should be used or not. If
True
, then intermediate results will be stored in order to avoid recomputing results that can be reused by successively called methods. For example, if you callplot_influence
followed byplot_influence_ranking
andmemoize
isTrue
, then the intermediate results required byplot_influence
will be reused forplot_influence_ranking
. Memoization is turned off by default because it can lead to unexpected behavior depending on your usage. verbose
:bool
- Whether or not to show progress bars during
computations. Default is
True
.
Expand source code
class RegressionExplainer(CacheExplainer): pass
Ancestors
Inherited members
CacheExplainer
:CAT_COL_SEP
compare_influence
compare_performance
compute_distributions
compute_weights
explain_influence
explain_performance
get_metric_name
plot_cumulative_weights
plot_distributions
plot_influence
plot_influence_2d
plot_influence_comparison
plot_influence_ranking
plot_performance
plot_performance_2d
plot_performance_comparison
plot_performance_ranking
plot_weight_distribution
rank_by_influence
rank_by_performance