relevanceai.operations_new.cluster.batch.transform#

TransformBase

Module Contents#

class relevanceai.operations_new.cluster.batch.transform.BatchClusterTransform(vector_fields: list, model: Any, model_kwargs: dict, *args, **kwargs)#

To write your own operation, you need to add: - name - transform

partial_fit(self, documents: List, model_kwargs=None)#

Run partial fitting on a list of documents

property name(self)#

abstractproperty for name

property full_cluster_field(self)#
transform(self, documents: List[Dict[str, Any]]) List[Dict[str, Any]]#

It takes a list of documents, and for each document, it runs the document through each of the models in the pipeline, and returns the updated documents.

Parameters

documents (List[Dict[str, Any]]) – List[Dict[str, Any]]

Return type

A list of dictionaries.

predict_documents(self, documents, warm_start=False)#

If warm_start=True, copies the values from the previous fit. Only works for cluster models that use centroids. You should not have to use this parameter.