Skip to content

numobs and getobs #1

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

Merged
merged 6 commits into from
Dec 27, 2021
Merged

numobs and getobs #1

merged 6 commits into from
Dec 27, 2021

Conversation

CarloLucibello
Copy link
Member

@CarloLucibello CarloLucibello commented Dec 26, 2021

Porting nobs, getobs and getobs! from JuliaML/LearnBase.jl#53 with the following differences

  • nobs is renamed to numobs, to avoid conflicts with StatsBase.nobs
  • We get rid of the obsdim keyword, which causes a lot of additional complexity in the implementation here and in downstream packages. Wrapper types can be used in place of it.

@darsnack
Copy link
Member

What would the wrapper type alternatives to the keyword look like?

@CarloLucibello
Copy link
Member Author

something like this for obsdim=1

struct MyDataset
  A::AbstractArray
end
getobs(d::MyDataset, i) = d[i, :]

We can also provide a ArrayDataset{D} where D parameterizes the observation dimension. I think it is better to have the type set the observation dim than having to deal with the obsdim keyword during the whole downstream pipeline

@CarloLucibello CarloLucibello mentioned this pull request Dec 27, 2021
17 tasks
@CarloLucibello
Copy link
Member Author

Merging as I would like to go on with the port

@CarloLucibello CarloLucibello merged commit 3c68ada into main Dec 27, 2021
@ToucheSir
Copy link
Contributor

If/when JuliaLang/julia#32310 lands, that could be used over a custom dataset type.

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

Successfully merging this pull request may close these issues.

3 participants