sispca.data

Classes

Supervision

Custom data class for variable used as supervision.

SISPCADataset

Custom dataset for supervised independent subspace PCA (sisPCA).

Module Contents

class sispca.data.Supervision(target_data, target_type, target_name=None, target_kernel_K=None, target_kernel_Q=None)

Custom data class for variable used as supervision.

Parameters:
  • target_data (2D tensor or ndarray) – (n_sample, n_dim_target). The target data used as supervision.

  • target_type (str) – One of [‘continuous’, ‘categorical’, ‘custom’]. The type of the target data. If ‘custom’, the target_kernel should be provided.

  • target_name (str) – The name of the target data.

  • target_kernel_K (2D tensor) – (n_sample, n_sample). Optional. The kernel matrix of the target data. Once provided, the target_data will be ignored.

  • target_kernel_Q (2D tensor) – (n_sample, n_rank). Optional. The decomposed kernel matrix. K = Q @ Q.T. Will be overriden by target_kernel_K if both are provided.

target_data
target_type
target_name = None
_target_kernel_K = None
_target_kernel_Q = None
target_kernel
n_sample
_sanity_check()
_calc_kernel()

Calculate the kernel matrix of the target data.

Returns:

An object of Kernel. Use the realization() method to get the (n, n) kernel matrix.

Return type:

Kernel

class sispca.data.SISPCADataset(data, target_supervision_list: List[Supervision])

Bases: torch.utils.data.Dataset

Custom dataset for supervised independent subspace PCA (sisPCA).

Parameters:
  • data (2D tensor) – (n_sample, n_feature). Data to run sisPCA on.

  • target_supervision_list (list of Supervision) – List of Supervision objects.

x
n_sample
n_feature
target_supervision_list
n_target
target_data_list
target_kernel_list
target_name_list
__len__()
__getitem__(idx)