Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/10/11 13:04:09 (13 years ago)
Author:
mkommend
Message:

#1675: Corrected emtpy solution ensembles and adapted views to handle empty ensembles correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs

    r6740 r6982  
    106106        values[i, 0] = row.ToString();
    107107        values[i, 1] = target[i].ToString();
     108        //display only indices and target values if no models are present
     109        if (i >= estimatedClassValues.Length) continue;
     110
    108111        values[i, 2] = estimatedClassValues[i].ToString();
    109112        values[i, 3] = (target[i] == estimatedClassValues[i]).ToString();
     
    131134      matrix.SortableView = true;
    132135      matrixView.Content = matrix;
    133       UpdateColoringOfRows();
    134136    }
    135137
     
    162164        return;
    163165      }
    164       bool correctClassified = bool.Parse(matrixView.DataGridView[3, e.RowIndex].Value.ToString());
     166      var cellValue = matrixView.DataGridView[3, e.RowIndex].Value.ToString();
     167      if (string.IsNullOrEmpty(cellValue)) return;
     168      bool correctClassified = bool.Parse(cellValue);
    165169      matrixView.DataGridView.Rows[e.RowIndex].DefaultCellStyle.ForeColor = correctClassified ? Color.MediumSeaGreen : Color.Red;
    166     }
    167 
    168     private void UpdateColoringOfRows() {
    169       if (InvokeRequired) {
    170         Invoke((Action)UpdateColoringOfRows);
    171         return;
    172       }
    173       //matrixView.DataGridView.SuspendRepaint();
    174       //for (int i = 0; i < matrixView.DataGridView.Rows.Count; i++) {
    175       //  bool correctClassified = bool.Parse(matrixView.Content.GetValue(i, 3));
    176       //  matrixView.DataGridView.Rows[i].DefaultCellStyle.ForeColor = correctClassified ? Color.MediumSeaGreen : Color.Red;
    177       //}
    178       //matrixView.DataGridView.ResumeRepaint(true);
    179170    }
    180171  }
Note: See TracChangeset for help on using the changeset viewer.