Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python35
/
lib64
/
python3.5
/
site-packages
/
sklearn
/
datasets
/
__pycache__
/
File Content:
olivetti_faces.cpython-35.pyc
��(Xp � @ s d Z d d l m Z d d l m Z d d l m Z y d d l Z e j Z Wn* e k r{ d d l Z e j j Z Yn Xd d l Z d d l m Z d d l m Z m Z d d l m Z d d l m Z d d l m Z d Z d Z e Z d d d d d d � Z d S)a Modified Olivetti faces dataset. The original database was available from http://www.cl.cam.ac.uk/research/dtg/attarchive/facedatabase.html The version retrieved here comes in MATLAB format from the personal web page of Sam Roweis: http://www.cs.nyu.edu/~roweis/ There are ten different images of each of 40 distinct subjects. For some subjects, the images were taken at different times, varying the lighting, facial expressions (open / closed eyes, smiling / not smiling) and facial details (glasses / no glasses). All the images were taken against a dark homogeneous background with the subjects in an upright, frontal position (with tolerance for some side movement). The original dataset consisted of 92 x 112, while the Roweis version consists of 64x64 images. � )�BytesIO)�exists)�makedirsN)�loadmat� )� get_data_home�Bunch)� _pkl_filepath� )�check_random_state)�joblibz0http://cs.nyu.edu/~roweis/data/olivettifaces.matzolivetti.pkzFTc C s� t d | � } t | � s% t | � t | t � } t | � s� t d t | f � t t � } t | j � � } t | � } | d j j � } t j | | d d �~ n t j | � } t j | � } | | j � } | | j � } | j d � j d d d � } t j d d � t d � D� � } | rft | � } | j t | � � } | | } | | } t d | j t | � d � d | d | d t � S)a� Loader for the Olivetti faces data-set from AT&T. Read more in the :ref:`User Guide <olivetti_faces>`. Parameters ---------- data_home : optional, default: None Specify another download and cache folder for the datasets. By default all scikit learn data is stored in '~/scikit_learn_data' subfolders. shuffle : boolean, optional If True the order of the dataset is shuffled to avoid having images of the same person grouped. download_if_missing : optional, True by default If False, raise a IOError if the data is not locally available instead of trying to download the data from the source site. random_state : optional, integer or RandomState object The seed or the random number generator used to shuffle the data. Returns ------- An object with the following attributes: data : numpy array of shape (400, 4096) Each row corresponds to a ravelled face image of original size 64 x 64 pixels. images : numpy array of shape (400, 64, 64) Each row is a face image corresponding to one of the 40 subjects of the dataset. target : numpy array of shape (400, ) Labels associated to each face image. Those labels are ranging from 0-39 and correspond to the Subject IDs. DESCR : string Description of the modified Olivetti Faces Dataset. Notes ------ This dataset consists of 10 pictures each of 40 individuals. The original database was available from (now defunct) http://www.cl.cam.ac.uk/research/dtg/attarchive/facedatabase.html The version retrieved here comes in MATLAB format from the personal web page of Sam Roweis: http://www.cs.nyu.edu/~roweis/ � data_homez(downloading Olivetti faces from %s to %s�faces�compress� � �@ r r r c S s g | ] } | d � q S)� � )�.0�ir r �/olivetti_faces.py� <listcomp>� s z(fetch_olivetti_faces.<locals>.<listcomp>�dataZimages�targetZDESCR)r r r ���)r r r r �TARGET_FILENAME�print�DATA_URL�urlopenr �readr �T�copyr �dump�load�npZfloat32�min�maxZreshapeZ transpose�array�ranger Zpermutation�lenr �MODULE_DOCS)r �shuffleZrandom_stateZdownload_if_missing�filepathZfhandle�bufZmfiler r �orderr r r �fetch_olivetti_faces6 s8 7 " r0 )�__doc__�ior Zos.pathr �osr �urllib2r �ImportErrorZurllib.request�urllibZrequestZnumpyr% Zscipy.io.matlabr �baser r r Zutilsr Z externalsr r r r+ r0 r r r r �<module> s(
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
__init__.cpython-35.opt-1.pyc
3078 bytes
0644
__init__.cpython-35.pyc
3078 bytes
0644
base.cpython-35.opt-1.pyc
24686 bytes
0644
base.cpython-35.pyc
24686 bytes
0644
california_housing.cpython-35.opt-1.pyc
3623 bytes
0644
california_housing.cpython-35.pyc
3623 bytes
0644
covtype.cpython-35.opt-1.pyc
3595 bytes
0644
covtype.cpython-35.pyc
3595 bytes
0644
kddcup99.cpython-35.opt-1.pyc
12034 bytes
0644
kddcup99.cpython-35.pyc
12034 bytes
0644
lfw.cpython-35.opt-1.pyc
16547 bytes
0644
lfw.cpython-35.pyc
16547 bytes
0644
mlcomp.cpython-35.opt-1.pyc
3126 bytes
0644
mlcomp.cpython-35.pyc
3126 bytes
0644
mldata.cpython-35.opt-1.pyc
6339 bytes
0644
mldata.cpython-35.pyc
6339 bytes
0644
olivetti_faces.cpython-35.opt-1.pyc
4514 bytes
0644
olivetti_faces.cpython-35.pyc
4514 bytes
0644
rcv1.cpython-35.opt-1.pyc
7184 bytes
0644
rcv1.cpython-35.pyc
7184 bytes
0644
samples_generator.cpython-35.opt-1.pyc
51364 bytes
0644
samples_generator.cpython-35.pyc
51364 bytes
0644
setup.cpython-35.opt-1.pyc
814 bytes
0644
setup.cpython-35.pyc
814 bytes
0644
species_distributions.cpython-35.opt-1.pyc
7434 bytes
0644
species_distributions.cpython-35.pyc
7434 bytes
0644
svmlight_format.cpython-35.opt-1.pyc
15631 bytes
0644
svmlight_format.cpython-35.pyc
15631 bytes
0644
twenty_newsgroups.cpython-35.opt-1.pyc
12307 bytes
0644
twenty_newsgroups.cpython-35.pyc
12307 bytes
0644
N4ST4R_ID | Naxtarrr