Skip to content

Commit d47face

Browse files
committed
Removed the inertia for Kmeans.
1 parent 34a30c7 commit d47face

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

sklbench/benchmarks/sklearn_estimator.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -191,19 +191,6 @@ def get_subset_metrics_of_estimator(
191191
}
192192
)
193193
elif task == "clustering":
194-
if hasattr(estimator_instance, "inertia_"):
195-
# compute inertia manually using distances to cluster centers
196-
# provided by KMeans.transform
197-
metrics.update(
198-
{
199-
"inertia": float(
200-
np.power(
201-
convert_to_numpy(estimator_instance.transform(x)).min(axis=1),
202-
2,
203-
).sum()
204-
)
205-
}
206-
)
207194
if hasattr(estimator_instance, "predict"):
208195
y_pred = convert_to_numpy(estimator_instance.predict(x))
209196
metrics.update(

0 commit comments

Comments
 (0)