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

prediction crashes with illegal index #37

Open
pevnak opened this issue Apr 29, 2024 · 1 comment · May be fixed by #38
Open

prediction crashes with illegal index #37

pevnak opened this issue Apr 29, 2024 · 1 comment · May be fixed by #38

Comments

@pevnak
Copy link

pevnak commented Apr 29, 2024

Hi All,

I am having an issue with regression using liblinear. It crashes with illegal index

MWE is as follows:

using LIBLINEAR
x = randn(200,10000);
y = randn(10000);
model = linear_train(y,x; solver_type = LIBLINEAR.L2R_L2LOSS_SVR);
linear_predict(model, x)

which outputs error

ERROR: BoundsError: attempt to access 10000-element Vector{Float64} at index [-791]
Stacktrace:
 [1] getindex
   @ ./essentials.jl:13 [inlined]
 [2] linear_predict(model::LinearModel{Float64}, instances::Matrix{Float64}; probability_estimates::Bool, verbose::Bool)
   @ LIBLINEAR ~/.julia/packages/LIBLINEAR/Gc5Us/src/LIBLINEAR.jl:313
 [3] linear_predict(model::LinearModel{Float64}, instances::Matrix{Float64})
   @ LIBLINEAR ~/.julia/packages/LIBLINEAR/Gc5Us/src/LIBLINEAR.jl:261
 [4] top-level scope
   @ REPL[6]:1

I am using AMD processor.
the version of julia is

julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 64 × AMD EPYC 73F3 16-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
  Threads: 1 on 64 virtual cores
Environment:
  LD_LIBRARY_PATH = /mnt/appl/software/Julia/1.10.0-linux-x86_64/lib

and the version of LIBLINEAR is 0.7.0

Thanks for help

@barucden barucden linked a pull request May 4, 2024 that will close this issue
@barucden
Copy link
Member

barucden commented May 4, 2024

Thanks for the report. I can reproduce it: regression models have not been supported. I proposed an implementation in #38 but there's a problem. See the PR's message.

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 a pull request may close this issue.

2 participants