Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcard for 0-or-more in Pattern #63

Open
morris25 opened this issue May 25, 2021 · 0 comments
Open

Wildcard for 0-or-more in Pattern #63

morris25 opened this issue May 25, 2021 · 0 comments

Comments

@morris25
Copy link
Member

Somewhat related to #48 .
I have data containing training sets for several features. Some have a single KeyedArray and others have multiple sub-components. It would be nice to be able to get all :train data using a wildcard instead of merging (:_, :train, :__) and (:_, :train).

julia> data=KeyedDataset(
           (:f1, :train)=>KeyedArray([1], a=[1]), 
           (:f2, :train, :x)=>KeyedArray([1], b=[1]), 
           (:f2, :train, :y)=>KeyedArray([1], c=[1]),
       )
KeyedDataset with:
  3 components
    (:f1, :train) => 1 KeyedArray{Int64} with dimension a[1]
    (:f2, :train, :x) => 1 KeyedArray{Int64} with dimension b[2]
    (:f2, :train, :y) => 1 KeyedArray{Int64} with dimension c[3]
  3 constraints
    [1] (:__, :a) ∈ 1-element Vector{Int64}
    [2] (:__, :b) ∈ 1-element Vector{Int64}
    [3] (:__, :c) ∈ 1-element Vector{Int64}

julia> data(:_, :train, :__)
KeyedDataset with:
  2 components
    (:f2, :train, :x) => 1 KeyedArray{Int64} with dimension b[1]
    (:f2, :train, :y) => 1 KeyedArray{Int64} with dimension c[2]
  2 constraints
    [1] (:__, :b) ∈ 1-element Vector{Int64}
    [2] (:__, :c) ∈ 1-element Vector{Int64}

julia> data(:_, :train)
KeyedDataset with:
  1 components
    (:f1, :train) => 1 KeyedArray{Int64} with dimension a[1]
  1 constraints
    [1] (:__, :a) ∈ 1-element Vector{Int64}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant