We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
selectcols
selectcols seems to expect AbstractVector input though sometimes this may not be the output type of schema(...).names:
AbstractVector
schema(...).names
julia> using MLJBase julia> import MLJModelInterface as MMI julia> X = (; x1=ones(3), x2=ones(3), x3=ones(3)); julia> MMI.selectcols(X, MMI.schema(X).names) # Fails ERROR: MethodError: no method matching _selectcols(::MLJModelInterface.FullInterface, ::Val{…}, ::@NamedTuple{…}, ::Tuple{…}) The function `_selectcols` exists, but no method is defined for this combination of argument types. Closest candidates are: _selectcols(::Union{MLJModelInterface.FullInterface, MLJModelInterface.LightInterface}, ::Val{:other}, ::Any, ::Any) @ MLJModelInterface ~/.julia/packages/MLJModelInterface/y9x5A/src/data_utils.jl:381 _selectcols(::Union{MLJModelInterface.FullInterface, MLJModelInterface.LightInterface}, ::Val{:other}, ::Nothing, ::Any) @ MLJModelInterface ~/.julia/packages/MLJModelInterface/y9x5A/src/data_utils.jl:379 _selectcols(::Union{MLJModelInterface.FullInterface, MLJModelInterface.LightInterface}, ::Val{:other}, ::AbstractMatrix, ::Any) @ MLJModelInterface ~/.julia/packages/MLJModelInterface/y9x5A/src/data_utils.jl:377 ... Stacktrace: [1] selectcols(m::MLJModelInterface.FullInterface, v::Val{…}, X::@NamedTuple{…}, r::Tuple{…}) @ MLJModelInterface ~/.julia/packages/MLJModelInterface/y9x5A/src/data_utils.jl:374 [2] selectcols(X::@NamedTuple{x1::Vector{…}, x2::Vector{…}, x3::Vector{…}}, c::Tuple{Symbol, Symbol, Symbol}) @ MLJModelInterface ~/.julia/packages/MLJModelInterface/y9x5A/src/data_utils.jl:370 [3] top-level scope @ REPL[12]:1 Some type information was truncated. Use `show(err)` to see complete types. julia> MMI.selectcols(X, collect(MMI.schema(X).names)) # Works (x1 = [1.0, 1.0, 1.0], x2 = [1.0, 1.0, 1.0], x3 = [1.0, 1.0, 1.0],)
The text was updated successfully, but these errors were encountered:
:class
X
It seems this is needed to avoid type instabilities in some applications, right?
Sorry, something went wrong.
Yeah exactly
address selectcols issue #991
6b8b899
OkonSamuel
Successfully merging a pull request may close this issue.
selectcols
seems to expectAbstractVector
input though sometimes this may not be the output type ofschema(...).names
:The text was updated successfully, but these errors were encountered: