diff options
author | Calvin <calvin@EESI> | 2013-03-26 13:54:21 -0400 |
---|---|---|
committer | Calvin <calvin@EESI> | 2013-03-26 13:54:21 -0400 |
commit | 63f3535a58191997dd2f9704dda635a3bf3f8fce (patch) | |
tree | e79c10f48aa47c13ef83c54ca5836ff46760e8fa /test/create_digits_data.py | |
parent | eac04614526d7d619822bbabf46543053e5e7200 (diff) |
moved out of src, added a basic setup.py
Diffstat (limited to 'test/create_digits_data.py')
-rw-r--r-- | test/create_digits_data.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/create_digits_data.py b/test/create_digits_data.py new file mode 100644 index 0000000..891eea8 --- /dev/null +++ b/test/create_digits_data.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +from sklearn import datasets + +digits = datasets.load_digits() # load the data from scikits +data = digits.images.reshape((digits.images.shape[0], -1)) +labels = digits.target # extract the labels + +fw = open('digit.txt', 'w') + +for n in range(len(data)): + mstr = '' + for x in data[n]: + mstr += str(x) + '\t' + fw.write(mstr + str(labels[n]) + '\n') + +fw.close()
\ No newline at end of file |