hyrax.verbs.reduce_dimensions
=============================

.. py:module:: hyrax.verbs.reduce_dimensions


Attributes
----------

.. autoapisummary::

   hyrax.verbs.reduce_dimensions.logger


Classes
-------

.. autoapisummary::

   hyrax.verbs.reduce_dimensions.ReduceDimensions


Module Contents
---------------

.. py:data:: logger

.. py:class:: ReduceDimensions(config)

   Bases: :py:obj:`hyrax.verbs.verb_registry.Verb`


   Verb to reduce the dimensionality of a dataset

   .. py:method:: __init__

   Overall initialization for all verbs that saves the config


   .. py:attribute:: cli_name
      :value: 'reduce_dimensions'



   .. py:attribute:: add_parser_kwargs


   .. py:attribute:: description
      :value: 'Reduce the dimensionality of a dataset using provided or default reduction algorithm.'



   .. py:method:: setup_parser(parser: argparse.ArgumentParser)
      :staticmethod:


      Setup parser for reduce-dimensions verb



   .. py:method:: run_cli(args: argparse.Namespace | None = None)

      CLI stub for ReduceDimensions verb



   .. py:method:: run(algorithm: str | None = None, input_dir: Union[pathlib.Path, str] | None = None, model_path: Union[pathlib.Path, str] | None = None)

      Run dimensionality reduction on a dataset

      This method loads the latent space representations from an inference run and applies
      the selected dimensionality reduction algorithm.

      Algorithms that support reusable fitted models may either:

      - fit a new model using a sampled subset of the data, or
      - load an existing model if a model path is provided.

      Algorithms without a separate fitting stage do not support model loading and
      directly transform the input data.

      The full dataset is then transformed into the target lower-dimensional space,
      and the resulting embeddings are saved.

      :param algorithm: The dimensionality reduction algorithm to use.
                        If not specified, the method will look in the config for a default algorithm.
      :type algorithm: str, Optional
      :param input_dir: Directory containing the dataset to reduce dimensions for.
      :type input_dir: str or Path, Optional
      :param model_path: Path to a previously saved reducer model.
      :type model_path: str or Path, Optional

      :returns: The method does not return anything but saves the algorithm reducer representations to disk.
      :rtype: None



   .. py:method:: _run(algorithm: str | None, input_dir: Union[pathlib.Path, str] | None, model_path: Union[pathlib.Path, str] | None)

      See run()



