# LIBLINEAR.jl **Repository Path**: Julialang/LIBLINEAR.jl ## Basic Information - **Project Name**: LIBLINEAR.jl - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-03-12 - **Last Updated**: 2022-03-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LIBLINEAR [![Build Status](https://travis-ci.org/innerlee/LIBLINEAR.jl.svg?branch=master)](https://travis-ci.org/innerlee/LIBLINEAR.jl) [![Build status](https://ci.appveyor.com/api/projects/status/x9jq6w5mji1u6eff?svg=true)](https://ci.appveyor.com/project/innerlee/liblinear-jl) Julia bindings for [LIBLINEAR](https://www.csie.ntu.edu.tw/~cjlin/liblinear/). ```julia using RDatasets # Load Fisher's classic iris data iris = dataset("datasets", "iris") # LIBLINEAR handles multi-class data automatically using a one-against-the rest strategy labels = iris[:Species] # First dimension of input data is features; second is instances instances = convert(Array,iris[:, 1:4])' # Train SVM on half of the data using default parameters. See the linear_train # function in LIBLINEAR.jl for optional parameter settings. model = linear_train(labels[1:2:end], instances[:, 1:2:end], verbose=true); # Test model on the other half of the data. (predicted_labels, decision_values) = linear_predict(model, instances[:, 2:2:end]); # Compute accuracy @printf "Accuracy: %.2f%%\n" mean((predicted_labels .== labels[2:2:end]))*100 ``` ## Credits Created by Zhizhong Li. This package is adapted from the [LIBSVM](https://github.com/simonster/LIBSVM.jl) Julia package by Simon Kornblith.