Free cookie consent management tool by TermsFeed Policy Generator

Opened 6 years ago

Closed 5 years ago

#3002 closed feature request (done)

Build dataset with row-wise data

Reported by: abeham Owned by: abeham
Priority: medium Milestone: HeuristicLab 3.3.16
Component: Problems.DataAnalysis Version:
Keywords: merged Cc:

Description

Currently the dataset only accepts data in column format in its constructor. The dataset would be easier to use if it would accept row-wise data in the constructor.

Maybe we can create static methods instead of constructor methods like Dataset.FromRowData(double[,] data) and Dataset.FromRowData(IEnumerable<IList> data).

Change History (8)

comment:1 Changed 6 years ago by abeham

Maybe using some kind of helper function:

    private IEnumerable<IList> Transpose(IEnumerable<IList> data) {
      var transposed = new List<IList>();
      var iter = data.GetEnumerator();
      if (!iter.MoveNext()) return transposed;
      for (var d = 0; d < iter.Current.Count; d++)
        transposed.Add(new ArrayList());
      do {
        for (var d = 0; d < iter.Current.Count; d++)
          transposed[d].Add(iter.Current[d]);
      } while (iter.MoveNext());
      return transposed;
    }

comment:2 Changed 6 years ago by abeham

  • Owner set to abeham
  • Status changed from new to accepted

comment:3 Changed 6 years ago by abeham

  • Owner changed from abeham to mkommend
  • Status changed from accepted to reviewing

r16820: Implement static methods to build dataset from row-wise data and added unit test

comment:4 Changed 6 years ago by jkarder

r16821: fixed namespace and type name of DatasetTest

comment:5 Changed 6 years ago by gkronber

  • Owner changed from mkommend to abeham
  • Status changed from reviewing to readytorelease

Reviewed r16820 and r16821 together with jkarder.

comment:6 Changed 5 years ago by abeham

  • Keywords depends-2520 added

comment:7 Changed 5 years ago by abeham

  • Keywords merged added; depends-2520 removed

r17113: merged to stable (16820, 16821)

comment:8 Changed 5 years ago by abeham

  • Resolution set to done
  • Status changed from readytorelease to closed
Note: See TracTickets for help on using tickets.