Skip to main content

Convert LIBSVM data to csv format.

Project description

libsvm2csv

Installation

pip install libsvm2csv

Convert LIBSVM format into CSV

from libsvm2csv import convert
convert("libsvm-data.txt", "data.csv")

libsvm-data.txt

1 qid:1 2:0.14  4:0.97  5:0.45
0 qid:1 1:0.15  3:0.75  2:0.24  4:0.6
2 qid:1 1:0.71  2:0.36  3:0.58  5:0.12
0 qid:2 4:0.79  3:0.01  2:0.05  5:0.27
3 qid:2 1:0.42  2:0.79  3:0.30  4:0.76

data.csv

index,target,qid,1,2,3,4,5
0,1,1,0,0.14,0,0.97,0.45
1,0,1,0.15,0.24,0.75,0.6,0
2,2,1,0.71,0.36,0.58,0,0.12
3,0,2,0,0.05,0.01,0.79,0.27
4,3,2,0.42,0.79,0.30,0.76,0

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

libsvm2csv-0.1.4.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file libsvm2csv-0.1.4.tar.gz.

File metadata

  • Download URL: libsvm2csv-0.1.4.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5

File hashes

Hashes for libsvm2csv-0.1.4.tar.gz
Algorithm Hash digest
SHA256 aee48a6f90478084965650f59e5204d94393a968327772c9e6ea7bbded1d7c11
MD5 704d073570f3097510eb7394361bab40
BLAKE2b-256 8cbc151c5dbeba14f98e23281ddb6191edcf666832c271b4d36a5ed498e1593c

See more details on using hashes here.

Supported by

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