Features
How data is represented as features in AI models
We do not pass a cat or a dog directly into the model. We pass the features of the cat or dog as input.
Features are the data information that describes something.
Two Ways to Get Features
There are two ways to get features:
1. Direct Features We directly measure and pass specific characteristics:
- Weight
- Size
- Eye shape
- Fur color
- Ear size
Example: [5.2, 30, 1, 2, 1] could represent a cat with 5.2 kg weight, 30 cm size, round eyes (1), gray fur (2), and small ears (1).
2. Image Features We pass an image and the model extracts features automatically:
- Fur pattern
- Body shape
- Facial structure
Example: An image of 28x28 pixels contains 784 numbers (one for each pixel).
Features in Code
In the classification example, torch.rand(1, 10) represents 10 features of an animal.
Each number could represent one characteristic like weight, size, or color.
The model architecture determines how these features are processed.