#2897 closed defect (done)

Dataset (and ModifiableDataset) constructor accepts unsupported values

Reported by: bburlacu Owned by: mkommend
Priority: medium Milestone: HeuristicLab 3.3.16
Component: Problems.DataAnalysis Version: trunk
Keywords: Cc:

Description (last modified by bburlacu)

For example, passing an int array to the constructor will work just fine:

var dataset = new Dataset(new[] { "x" }, new[] { new[] { 1, 2, 3 } });

but trying to get the values by calling

var values = dataset.GetDoubleValues("x");

will throw an exception because variable x is not of type double.

The constructor should check for value types and throw an exception if an incompatible type is provided.

Additionally,

  • the AddVariable method of the ModifiableDataset does not behave properly when the dataset is empty.
  • the AddVariable method clones the values while the constructor does not

The ModifiableDataset was introduced with #2276.

Change History (11)

comment:1 Changed 19 months ago by bburlacu

  • Description modified (diff)
  • Owner set to bburlacu
  • Status changed from new to accepted
  • Summary changed from Dataset (and ModifiedDataset) constructor accepts unsupported values to Dataset (and ModifiableDataset) constructor accepts unsupported values

comment:2 Changed 19 months ago by bburlacu

  • Milestone HeuristicLab 3.3.16 deleted
  • Version set to trunk

r15769: Add type checks in Dataset constructor, remove cloning of values in the ModifiableDataset.AddVariable method. Provide small fix in GradientBoostingRegressionAlgorithm for AddVariable.

comment:3 Changed 18 months ago by bburlacu

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

comment:4 Changed 18 months ago by mkommend

  • Owner changed from mkommend to bburlacu
  • Status changed from reviewing to assigned

Please verify that the data is cloned when handed to the Dataset, because it should not be possible to modify the data contained in the Dataset at all. However, this changes if a ModifiableDataset is used, because their modification is encouraged and thus the data should not be cloned.

comment:5 Changed 18 months ago by bburlacu

r15829: Ensure cloning only happens in the Dataset constructor and ModifiableDataset cloning constructor.

comment:6 Changed 18 months ago by bburlacu

  • Owner changed from bburlacu to mkommend
  • Status changed from assigned to reviewing

comment:7 follow-up: Changed 12 months ago by mkommend

  • Milestone set to HeuristicLab 3.3.16

comment:8 in reply to: ↑ 7 Changed 12 months ago by mkommend

Please assign a milestone on every ticket, especially if it contains trunk commits!

comment:9 Changed 12 months ago by mkommend

  • Status changed from reviewing to readytorelease

comment:10 Changed 12 months ago by mkommend

r16124: Merged r15769 and r15829 into stable.

comment:11 Changed 12 months ago by mkommend

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