ComponentChooser

class lightning_pose.utils.pca.ComponentChooser[source]

Bases: object

Determine the number of PCA components to keep.

Attributes Summary

cumsum_explained_variance

Methods Summary

__call__()

Call self as a function.

Attributes Documentation

cumsum_explained_variance

Methods Documentation

__call__() int[source]

Call self as a function.

__init__(fitted_pca_object: PCA, components_to_keep: int | float | None) None[source]

Initialize ComponentChooser.

Parameters:
  • fitted_pca_object – a fitted sklearn.decomposition.PCA or NaNPCA instance whose explained_variance_ratio_ attribute is used to select the number of components.

  • components_to_keep – criterion for selecting components. An int returns that exact count; a float in [0, 1] returns the minimum number of components needed to reach that cumulative explained-variance threshold; None keeps all components.

__new__(**kwargs)