     predictions
 
   extendPrediction = (modelKey, frameKey, prediction) ->
-    if prediction.__meta.schema_type is 'ModelMetricsBinomial'
-      augmentConfusionMatrices prediction.max_criteria_and_metric_scores, prediction.thresholds_and_metric_scores
     inspections = {}
     inspectObject inspections, 'Prediction', "getPrediction model: #{stringify prediction.model.name}, frame: #{stringify prediction.frame.name}", prediction
     inspect_ prediction, inspections

    convertColumnToVector column, table.data[i]
  createDataframe tableName, vectors, (sequence table.rowcount), null, metadata

combineTables = (tables) ->
  leader = head tables


      description: description
      origin: origin

  _schemaHacks =
    KMeansOutput:
      fields: 'names domains help'
    GBMOutput:
      fields: 'names domains help'
    GLMOutput:
      fields: 'names domains help'
    DRFOutput:
      fields: 'names domains help'
    DeepLearningModelOutput:
      fields: 'names domains help'
    NaiveBayesOutput:
      fields: 'names domains help'
    PCAOutput:
      fields: 'names domains help'
    ModelMetricsBinomial: 
      fields: null
      transform: (metrics) ->
        scores = metrics.thresholds_and_metric_scores
        tps = getTwoDimData scores, 'tps'
        tns = getTwoDimData scores, 'tns'
        fps = getTwoDimData scores, 'fps'
        fns = getTwoDimData scores, 'fns'

        cms = for tp, i in tps
          [[tns[i], fps[i]], [fns[i], tp]]

        tprs = for tp, i in tps
          tp / (tp + fns[i])

        fprs = for fp, i in fps
          fp / (fp + tns[i])

        scores.columns.push
          name: 'tpr'
          description: 'True Positive Rate'
          format: '%f'
          type: 'double'
        scores.data.push tprs

        scores.columns.push
          name: 'fpr'
          description: 'False Positive Rate'
          format: '%f'
          type: 'double'
        scores.data.push fprs

        scores.columns.push
          name: 'CM'
          description: 'CM'
          format: 'matrix' #TODO HACK
          type: 'matrix'
        scores.data.push cms

        metrics


    ModelMetricsMultinomial:
      fields: null
    ModelMetricsRegression:
      fields: null
    ModelMetricsClustering:
      fields: null
    ModelMetricsAutoEncoder:
      fields: null

  blacklistedAttributesBySchema = do ->
    dicts = {}
    for schema, attrs of _schemaHacks
      dicts[schema] = dict = __meta: yes
      if attrs.fields
        for field in words attrs.fields
          dict[field] = yes
    dicts

  schemaTransforms = do ->
    transforms = {}
    for schema, attrs of _schemaHacks
      if transform = attrs.transform
        transforms[schema] = transform
    transforms

  inspectObject = (inspections, name, origin, obj) ->
    schemaType = obj.__meta?.schema_type
    blacklistedAttributes = if schemaType
      if attrs = blacklistedAttributesBySchema[schemaType]
        attrs
      else
        {}
    else
      {}

    obj = transform obj if transform = schemaTransforms[schemaType]

    record = {}

    inspections[name] = inspectRawObject_ name, origin, name, record

    for k, v of obj when not blacklistedAttributes[k]
      if v is null
        record[k] = null
      else
