Given table tiktok_req (ID, DAY YYYY-MM-DD, PREDICTED 0/1, ACTUAL 0/1; key ID), compute the precision and recall for each week, and the precision change week over week and recall change week over week.
Asked in the Phone screen stage.
week_start, precision, recall, precision_change, and recall_change.week_start ascending, and return NULL when a metric has no valid denominator.| Column | Type | Description |
|---|---|---|
| idPK | INT | Unique prediction record identifier |
| day | DATE | Date on which the prediction was recorded |
| predicted | SMALLINT | Model prediction, either 0 or 1 |
| actual | SMALLINT | Observed outcome, either 0 or 1 |