def multiclass_logloss(actual, predicted, eps=1e-15):
    # Convert 'actual' to a binary array if it's not already:
    if len(actual.shape) == 1:
        actual2 = np.zeros((actual.shape[0], predicted.shape[1]))
        for i, val in enumerate(actual):
            actual2[i, val] = 1
        actual = actual2

    clip = np.clip(predicted, eps, 1 - eps)
    rows = actual.shape[0]
    vsota = np.sum(actual * np.log(clip))
    return -1.0 / rows * vsota
save seqDict to a worldbase-aware pickle file
dataset/ETHPy150Open dnouri/nolearn/nolearn/metrics.py/multiclass_logloss--crossover with--dataset/ETHPy150Open cjlee112/pygr/pygr/nlmsa_utils.py/save_seq_dict