explicit model argument

This commit is contained in:
Si11ium
2020-06-19 13:35:37 +02:00
parent fe2bc131df
commit 49b373a8a1
3 changed files with 11 additions and 7 deletions

View File

@@ -110,7 +110,7 @@ def cluster_per_column(pc, column):
def cluster_cubes(data, cluster_dims, max_points_per_cluster=-1, min_points_per_cluster=-1):
if cluster_dims[0] is 1 and cluster_dims[1] is 1 and cluster_dims[2] is 1:
if cluster_dims[0] == 1 and cluster_dims[1] == 1 and cluster_dims[2] == 1:
print("no need to cluster.")
return [farthest_point_sampling(data, max_points_per_cluster)]
@@ -141,7 +141,7 @@ def cluster_cubes(data, cluster_dims, max_points_per_cluster=-1, min_points_per_
final_clusters = []
for key, cluster in clusters.items():
c = np.vstack(cluster)
if c.shape[0] < min_points_per_cluster and -1 is not min_points_per_cluster:
if c.shape[0] < min_points_per_cluster and -1 != min_points_per_cluster:
continue
if max_points_per_cluster is not -1:
@@ -171,7 +171,7 @@ def cluster_dbscan(data, selected_indices, eps, min_samples=5, metric='euclidean
clusters = {}
for idx, l in enumerate(labels):
if l is -1:
if l == -1:
continue
clusters.setdefault(str(l), []).append(data[idx, :])