@@ -41,14 +41,27 @@ def test_kmeans(sagemaker_session):
4141 k = 10 , sagemaker_session = sagemaker_session , base_job_name = 'test-kmeans' )
4242
4343 kmeans .init_method = 'random'
44- kmeans .max_iterators = 1
44+ kmeans .max_iterations = 1
4545 kmeans .tol = 1
4646 kmeans .num_trials = 1
4747 kmeans .local_init_method = 'kmeans++'
4848 kmeans .half_life_time_size = 1
4949 kmeans .epochs = 1
5050 kmeans .center_factor = 1
5151
52+ assert kmeans .hyperparameters () == dict (
53+ init_method = kmeans .init_method ,
54+ local_lloyd_max_iter = str (kmeans .max_iterations ),
55+ local_lloyd_tol = str (kmeans .tol ),
56+ local_lloyd_num_trials = str (kmeans .num_trials ),
57+ local_lloyd_init_method = kmeans .local_init_method ,
58+ half_life_time_size = str (kmeans .half_life_time_size ),
59+ epochs = str (kmeans .epochs ),
60+ extra_center_factor = str (kmeans .center_factor ),
61+ k = str (kmeans .k ),
62+ force_dense = 'True' ,
63+ )
64+
5265 kmeans .fit (kmeans .record_set (train_set [0 ][:100 ]))
5366
5467 endpoint_name = name_from_base ('kmeans' )
@@ -80,14 +93,27 @@ def test_async_kmeans(sagemaker_session):
8093 k = 10 , sagemaker_session = sagemaker_session , base_job_name = 'test-kmeans' )
8194
8295 kmeans .init_method = 'random'
83- kmeans .max_iterators = 1
96+ kmeans .max_iterations = 1
8497 kmeans .tol = 1
8598 kmeans .num_trials = 1
8699 kmeans .local_init_method = 'kmeans++'
87100 kmeans .half_life_time_size = 1
88101 kmeans .epochs = 1
89102 kmeans .center_factor = 1
90103
104+ assert kmeans .hyperparameters () == dict (
105+ init_method = kmeans .init_method ,
106+ local_lloyd_max_iter = str (kmeans .max_iterations ),
107+ local_lloyd_tol = str (kmeans .tol ),
108+ local_lloyd_num_trials = str (kmeans .num_trials ),
109+ local_lloyd_init_method = kmeans .local_init_method ,
110+ half_life_time_size = str (kmeans .half_life_time_size ),
111+ epochs = str (kmeans .epochs ),
112+ extra_center_factor = str (kmeans .center_factor ),
113+ k = str (kmeans .k ),
114+ force_dense = 'True' ,
115+ )
116+
91117 kmeans .fit (kmeans .record_set (train_set [0 ][:100 ]), wait = False )
92118 training_job_name = kmeans .latest_training_job .name
93119
0 commit comments