分类器将输入映射到固定标签集合,分为二分类(如邮件∈{垃圾邮件,非垃圾邮件})、多分类(如文本∈{正面,中性,负面})和多标签(如电影⊆{动作,恐怖,喜剧,爱情,奇幻,惊悚})三类。其工作方式是将输入编码为向量——可用逻辑回归等手工特征,也可用 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