End-of-chapter quiz
This chapter covered a lot of ground! Donβt worry if you didnβt grasp all the details; the next chapters will help you understand how things work under the hood.
Before moving on, though, letβs test what you learned in this chapter.
1. The load_dataset() function in π€ Datasets allows you to load a dataset from which of the following locations?
2. Suppose you load one of the GLUE tasks as follows:
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
Which of the following commands will produce a random sample of 50 elements from dataset
?
3. Suppose you have a dataset about household pets called pets_dataset , which has a name column that denotes the name of each pet. Which of the following approaches would allow you to filter the dataset for all pets whose names start with the letter βLβ?
4. What is memory mapping?
5. Which of the following are the main benefits of memory mapping?
6. Why does the following code fail?
from datasets import load_dataset
dataset = load_dataset("allocine", streaming=True, split="train")
dataset[0]