Evalml: SHAPテストがElasticNetClassifier推定器で失敗する

作成日 2021年05月17日  ·  4コメント  ·  ソース: alteryx/evalml

このPRでは、 test_algoritthms.pyファイルのshapテスト(test_shap)に合格するために、ENCのinitパラメーターを変更します。 initパラメータをalpha = 0.0001およびl1_ratio=0.15おくと、shapの計算中にZeroDivisionErrorが発生しまし。これは、これに関連している可能性があり

この問題を提出して、テストが失敗する理由を特定し、このエラーを回避するための適切な方法を見つけてください。

bug

全てのコメント4件

これは簡単な問題だと思います。 ディスカッションのためにhttps://github.com/slundberg/shap/issues/2000を提出しました。 短期的には、次のことができると思います。

  • 線形モデルの場合、 KernelExplainerでlink = "identity"を使用します
  • ロジットリンクexplainer = shap.LinearExplainer(classifier, X, link=shap.links.logit) LinearExplainerを使用する

失敗した別のテスト:

メインで使用して、 alpha=0.5, l1_ratio=0.5 、我々は前に持っているものである、この私たちはにこのテストを追加した場合、 evalml/tests/model_understanding_tests/prediction_explaination_tests/test_explainers.py

@pytest.mark.parametrize("estimator", ["Extra Trees Classifier", "Elastic Net Classifier"])
def test_elastic_net(estimator, fraud_100):
    pytest.importorskip('imblearn', reason='Skipping test because imblearn not installed')
    X, y = fraud_100
    pipeline = BinaryClassificationPipeline(component_graph=["Imputer", "One Hot Encoder", "DateTime Featurization Component", estimator])
    pipeline.fit(X=X, y=y)
    pipeline.predict(X)
    importance = explain_predictions(pipeline, X, y, indices_to_explain=[0], top_k_features=4)
    assert report['feature_names'].isnull().sum() == 0
    assert report['feature_values'].isnull().sum() == 0

テストは失敗します:
image

alphaとl1_ratioを変更しても、失敗します。

わかりました@ bchen1116 、やってください。

このPRで締めくくります

このページは役に立ちましたか?
0 / 5 - 0 評価