juliaml / liblinear.jl Goto Github PK
View Code? Open in Web Editor NEWLIBLINEAR bindings for Julia
License: Other
LIBLINEAR bindings for Julia
License: Other
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)
Currently only for 64 bit.
todo.
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.
todo.
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
Needed follow up after recent transfer of ownership.
The tag name "0.4.0" is not of the appropriate SemVer form (vX.Y.Z).
cc: @innerlee
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!
The REQUIRE file could not be found.
cc: @innerlee
in the next major version.
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.
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
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?
Remove unnecessary info to save memory.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.