Skip to content
This repository was archived by the owner on May 21, 2022. It is now read-only.
This repository was archived by the owner on May 21, 2022. It is now read-only.

Make DataIterators return the data instead of lazy subsets #19

@Evizero

Description

@Evizero

I think the current behaviour is a design flaw that is an artefact of the early days.

Right now when you iterate over a RandomObs or a BalancedObs iterator it actually returns a datasubset (so a SubArray, or a DataSubset ). This is a bit silly since it requires a user to call getobs on the returned value to get the actual data.

for x in RandomObs(X)
    actual_x = getobs(x)
    # ...
end

The thing is that when X is a matrix then this issue isn't really visible, because x would just be a SubArray vector, which often works just as well as a Vector. However, if X itself was a Vector, then suddenly x is a 0-dim SubArray, and one absolutely needs getobs to use that data as intended.

I think there is no reason for x to not be the actual data at this point. There is not going to be any more sub-setting any more once we are on a per-observation level.

Note that changing this would be breaking

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions