lalvim / PartialLeastSquaresRegressor.jl

Implementation of a Partial Least Squares Regressor
MIT License
40 stars 8 forks source link

check_constant_cols doesn't work on Adjoint #9

Closed tbenst closed 4 years ago

tbenst commented 4 years ago
julia> PLSRegressor.fit(rand(3,3)', rand(3,3),nfactors=1)
PLSRegressor.PLS2Model{Float64}([-0.24304924768468017; -0.7652241603951436; 0.5961199942523806], [0.5000828333756707; 0.8403325816466939; 0.20918487513671646], [-1.014428813230312; -0.5140513192948163; 1.5284801325251283], [-0.5833408395500677; -0.6270781681635975; 0.6347112774551629], 1, [0.38126711006014835 0.7374788535159716 0.5745868740183244], [0.4833154788820418 0.3610395095534553 0.5343679246337361], [0.416986758761901 0.25893432832014807 0.23456254998816195], [0.4338424499764614 0.2871044566173785 0.1631054938683769], 3, 3, true)
julia> PLSRegressor.fit(rand(3,3), rand(3,3)',nfactors=1)
ERROR: MethodError: no method matching check_constant_cols(::Adjoint{Float64,Array{Float64,2}})
Closest candidates are:
  check_constant_cols(::Array{T,2}) where T<:AbstractFloat at /home/tyler/.julia/packages/PLSRegressor/w4SF2/src/utils.jl:31
  check_constant_cols(::Array{T,1}) where T<:AbstractFloat at /home/tyler/.julia/packages/PLSRegressor/w4SF2/src/utils.jl:32
Stacktrace:
 [1] fit(::Array{Float64,2}, ::Adjoint{Float64,Array{Float64,2}}; nfactors::Int64, copydata::Bool, centralize::Bool, kernel::String, width::Float64) at /home/tyler/.julia/packages/PLSRegressor/w4SF2/src/method.jl:27
 [2] top-level scope at REPL[445]:1
lalvim commented 4 years ago

The new version (branch MLJ) with interface MLJ no longer presents this problem. Thank you.