Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
386 B
4
Indexable
Never


columns = train_X.columns.values.tolist()


def plot_model(model, X, feature_names=None):
    explainer = shap.TreeExplainer(model)
    shap_values = explainer.shap_values(X)
    #shap.force_plot(explainer.expected_value, shap_values, X)
    shap.summary_plot(shap_values, X, feature_names=feature_names)
    return shap_values

plot_model(catModel, pool_train, feature_names=columns)