Regression and Text Classification with FCNs
Related: 4. Deep Learning and FCNs | 6. Loss Functions and Backpropagation | 14. Natural Language Processing | 5. Activation Functions | Artificial Intelligence
Regression with Deep Learning
For regression tasks, the output is continuous.
Key differences from classification:
| Classification | Regression | |
|---|---|---|
| Output activation | Softmax / Sigmoid | Linear (none) |
| Loss function | Cross-entropy | MSE |
| Output units | Number of classes | 1 (or number of target values) |
See 5. Activation Functions for details on softmax/sigmoid and 6. Loss Functions and Backpropagation for cross-entropy and MSE.
Data Normalisation for Regression
When features have different scales, normalisation is essential:
Min-Max Scaling:
Z-Score (Standardisation):
Important: Compute normalisation statistics (, , min, max) on the training set only, then apply to test set.
Text Classification with FCNs
Approach (e.g., IMDB sentiment analysis):
- Load pre-processed text data (each review = list of word indices)
- One-hot encode the word sequences into fixed-size binary vectors (dimension = vocabulary size)
- Build an FCN with Dense layers and appropriate activation (see 4. Deep Learning and FCNs)
Binary classification (IMDB):
Dense(16, relu) → Dense(16, relu) → Dense(1, sigmoid)
Loss: binary_crossentropy
Multi-class classification (Reuters, 46 topics):
Dense(64, relu) → Dense(64, relu) → Dense(46, softmax)
Loss: categorical_crossentropy
Note that 14. Natural Language Processing covers the text preprocessing pipeline (tokenisation, BoW, TF-IDF) that feeds into these classification models.