Question 5 of 5

How can a SQL JOIN silently change a training dataset?

Before joining, each order had one row. Adding events duplicated some orders and changed the target-class fraction without creating any new orders.

One order costs 600 and contains two items. Join the orders table to the items table on the order number and the total of 600 appears in two rows. Adding those rows gives 1200 for a single purchase. Before calculating a total, ask what one row in the joined table now represents.

WHERE TO START

What happens to the row count when one ticket has two ratings?

What to know before this question
Topic example · Overlap between two sets

Change 12 on the second line to 14 and check the result.

train = {11, 12}
test = {12, 13}
print(sorted(train & test))
Line notes
  1. These ticket numbers belong to the training set.
  2. Store the ticket numbers reserved for testing.
  3. Print the ticket numbers that appear in both sets.

How would you rate your understanding?

This is your self-assessment. Progress is saved in this browser.

Not rated yet

← Back to Data and honest evaluation