Skip to main content

Pre-built LibSVM packages for Python.

Project description

https://travis-ci.com/ocampor/libsvm.svg?branch=master

LibSVM

Description

Pre-built LibSVM packages for Python.

What is LibSVM?

Crated by Chih-Chung Chang and Chih-Jen Lin, LIBSVM is an integrated software for support vector classification, (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and distribution estimation (one-class SVM). It supports multi-class classification.

Purpose of this package

The idea behind this package is to use the same code as in https://github.com/cjlin1/libsvm using the very convenient pip command

How to install

pip install libsvm

Example

  1. Download https://github.com/cjlin1/libsvm/blob/master/heart_scale file.

  2. Run the following commands

>>> from libsvm.svmutil import *
>>> y, x = svm_read_problem('path/to/heart_scale')
>>> m = svm_train(y[:200], x[:200], '-c 4')
*.*
optimization finished, #iter = 257
nu = 0.351161
obj = -225.628984, rho = 0.636110
nSV = 91, nBSV = 49
Total nSV = 91
>>> p_label, p_acc, p_val = svm_predict(y[200:], x[200:], m)
Accuracy = 84.2857% (59/70) (classification)

Maintainer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libsvm-3.23.0-a1.tar.gz (29.5 kB view details)

Uploaded Source

File details

Details for the file libsvm-3.23.0-a1.tar.gz.

File metadata

  • Download URL: libsvm-3.23.0-a1.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.7

File hashes

Hashes for libsvm-3.23.0-a1.tar.gz
Algorithm Hash digest
SHA256 0580df1024136175682a7f7c8114ebfa8c6ecb702e2d59b8343282cbb6691925
MD5 a20dbfd89e15d9608b1322a421d44ac9
BLAKE2b-256 3b8accabe72776cf9fffcd892bf06136646a60ffd3fd381a8759a3ffbea78856

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page