Select, filter, aggregate: the feature query shape — step 1 of 7
Select, filter, aggregate: the feature query shape
A feature query is usually three moves: select the columns you need, filter to the rows that belong in the training set, then aggregate events into model features.
SQL gives you SELECT, WHERE, GROUP BY, and aggregate functions. In these drills, Python stands in for SQL so you can see each decision. The lesson is the same: never let a query quietly widen the population or average over the wrong rows.