diff options
author | Calvin <calvin@EESI> | 2013-03-26 13:44:35 -0400 |
---|---|---|
committer | Calvin <calvin@EESI> | 2013-03-26 13:44:35 -0400 |
commit | eac04614526d7d619822bbabf46543053e5e7200 (patch) | |
tree | 5e4be62de68126cb9569b03ece6666ff391ea417 /src/test/create_digits_data.py | |
parent | 94da049a53423a9aca04d8376b75347ca7eadcbe (diff) |
renamed a bunch of stuff
Diffstat (limited to 'src/test/create_digits_data.py')
-rw-r--r-- | src/test/create_digits_data.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/create_digits_data.py b/src/test/create_digits_data.py new file mode 100644 index 0000000..891eea8 --- /dev/null +++ b/src/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 |