分类器将输入映射到固定标签集,分为二元分类(如邮件是否为垃圾邮件)、多类别分类(如文本情感正/中/负)和多标签分类(如电影可同时属于多个类型)。其工作原理是先用逻辑回归手工特征或 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