Skip to content

Commit fb56421

Browse files
Add citation warning to Iris dataset, #7
1 parent 77a607d commit fb56421

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

extra_keras_datasets/iris.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@
1414
from tensorflow.keras.utils import get_file
1515
import numpy as np
1616
import math
17+
import logging
18+
19+
20+
def warn_citation():
21+
"""Warns about citation requirements
22+
# Returns
23+
Void
24+
"""
25+
logging.warning(("Please cite the following paper when using or"
26+
" referencing this Extra Keras Dataset:"))
27+
logging.warning(
28+
("Fisher,R.A. \"The use of multiple measurements in taxonomic "
29+
"problems\" Annual Eugenics, 7, Part II, 179-188 (1936); also "
30+
"in \"Contributions to Mathematical Statistics\" (John Wiley"
31+
", NY, 1950).")
32+
)
1733

1834

1935
def load_data(path="iris.npz", test_split=0.2):
@@ -64,6 +80,9 @@ def load_data(path="iris.npz", test_split=0.2):
6480
target_train = [i[4] for i in training_data]
6581
target_test = [i[4] for i in testing_data]
6682

83+
# Warn about citation
84+
warn_citation()
85+
6786
# Return data
6887
return (input_train, target_train), (input_test, target_test)
6988

0 commit comments

Comments
 (0)