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

Extend Impute.jl interface? #94

Open
nickrobinson251 opened this issue Jul 23, 2019 · 2 comments
Open

Extend Impute.jl interface? #94

nickrobinson251 opened this issue Jul 23, 2019 · 2 comments

Comments

@nickrobinson251
Copy link

nickrobinson251 commented Jul 23, 2019

I wonder if rather than this package defining impute and impute_missing it would be instead be worth implementing the interface provided by Impute.jl?

One possible way could be to define a LowRank <: Imputor and extend impute(A, imp::LowRank)
along the lines of

struct LowRank <: Impute.Imputor
    losses::Vector{Loss}     # Vector of loss functions
    rx::Vector{Regularizer}  # Vector of regularizers to be applied to each column of X
    ry::Vector{Regularizer}  # Vector of regularizers to be applied to each column of Y
    k::Int                   # Desired rank
end

function Impute.impute!(A, imp::LowRank)
    # fit glmr, to get  Â = X Y' ≈ A
    # If A[i, j] is `missing`s replace it with the value Â[i, j]
end

function Impute.impute(A, imp::LowRank)
    # fit glmr, to get  Â = X Y' ≈ A
    # return Â
end

Here are examples of current imputors :)

@madeleineudell
Copy link
Owner

This is a great idea. I wouldn't do this instead of but in addition to the methods defined internally, in a separate file. (It's better not to be too dependent on dependencies.)

I'd welcome this as a PR; it would be an easy project for someone looking to contribute to this package.

@rofinn
Copy link
Contributor

rofinn commented Jul 28, 2019

✋ I can take a look at adding this. I'd like to work on getting the CI passing first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants