- Python Data Science Essentials
- Alberto Boschetti Luca Massaron
- 219字
- 2021-08-13 15:19:37
LIBSVM data examples
LIBSVM Data (http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/) is a page that gathers data from many other collections. It is maintained by Chih-Jen Lin, one of the authors of LIBSVM, a support vector machines learning algorithm for predictions (Chih-Chung Chang and Chih-Jen Lin,
LIBSVM : a library for support vector machines. ACM Transactions on Intelligent Systems and Technology, 2:27:1--27:27, 2011
). This offers different regression, binary, and multilabel classification datasets that are stored in the LIBSVM format. This repository is quite interesting if you wish to experiment with the support vector machine's algorithm, and, again, it is free for you to download and use the data.
If you want to load a dataset, first go to the web page where you can visualize the data on your browser. In the case of our example, visit http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/a1a and note down the address (a1a is a dataset that's originally from the UC Irvine Machine Learning Repository, another open source data repository). Then, you can proceed by performing a direct download using that address:
In: import urllib2
url =
'http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/a1a'
a2a = urllib2.urlopen(url)
In: from sklearn.datasets import load_svmlight_file
X_train, y_train = load_svmlight_file(a2a)
print (X_train.shape, y_train.shape)
Out: (1605, 119) (1605,)
In return, you will get two single objects: a set of training examples in a sparse matrix format and an array of responses.
- 32位嵌入式系統(tǒng)與SoC設(shè)計(jì)導(dǎo)論
- Hands-On Internet of Things with MQTT
- Splunk 7 Essentials(Third Edition)
- SCRATCH與機(jī)器人
- 樂高機(jī)器人EV3設(shè)計(jì)指南:創(chuàng)造者的搭建邏輯
- Hands-On Linux for Architects
- 數(shù)據(jù)挖掘方法及天體光譜挖掘技術(shù)
- STM32嵌入式微控制器快速上手
- C語言寶典
- 網(wǎng)絡(luò)綜合布線設(shè)計(jì)與施工技術(shù)
- R Data Analysis Projects
- 電動(dòng)汽車驅(qū)動(dòng)與控制技術(shù)
- PostgreSQL 10 High Performance
- 實(shí)戰(zhàn)突擊
- 案例解說虛擬儀器典型控制應(yīng)用