You want to classify movie reviews into 5 sentiment classes: very negative, negative, neutral, positive, very positive. Which model is best suited for this task?
Think about the type of output needed: discrete classes vs continuous values.
Since the task is to classify into 5 distinct sentiment categories, a multi-class classification model like logistic regression with 5 output classes is appropriate. Binary classification only predicts two classes, clustering is unsupervised and may not align with sentiment, and regression predicts continuous values, not discrete classes.
You trained a 5-class sentiment classifier. Which metric best measures overall accuracy across all classes?
Consider a metric that accounts for all classes equally.
Accuracy measures the proportion of correct predictions across all classes, making it suitable for multi-class classification. MSE is for regression, and precision or recall for a single class ignore other classes.
Given the logits output from a neural network for 5 sentiment classes as [2.0, 1.0, 0.1, 0.5, 3.0], what is the predicted class index after applying softmax and choosing the highest probability?
import numpy as np logits = np.array([2.0, 1.0, 0.1, 0.5, 3.0]) exp_logits = np.exp(logits - np.max(logits)) probs = exp_logits / exp_logits.sum() predicted_class = np.argmax(probs) print(predicted_class)
Softmax picks the class with the highest logit after normalization.
The highest logit is 3.0 at index 4, so softmax probability is highest for class 4, making it the predicted class.
You are training a neural network for 5-class sentiment classification on a dataset of 10,000 reviews. Which batch size is likely to give a good balance of training speed and stable gradient updates?
Consider typical batch sizes used in practice for stability and speed.
Batch size 64 is a common choice balancing speed and stable gradients. Batch size 1 is slow and noisy, full batch (10,000) is slow and memory heavy, and 1,000,000 exceeds dataset size and is invalid.
Your 5-class sentiment model always predicts the 'neutral' class regardless of input. Which is the most likely cause?
Think about compatibility between output activation and loss function.
Using softmax output with mean squared error loss can cause poor gradient signals, leading the model to predict the most frequent or default class. Balanced data, ReLU activations, and moderate learning rate are not likely causes of this issue.