function columnsAndFieldsFromScore(
  columnsYPred,
  columnsYTrue,
  modelsMeta,
  scoreFunc
) {
  const {nModels, nClasses, classLabels = []} = modelsMeta;

  // regression vs classification
  const _scoreFunc =
    scoreFunc && typeof scoreFunc === 'function'
      ? scoreFunc
      : nClasses === 1
        ? absoluteError
        : logLoss;

  // performance columns by model
  const columns = dotRange(nModels).map(modelId => {
    // get prediction columns by model
    const predictArr = columnsYPred.slice(
      modelId * nClasses,
      (modelId + 1) * nClasses
    );
    return _scoreFunc(columnsYTrue[0], predictArr, classLabels);
  });
  const domains = columns.map(getColumnMinMax);
  const fields = dotRange(nModels).map(modelId => ({
    name: scoreColName(modelId),
    type: FEATURE_TYPE.NUMERICAL,
    role: FIELD_ROLE.SCORE,
    dataType: DATA_TYPE.REAL,
    domain: domains[modelId],
  }));

  return {
    columns,
    fields,
  };
  // 17924.6ms --> 112.77ms
}
compute model score columns given yPred, yTrue columns
@param {Array<Array<Number>} yPred prediction columns, from all models and all classes
@param {Array<Array<Number|String>} yTrue ground truth columns
@param {Object} modelMeta contains {nModels, nClasses, classLabels}
@param {scoreFunc} function to compute score
@return {Object} {data: {columns, fields}, collumnTypeRanges: {uuid, x, yPred, yTrue}}
columns: array of field metadata
fields: array of array of columns