X = np.array([[2, 2, 2, 0, 3, -1], [2, 1, 2, -1, 2, 1], [0, -3, 0, 1, -2, 0
    ], [-1, -1, 1, 1, -1, -1], [-1, 0, 0, 2, -3, 1], [2, 2, 2, 0, 3, 0]],
    dtype=float)
Y = np.array([0, 0, 1, 1, 1, 0])
feature_importances = np.array([0.1, 0.2, 0.3, 0.2, 0.1, 0.1])
result = class_feature_importance(X, Y, feature_importances)
print(json.dumps(result, indent=4))
{'0': {'0': 0.0970142500145332, '1': 0.1693297563090475, '2': 
    0.27854300726557774, '3': -0.17407765595569782, '4': 0.0961523947640823,
    '5': 0.0}, '1': {'0': -0.09701425001453318, '1': -0.16932975630904754,
    '2': -0.2785430072655778, '3': 0.17407765595569782, '4': 
    -0.0961523947640823, '5': 0.0}}
Using scikit to determine contributions of each feature to a specific class prediction