Code Monkey home page Code Monkey logo

liblinear.jl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

liblinear.jl's Issues

Minimum supported Julia version

The current CI runs tests for Julia 1.3, for which the dependencies cannot be satisfied due to liblinear_jll 2.47 requiring at least Julia 1.6:

 ERROR: LoadError: Unsatisfiable requirements detected for package liblinear_jll [275f1f90]:
 liblinear_jll [275f1f90] log:
 ├─possible versions are: [2.30.0, 2.47.0] or uninstalled
 ├─restricted to versions 2.47 by an explicit requirement, leaving only versions 2.47.0
 └─restricted by julia compatibility requirements to versions: 2.30.0 or uninstalled — no versions left

Do we need to support (and run tests for) Julia 1.3? The current LTS version is 1.6.7.

(CC @ericphanson @ablaom)

Turn on precompilation

I noticed this while running an automatic "recompile everything" script: since this package is used by others for which __precompile__(true), this package needs it too.

Crash due to misaligned pointer

Validation: Error During Test at /home/vchuravy/.julia/packages/LIBLINEAR/77yny/test/validation.jl:1
  Got exception outside of a @test
  ArgumentError: unsafe_wrap: pointer 0x400000003 is not properly aligned to 4 bytes
  Stacktrace:
    [1] #unsafe_wrap#110
      @ Base ./pointer.jl:114 [inlined]
    [2] unsafe_wrap
      @ Base ./pointer.jl:112 [inlined]
    [3] linear_train(labels::Vector{String}, instances::Matrix{Float64}; weights::Nothing, solver_type::Int32, eps::Float64, C::Float64, p::Float64, init_sol::Ptr{Float64}, bias::Float64, verbose::Bool)
      @ LIBLINEAR ~/.julia/packages/LIBLINEAR/77yny/src/LIBLINEAR.jl:239
    [4] macro expansion
      @ ~/.julia/packages/LIBLINEAR/77yny/test/validation.jl:2 [inlined]
    [5] macro expansion
      @ ~/builds/julia/usr/share/julia/stdlib/v1.11/Test/src/Test.jl:1598 [inlined]
    [6] top-level scope
      @ ~/.julia/packages/LIBLINEAR/77yny/test/validation.jl:2
    [7] include(fname::String)
      @ Main ./sysimg.jl:38
    [8] top-level scope
      @ ~/.julia/packages/LIBLINEAR/77yny/test/runtests.jl:11
    [9] include(fname::String)
      @ Main ./sysimg.jl:38
   [10] top-level scope
      @ none:6
   [11] eval
      @ Core ./boot.jl:428 [inlined]
   [12] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:291
   [13] _start()
      @ Base ./client.jl:525
Test Summary: | Error  Total  Time
Validation    |     1      1  3.0s
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /home/vchuravy/.julia/packages/LIBLINEAR/77yny/test/validation.jl:1
in expression starting at /home/vchuravy/.julia/packages/LIBLINEAR/77yny/test/runtests.jl:11

While trying to look into a failure in PkgEval: https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/96c4164_vs_fd41af5/LIBLINEAR.primary.log

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

transfer to JuliaML?

If you are open to it @innerlee I think it could make sense to transfer the repo to JuliaML (where LIBSVM.jl is) so there are more folks with access to it to help maintain it. (You would still have admin rights to the repo itself). If you are up for I am sure I can find a JuliaML member to help transfer.

prediction crashes with illegal index

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

Mac M1 support

Hello, I tried to rebuild and update liblinear_jll.jl to the latest version of the liblinear 2.45 with Mac M1 support. I prepared a patch rssdev10/Yggdrasil@0053178 and deployed all the binaries liblinear_jll.jl. But, API a little bit changed compared with 2.30.

E.g. struct model got a new field double rho; /* one-class SVM only */ . The method check_parameter gives an error Initial-solution specification supported only for solvers L2R_LR, L2R_L2LOSS_SVC, and L2R_L2LOSS_SVR. Maybe something other was also changed, but I'm not familiar with liblinear.

Who can help in aligning the julia-wrapper for the new binaries?

Serializing the model

Hey, thanks for making a wrapper for liblinear! It's awesome. I am trying to use it in a distributed setting, and it would be awesome if you could implement a method for serializing the LinearModel{T} class.

Weights is not working

The weights key on linear_train is not working.

using RDatasets, LIBLINEAR

# Load Fisher's classic iris data
iris = dataset("datasets", "iris")

# LIBSVM handles multi-class data automatically using a one-against-one strategy
labels = convert(Vector, iris[:Species])

# First dimension of input data is features; second is instances
inst = convert(Matrix, iris[:, 1:4])'

wei = unique(labels[1:2:end])
model = linear_train(labels[1:2:end], inst[:, 1:2:end]; weights=Dict(wei[1]=> 0.5, wei[2]=> 1., wei[3] => 3.), verbose=true)

output:

ERROR: MethodError: no method matching grp2idx(::Type{Int32}, ::Base.KeySet{CategoricalString{UInt8},Dict{CategoricalString{UInt8},Float64}}, ::Dict{CategoricalString{UInt8},Int32}, ::Array{CategoricalString{UInt8},1})
Closest candidates are:
  grp2idx(::Type{S<:Real}, ::AbstractArray{T,1} where T, ::Dict{T,Int32}, ::Array{T,1}) where {T, S<:Real} at /home/tas/.julia/packages/LIBLINEAR/xcSKN/src/LIBLINEAR.jl:115
Stacktrace:
 [1] indices_and_weights(::Array{CategoricalString{UInt8},1}, ::Array{Float64,2}, ::Dict{CategoricalString{UInt8},Float64}) at /home/tas/.julia/packages/LIBLINEAR/xcSKN/src/LIBLINEAR.jl:149
 [2] #linear_train#1(::Dict{CategoricalString{UInt8},Float64}, ::Int32, ::Float64, ::Float64, ::Float64, ::Ptr{Float64}, ::Float64, ::Bool, ::typeof(linear_train), ::Array{CategoricalString{UInt8},1}, ::Array{Float64,2}) at /home/tas/.julia/packages/LIBLINEAR/xcSKN/src/LIBLINEAR.jl:235
 [3] (::getfield(LIBLINEAR, Symbol("#kw##linear_train")))(::NamedTuple{(:weights, :verbose),Tuple{Dict{CategoricalString{UInt8},Float64},Bool}}, ::typeof(linear_train), ::Array{CategoricalString{UInt8},1}, ::Array{Float64,2}) at ./none:0
 [4] top-level scope at none:0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.