relevanceai.operations.auto.dr
#
Module Contents#
- class relevanceai.operations.auto.dr.DimensionalityReduction(*args, **kw)#
A Pandas Like datatset API for interacting with the RelevanceAI python package
- auto_reduce_dimensions(self, alias: str, vector_fields: list, filters: Optional[list] = None, number_of_documents: Optional[int] = None)#
Run dimensionality reduction quickly on a dataset on a small number of documents. This is useful if you want to quickly see a projection of your dataset.
Warning
This function is currently in beta and is likely to change in the future. We recommend not using this in any production systems.
- Parameters
vector_fields (list) – The vector fields to run dimensionality reduction on
number_of_documents (int) – The number of documents to get
algorithm (str) – The algorithm to run. The only supported algorithm is pca at this current point in time.
n_components (int) – The number of components
Example
from relevanceai import Client client = Client() df = client.Dataset("sample") df.auto_reduce_dimensions( "pca-3", ["sample_vector_"], )
- reduce_dimensions(self, vector_fields: list, alias: str, number_of_documents: int = 1000, algorithm: str = 'pca', n_components: int = 3, filters: Optional[list] = None)#
Run dimensionality reduction quickly on a dataset on a small number of documents. This is useful if you want to quickly see a projection of your dataset.
Warning
This function is currently in beta and is likely to change in the future. We recommend not using this in any production systems.
- Parameters
vector_fields (list) – The vector fields to run dimensionality reduction on
number_of_documents (int) – The number of documents to get
algorithm (str) – The algorithm to run. The only supported algorithm is pca at this current point in time.
n_components (int) – The number of components
Example
from relevanceai import Client client = Client() df = client.Dataset("sample") df.auto_reduce_dimensions( alias="pca-3", ["sample_vector_"], number_of_documents=1000 )