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

LIBSVM.jl webpage : example not working #50

Closed
FredSoftwares opened this issue Mar 19, 2020 · 1 comment · Fixed by #58
Closed

LIBSVM.jl webpage : example not working #50

FredSoftwares opened this issue Mar 19, 2020 · 1 comment · Fixed by #58

Comments

@FredSoftwares
Copy link

Hi,

The example on the LIBSVM.jl webpage gives some errors on my system.

LIBSVM v0.4.0
Julia 1.3.1

julia> labels = convert(Vector, iris[:Species])
┌ Warning: `getindex(df::DataFrame, col_ind::ColumnIndex)` is deprecated, use `df[!, col_ind]` instead.
│   caller = top-level scope at REPL[9]:1
└ @ Core REPL[9]:1
150-element Array{CategoricalString{UInt8},1}:
 "setosa"   
 "setosa"       
 "setosa"   
 ⋮          
 "virginica"
 "virginica"
 "virginica"

julia> instances = convert(Array, iris[:, 1:4])'
4×150 LinearAlgebra.Adjoint{Float64,Array{Float64,2}}:
 5.1  4.9  4.7  4.6  5.0  5.4  4.6  5.0  4.4  4.9  …  6.9  5.8  6.8  6.7  6.7  6.3  6.5  6.2  5.9
 3.5  3.0  3.2  3.1  3.6  3.9  3.4  3.4  2.9  3.1     3.1  2.7  3.2  3.3  3.0  2.5  3.0  3.4  3.0
 1.4  1.4  1.3  1.5  1.4  1.7  1.4  1.5  1.4  1.5     5.1  5.1  5.9  5.7  5.2  5.0  5.2  5.4  5.1
 0.2  0.2  0.2  0.2  0.2  0.4  0.3  0.2  0.2  0.1     2.3  1.9  2.3  2.5  2.3  1.9  2.0  2.3  1.8

julia> model = svmtrain(instances[:, 1:2:end], labels[1:2:end]);
ERROR: MethodError: no method matching LIBSVM.SupportVectors(::Int32, ::Array{Int32,1}, ::CategoricalArray{String,1,UInt8,String,CategoricalString{UInt8},Union{}}, ::Array{Float64,2}, ::Array{Int32,1}, ::Array{LIBSVM.SVMNode,1})
Closest candidates are:
  LIBSVM.SupportVectors(::Int32, ::Array{Int32,1}, ::Array{T,1}, ::AbstractArray{U,2}, ::Array{Int32,1}, ::Array{LIBSVM.SVMNode,1}) where {T, U} at /home/fred/.julia/packages/LIBSVM/5Z99T/src/LIBSVM.jl:18
  LIBSVM.SupportVectors(::LIBSVM.SVMModel, ::Any, ::Any) at /home/fred/.julia/packages/LIBSVM/5Z99T/src/LIBSVM.jl:27
@tawheeler
Copy link

Same issue today with a clean package install.

iblislin pushed a commit that referenced this issue Jan 30, 2021
Update the usage in README.

Closes #50.
Closes #55.
Closes #57.
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