Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/16/20 15:48:32 (5 years ago)
Author:
pfleck
Message:

#3040 Added fix for non-numeric class labels

Location:
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs

    r17365 r17403  
    450450    string IStringConvertibleMatrix.GetValue(int rowIndex, int columnIndex) {
    451451      var value = variableValues[variableNames[columnIndex]][rowIndex];
    452       if (value is IVector vector)
    453         return $"[{string.Join(", ", vector.Cast<object>())}]";
     452      if (value is IVector vector) {
     453        const int maxCount = 10;
     454        string extension = vector.Count > maxCount ? ", ..." : "";
     455        return $"[{string.Join(", ", vector.Cast<object>().Take(Math.Min(vector.Count, maxCount)))}{extension}]";
     456      }
     457
    454458      return value.ToString();
    455459    }
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IVector.cs

    r17365 r17403  
    66  [StorableType("E6B5D191-F094-4A6C-91C1-011191C13A16")]
    77  public interface IVector : IEnumerable {
     8    int Count { get; }
    89  }
    910
Note: See TracChangeset for help on using the changeset viewer.