cca_zoo.datasets.load_split_mnist_data#

class cca_zoo.datasets.load_split_mnist_data[source]#

Bases:

Load and split the MNIST dataset into two halves.

Returns: - mnist_data (Bunch object): A Scikit-learn Bunch object containing the MNIST dataset.

This object has ‘views’ attribute, where ‘views[0]’ corresponds to the left half of the images, and ‘views[1]’ corresponds to the right half of the images.

The function fetches the MNIST dataset from Scikit-learn’s dataset repository and splits each 28x28 pixel image into two halves: - The first half (left), X1, contains the first 14 columns (left 14 pixels) of each image. - The second half (right), X2, contains the last 14 columns (right 14 pixels) of each image.

The Bunch object mnist_data also stores these views as ‘views’ attribute.

Example usage: >>> mnist_data = load_split_mnist_data() >>> left_half = mnist_data.views[0] >>> right_half = mnist_data.views[1] >>> print(left_half.shape) # Shape of the left half of the dataset >>> print(right_half.shape) # Shape of the right half of the dataset