o
    Ni                     @   sj   d Z ddlmZ ddlmZ ddlmZ ddlm  mZ ddl	m
Z dZdZdZG d	d
 d
ejjZdS )zIris dataset.    )absolute_import)division)print_functionNzHhttps://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.dataz@misc{Dua:2019 ,
author = "Dua, Dheeru and Graff, Casey",
year = "2017",
title = "{UCI} Machine Learning Repository",
url = "http://archive.ics.uci.edu/ml",
institution = "University of California, Irvine, School of Information and Computer Sciences"
}
a  This is perhaps the best known database to be found in the pattern recognition
literature. Fisher's paper is a classic in the field and is referenced
frequently to this day. (See Duda & Hart, for example.) The data set contains
3 classes of 50 instances each, where each class refers to a type of iris
plant. One class is linearly separable from the other 2; the latter are NOT
linearly separable from each other.
c                   @   s:   e Zd ZdZdZejddZdd Z	dd Z
d	d
 ZdS )IriszIris flower dataset.   z2.0.0z6New split API (https://tensorflow.org/datasets/splits)c              	   C   sB   t jj| tt jt jjdtjdt jj	g dddddt
dS )N)   )shapedtype)zIris-setosazIris-versicolorzIris-virginica)namesfeatureslabelz,https://archive.ics.uci.edu/ml/datasets/iris)builderdescriptionr   supervised_keyshomepagecitation)tfdscoreDatasetInfo_DESCRIPTIONr   FeaturesDictTensortffloat32
ClassLabel	_CITATION)self r   W/home/ubuntu/.local/lib/python3.10/site-packages/tensorflow_datasets/structured/iris.py_info6   s   z
Iris._infoc                 C   sH   | t}tjj|  }dd |D }tj	j
tjjd|idgS )Nc                 S   s   g | ]}|r|qS r   r   ).0lr   r   r   
<listcomp>K       z*Iris._split_generators.<locals>.<listcomp>records)name
gen_kwargs)downloadIRIS_URLr   iogfileGFileread
splitlinesr   r   SplitGeneratorSplitTRAIN)r   
dl_manager	iris_file	all_linesr%   r   r   r   _split_generatorsH   s   
zIris._split_generatorsc                 c   sH    t |D ]\}}|d}|dd |d d D |d dfV  qd S )N,c                 S   s   g | ]}t |qS r   )float)r!   er   r   r   r#   X   r$   z+Iris._generate_examples.<locals>.<listcomp>r   )	enumeratesplit)r   r%   irowelemsr   r   r   _generate_examplesT   s   
zIris._generate_examplesN)__name__
__module____qualname____doc__NUM_CLASSESr   r   VersionVERSIONr    r5   r?   r   r   r   r   r   0   s    r   )rC   
__future__r   r   r   tensorflow.compat.v2compatv2r   tensorflow_datasets.public_api
public_apir   r)   r   r   r   GeneratorBasedBuilderr   r   r   r   r   <module>   s   

