ReadLIBSVM.jl
ReadLIBSVM.jl is Julia package exporting read_libsvm function to parse data stored in the LIBSVM format:
<label> <query> <feature_id_1>:<feature_value_1> <feature_id_2>:<feature_value_2>Installation
Latest:
julia> Pkg.add(url="https://github.com/jeremiedb/ReadLIBSVM.jl")From General Registry:
julia> Pkg.add("ReadLIBSVM")Usage
Two methods are supported by read_libsvm:
- A path
Stringto the file to be parsed - A
Vector{UInt8}containing the raw binary data (as returned by functions likereador returned from an API like AWS S3)
path = download("https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass/wine.scale")
data = read_libsvm(path)For datasets containing a query id, use the has_query kwarg:
read_libsvm(path; has_query=true)