Skip to content
Snippets Groups Projects
Commit 41a3ec6a authored by paul.tresson_ird.fr's avatar paul.tresson_ird.fr
Browse files

fix random state for clustering

parent b692fe73
No related branches found
No related tags found
No related merge requests found
......@@ -170,7 +170,7 @@ class ClusterAlgorithm(QgsProcessingAlgorithm):
input_bands = [i_band -1 for i_band in self.selected_bands]
if self.method == 'K-means':
proj = KMeans(int(self.nclusters))
proj = KMeans(int(self.nclusters), random_state=RANDOM_SEED)
save_file = 'kmeans_cluster.pkl'
params = proj.get_params()
iter = range(proj.max_iter)
......
......@@ -29,7 +29,7 @@ class TestClusteringAlgorithm(unittest.TestCase):
break
md5.update(data)
result_file_hash = md5.hexdigest()
assert result_file_hash == '57684e8ce6c051e3357c2f9f308740bf'
assert result_file_hash == '835bcb7ab7d7e97d2de26e81415a0d19'
os.remove(expected_result_path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment