<jupyter_start><jupyter_text>This is an example to show how to use the GooseDataset class APIs to load data.<jupyter_code>import numpy as np
from skimage import io<jupyter_output><empty_output><jupyter_text>When working in the *goose-dataset* repo, we can simply do the following:<jupyter_code>import utils
gd = utils.GooseDataset()
(X_train, y_train), (X_test, y_test) = gd.load_data(test_ratio=0.2, grayscale=False, cropped=False, save=False)
img = X_train[0,:,:,:]
io.imshow(img)<jupyter_output>C:\ProgramData\Anaconda3\lib\site-packages\skimage\io\_plugins\matplotlib_plugin.py:51: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  out_of_range_float = (np.issubdtype(image.dtype, np.float) and
C:\ProgramData\Anaconda3\lib\site-packages\skimage\io\_plugins\matplotlib_plugin.py:74: UserWarning: Low image data range; displaying image with stretched contrast.
  warn("Low image data range; displaying image with "
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes\_base.py:1400: MatplotlibDeprecationWarning: The 'box-forced' keyword argument is deprecated since 2.2.
  " since 2.2.", cbook.mplDeprecation)<jupyter_text>If working outside the goose-dataset repo, we can provide a path to this file and have Python load it:<jupyter_code>import importlib.util
spec = importlib.util.spec_from_file_location("utils", "C:\\Users\\Steggie\\git\\goose-dataset\\utils.py")
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
gd = module.GooseDataset()
(X_train, y_train), (X_test, y_test) = gd.load_data(test_ratio=0.2, grayscale=True, cropped=True, save=False)
img = X_train[0,:,:,:]
img = img.reshape([img.shape[0], img.shape[1]])
io.imshow(img, cmap="gray")<jupyter_output>C:\ProgramData\Anaconda3\lib\site-packages\skimage\io\_plugins\matplotlib_plugin.py:51: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  out_of_range_float = (np.issubdtype(image.dtype, np.float) and
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes\_base.py:1400: MatplotlibDeprecationWarning: The 'box-forced' keyword argument is deprecated since 2.2.
  " since 2.2.", cbook.mplDeprecation)
{'fraction_non_alphanumeric': 0.1260539629005059, 'fraction_numerical': 0.016441821247892074, 'mean_word_length': 6.279141104294479, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '611941', 'license': 'MIT', 'n_tokens_mistral': 859, 'n_tokens_neox': 839, 'n_words': 188, 'path': 'Example.ipynb', 'repo_name': 'steggie3/goose-dataset', 'size': '2372'}