relevanceai.operations.cluster.utils#

Module Contents#

class relevanceai.operations.cluster.utils.ClusterUtils(*args, **kwargs)#

Batch API client

alias :str#
dataset_id :str#
vector_fields :List[Any]#
list_cluster_ids(self, alias: str = None, minimum_cluster_size: int = 3, dataset_id: str = None, num_clusters: int = 1000)#

List unique cluster IDS

Example

from relevanceai import Client
client = Client()
cluster_ops = client.ClusterOps(
    alias="kmeans_8", vector_fields=["sample_vector_]
)
cluster_ops.list_cluster_ids()
Parameters
  • alias (str) – The alias to use for clustering

  • minimum_cluster_size (int) – The minimum size of the clusters

  • dataset_id (str) – The dataset ID

  • num_clusters (int) – The number of clusters

list_unique(self, field: str = None, minimum_amount: int = 3, dataset_id: str = None, num_clusters: int = 1000)#

List unique cluster IDS

Example

from relevanceai import Client
client = Client()
cluster_ops = client.ClusterOps(
    alias="kmeans_8", vector_fields=["sample_vector_]
)
cluster_ops.list_unique()
Parameters
  • alias (str) – The alias to use for clustering

  • minimum_cluster_size (int) – The minimum size of the clusters

  • dataset_id (str) – The dataset ID

  • num_clusters (int) – The number of clusters