分类器把输入映射到固定标签集合,分为二分类(邮件∈{垃圾、非垃圾})、多分类(文本∈{正面、中性、负面})和多标签(电影⊆{动作、恐怖、喜剧、爱情、奇幻、惊悚})三类。其工作方式是先用逻辑回归等手工特征或 CNN、BERT 等学习型编码器把输入编码成向量,再经线性层投影为 K 个分数(logits),通过 softmax/sigmoid 转为概率并取概率最高者。
A classifier maps an input to a fixed set of labels. The different kinds of classifiers include:
🟠 Binary Classification: email ∈ {spam, not spam}
🟠 Multiclass Classification: text ∈ {positive, neutral, negative}
🟠 Multilabel Classification: movie ⊆ {action, horror, comedy, romance, fantasy, thriller}
It works by encoding the input into a vector either through hand-build features like logistic regression or a learned encoder like CNN or BERT. It then projects that vector to K scores (logits) with a linear layer and applies a softmax/sigmoid function to turn the scores into probabilities and takes the vector with the highest probability. (1/3)🧵
来源:SemiAnalysis · x.com