         index: 0
         key: "#{criterion.caption}\0#{output.caption}"
         caption: "#{criterion.caption} - #{output.caption}"
-        domain: [0, 1]
+        domain: criterion.domain
         isGrouped: yes
         criterion: criterion
         output: output

      ]

    createComparisonGrid = (scores) ->
      algorithmRow = [ th 'Method' ]
      nameRow = [ th 'Name' ]
      rocCurveRow = [ th 'ROC Curve' ]
      inputParametersRow = [
        th [
          (div 'Input Parameters')
          (hyperlink 'Show more', 'toggle-advanced-parameters')
        ]
      ]
      durationRow = [ th 'Time' ]
      aucRow = [ th 'AUC' ]
      thresholdCriterionRow = [ th 'Threshold Criterion' ]
      thresholdRow = [ thIndent 'Threshold' ]
      errorRow = [ thIndent 'Error' ]
      f1Row = [ thIndent 'F1' ]
      accuracyRow = [ thIndent 'Accuracy' ]
      precisionRow = [ thIndent 'Precision' ]
      recallRow = [ thIndent 'Recall' ]
      specificityRow = [ thIndent 'Specificity' ]
      mccRow = [ thIndent 'MCC' ]
      maxPerClassErrorRow = [ thIndent 'Max Per Class Error' ]


      #TODO what does it mean to have > 1 metrics

aucOutputs = [
  key: 'threshold_for_criteria'
  caption: 'Threshold'
  domain: [0, 1]
,
  key: 'error_for_criteria'
  caption: 'Error'
  domain: [0, 1]
,
  key: 'F0point5_for_criteria'
  caption: 'F0.5'
  domain: [0, 1]
,
  key: 'F1_for_criteria'
  caption: 'F1'
  domain: [0, 1]
,
  key: 'F2_for_criteria'
  caption: 'F2'
  domain: [0, 1]
,
  key: 'accuracy_for_criteria'
  caption: 'Accuracy'
  domain: [0, 1]
,
  key: 'precision_for_criteria'
  caption: 'Precision'
  domain: [0, 1]
,
  key: 'recall_for_criteria'
  caption: 'Recall'
  domain: [0, 1]
,
  key: 'specificity_for_criteria'
  caption: 'Specificity'
  domain: [0, 1]
,
  key: 'mcc_for_criteria'
  caption: 'MCC'
  domain: [-1, 1]
,
  key: 'max_per_class_error_for_criteria'
  caption: 'MPCE'
  domain: [0, 1]
]

aucCategories = do ->
