Utility Functions

IO

mvlearn.utils.check_Xs(Xs, multiview=False, enforce_views=None)[source]

Checks Xs and ensures it to be a list of 2D matrices.

Parameters:

Xs : nd-array, list

Input data.

multiview : boolean, (default=False)

If True, throws error if just 1 data matrix given.

enforce_views : int, (default=not checked)

If provided, ensures this number of views in Xs. Otherwise not checked.

Returns:

Xs_converted : object

The converted and validated Xs (list of data arrays).

mvlearn.utils.check_Xs_y(Xs, y, multiview=False, enforce_views=None)[source]

Checks Xs and y for consistent length. Xs is set to be of dimension 3.

Parameters:

Xs : nd-array, list

Input data. F

y : nd-array, list

Labels.

multiview : boolean, (default=False)

If True, throws error if just 1 data matrix given.

enforce_views : int, (default=not checked)

If provided, ensures this number of views in Xs. Otherwise not checked.

Returns:

Xs_converted : object

The converted and validated Xs (list of data arrays).

y_converted : object

The converted and validated y.

mvlearn.utils.check_Xs_y_nan_allowed(Xs, y, multiview=False, enforce_views=None, num_classes=None, max_classes=None, min_classes=None)[source]

Checks Xs and y for consistent length. Xs is set to be of dimension 3. The labels (y) are allowed to be np.nan.

Parameters:

Xs : nd-array, list

Input data.

y : nd-array, list

Labels.

multiview : boolean, default=False

If True, throws error if just 1 data matrix given.

enforce_views : int, (default=not checked)

If provided, ensures this number of views in Xs. Otherwise not checked.

num_classes : int, default=None

Number of classes that must appear in the labels. If none, then not checked.

max_classes : int, default=None

Maximum number of classes that must appear in labels. If none, then not checked.

min_classes : int, default=None

Minimum number of classes that must appear in labels. If none, then not checked.

Returns:

Xs_converted : object

The converted and validated Xs (list of data arrays).

y_converted : object

The converted and validated y.