from sklearn.datasets import *
data = load_sample_images(); first_img = data.images[0]
print(first_img.shape,
first_img.dtype)
(427, 640, 3) uint8
china = load_sample_image("china.jpg")
flowr = load_sample_image("flower.jpg")
import matplotlib.pyplot as plt
plt.figure(1); plt.imshow(china)
plt.figure(2); plt.imshow(flowr)
<matplotlib.image.AxesImage at 0x7fe715bfb2e0>
# example
# Xtrain,ytrain = load_svmlight_file("path")
# example
# Xtrain,ytrain,Xtest,ytest = load_svmlight_files("path","path",...)
data_id
- not necessarily by name# example: mice brain gene expressions
import numpy as np
mice = fetch_openml(name='miceprotein',version=4)
print(mice.data.shape)
print(mice.target.shape)
print(np.unique(mice.target))
print(mice.details)
print(mice.url)
(1080, 77) (1080,) ['c-CS-m' 'c-CS-s' 'c-SC-m' 'c-SC-s' 't-CS-m' 't-CS-s' 't-SC-m' 't-SC-s'] {'id': '40966', 'name': 'MiceProtein', 'version': '4', 'format': 'ARFF', 'upload_date': '2017-11-08T16:00:15', 'licence': 'Public', 'url': 'https://www.openml.org/data/v1/download/17928620/MiceProtein.arff', 'file_id': '17928620', 'default_target_attribute': 'class', 'row_id_attribute': 'MouseID', 'ignore_attribute': ['Genotype', 'Treatment', 'Behavior'], 'tag': ['OpenML-CC18', 'study_135', 'study_98', 'study_99'], 'visibility': 'public', 'minio_url': 'http://openml1.win.tue.nl/dataset40966/dataset_40966.pq', 'status': 'active', 'processing_date': '2018-10-04 00:49:58', 'md5_checksum': '3c479a6885bfa0438971388283a1ce32'} https://www.openml.org/d/40966