diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2020-07-25 23:19:41 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2020-07-26 12:43:12 +0200 |
commit | d218ef0097174897634477bcc180b6268ba6c337 (patch) | |
tree | 146874e86eb8514256a13480076a914c01231486 /clustering.py | |
parent | de339a8611548cfa3f9bd8bcdaa22afd2a6e062c (diff) |
Diffstat (limited to 'clustering.py')
-rw-r--r-- | clustering.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clustering.py b/clustering.py index 6df6643..d8b1ed9 100644 --- a/clustering.py +++ b/clustering.py @@ -9,7 +9,7 @@ from otsu2018 import load_Otsu2018_spectra, Otsu2018Tree if __name__ == '__main__': print('Loading spectral data...') - sds = load_Otsu2018_spectra('CommonData/spectrum_m.csv', every_nth=7) + sds = load_Otsu2018_spectra('CommonData/spectrum_m.csv', every_nth=100) shape = SpectralShape(380, 730, 10) print('Initializing the tree...') @@ -23,8 +23,9 @@ if __name__ == '__main__': print('Error before: %g' % before) print('Error after: %g' % after) - print('Saving the dataset...') - os.makedirs('datasets', exist_ok=True) + print('Saving the dataset...') + if not os.path.exists('datasets'): + os.makedirs('datasets') data = tree.to_dataset() data.to_file('datasets/otsu2018.npz') data.to_Python_file('datasets/otsu2018.py') |