- 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.
- TIBCO Spotfire:A Comprehensive Primer(Second Edition)
- 機(jī)器人智能運(yùn)動規(guī)劃技術(shù)
- 工業(yè)機(jī)器人工程應(yīng)用虛擬仿真教程:MotoSim EG-VRC
- Visual C# 2008開發(fā)技術(shù)詳解
- Photoshop CS3圖層、通道、蒙版深度剖析寶典
- Learn CloudFormation
- 水下無線傳感器網(wǎng)絡(luò)的通信與決策技術(shù)
- 網(wǎng)中之我:何明升網(wǎng)絡(luò)社會論稿
- 單片機(jī)C語言應(yīng)用100例
- 電子設(shè)備及系統(tǒng)人機(jī)工程設(shè)計(第2版)
- 嵌入式GUI開發(fā)設(shè)計
- Hands-On Dashboard Development with QlikView
- 基于RPA技術(shù)財務(wù)機(jī)器人的應(yīng)用與研究
- MPC5554/5553微處理器揭秘
- Learning Cassandra for Administrators