Machine Learning · Chapter 3 of 40
Data & Features
A FEATURE is a measurable property of the thing you're modelling — the input columns to your model.
Good features often matter more than fancy algorithms. Feature engineering is a huge part of real-world ML.
Example 1 (python)
import pandas as pd
df = pd.DataFrame({'age':[25,40], 'income':[50,90]})
print(df.columns.tolist())Output
['age', 'income']Each column is a feature.
Example 2 (python)
# Derive a new feature
df['income_per_age'] = df['income'] / df['age']Ratios often help models.
Key points
- Features = input columns.
- Targets = the value to predict.
- Rows = observations/samples.
- Feature engineering can trump algorithm choice.
💡 Note: Always split features (X) from the target (y) before training.
