في هذا PR ، نقوم بتغيير معلمات init لـ ENC من أجل اجتياز اختبارات shap (test_shap) في ملف test_algoritthms.py
. ترك معلمات init مثل alpha = 0.0001
و l1_ratio=0.15
تسبب في حدوث ZeroDivisionError
أثناء حساب shap ، والذي من المحتمل أن يكون مرتبطًا بهذا .
حفظ هذه المشكلة لتحديد سبب فشل الاختبار واكتشاف طريقة جيدة لتجنب هذا الخطأ.
أعتقد أن هذه مشكلة حالات العسر الشديد. لقد قدمت https://github.com/slundberg/shap/issues/2000 للمناقشة. على المدى القصير ، أعتقد أنه يمكننا القيام بما يلي:
KernelExplainer
للنماذج الخطيةexplainer = shap.LinearExplainer(classifier, X, link=shap.links.logit)
اختبار آخر فشل:
بشكل أساسي ، باستخدام 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
فشل الاختبار:
إذا قمنا بتغيير alpha و l1_ratio ، فسيظل فشلًا.
طيب @ bchen1116 ، اذهب وافعل ذلك.
الختام مع هذا العلاقات العامة