Skip to main content
AI & ML Bug Hunt Medium +20 XP

Missing Feature Engineering

Model ignores the date column.

AI & MLFind the bug
1df['date'] = pd.to_datetime(df['date'])
2model.fit(df[['date', 'amount']], y)
The bug is on line 2

Select the correct fix

Show answer and explanation

Answer: Extract year/month/day as separate numeric features

Raw datetime objects can't be used as model features. Extract numeric components: df['year'], df['month'], df['day'], etc.

Hint: Models need numbers — extract date components.

What this challenge tests

Bug Hunt in AI & ML: feature-engineering, datetime.

Related challenges