v0.3.2: custom metrics
Version 0.3.2:
Highlights:
- Control what metrics to show or use your own custom metrics using
show_metrics - Set the naming for onehot features with all
0s withcats_notencoded - Speed up plots by displaying only a random sample of markers in scatter plots with
plot_sample. - make index selection a free text field with
index_dropdown=False
New Features
- new parameter
show_metricsfor bothexplainer.metrics(),ClassifierModelSummaryComponent
andRegressionModelSummaryComponent:- pass a list of metrics and only display those metrics in that order
- you can also pass custom scoring functions as long as they
are of the formmetric_func(y_true, y_pred):show_metrics=[metric_func]- For
ClassifierExplainerwhat is passed to the custom metric function
depends on whether the function takes additional parameterscutoff
andpos_label. If these are not arguments, theny_true=self.y_binary(pos_label)
andy_pred=np.where(self.pred_probas(pos_label)>cutoff, 1, 0).
Else the rawself.yandself.pred_probasare passed for the
custom metric function to do something with. - custom functions are also stored to
dashboard.yamland imported upon
loadingExplainerDashboard.from_config()
- For
- new parameter
cats_notencoded: a dict to indicate how to name the value
of a onehotencoded features when all onehot columns equal 0. Defaults
to'NOT_ENCODED', but can be adjusted with this parameter. E.g.
cats_notencoded=dict(Deck="Deck not known"). - new parameter
plot_sampleto only plot a random sample in the various
scatter plots. When you have a large dataset, this may significantly
speed up various plots without sacrificing much in expressiveness:
ExplainerDashboard(explainer, plot_sample=1000).run - new parameter
index_dropdown=Falsewill replace the index dropdowns with a
free text field. This can be useful when you have a lot of potential indexes,
and the user is expected to know the index string.
Input will be checked for validity withexplainer.index_exists(index),
and field indicates when input index does not exist. If index does not exist,
will not be forwarded to other components, unless you also setindex_check=False. - adds mean absolute percentage error to the regression metrics. If it is too
large a warning will be printed. Can be excluded with the newshow_metrics
parameter.
Bug Fixes
get_classification_dfadded toClassificationComponentdependencies.
Improvements
- accepting single column
pd.Dataframefory, and automatically converting
it to apd.Series - if WhatIf
FeatureInputComponentdetects the presence of missing onehot features
(i.e. rows where all columns of the onehotencoded feature equal 0), then
adds'NOT_ENCODED'or the matching value fromcats_notencodedto the
dropdown options. - Generating
namefor parameters forExplainerComponentsfor which no
name is given is now done with a determinative process instead of a random
uuid. This should help with scaling custom dashboards across cluster
deployments. Also dropsshortuuiddependency. ExplainerDashboardnow prints out local ip address when starting dashboard.get_index_list()is only called once upon starting dashboard.