Neste PR , mudamos os parâmetros de inicialização para ENC a fim de passar os testes de forma (test_shap) no arquivo test_algoritthms.py
. Deixar os parâmetros de inicialização como alpha = 0.0001
e l1_ratio=0.15
causou um ZeroDivisionError
durante o cálculo do formato, que provavelmente está vinculado a isso .
Arquive esse problema para determinar por que o teste falha e descobrir uma boa maneira de evitar esse erro.
Acho que isso é um problema de formato. Eu preenchi https://github.com/slundberg/shap/issues/2000 para discussão. No curto prazo, acho que podemos fazer o seguinte:
KernelExplainer
para modelos linearesexplainer = shap.LinearExplainer(classifier, X, link=shap.links.logit)
Outro teste que falhou:
No principal, usando alpha=0.5, l1_ratio=0.5
, que é o que temos antes disso , se adicionarmos este teste em 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
O teste falha:
Se mudarmos o alfa e l1_ratio, ele ainda falhará.
Ok @ bchen1116 , vá em frente.
Fechando com este PR