SemiAnalysis 图解分类器的三种类型与原理
SemiAnalysis 用一条推文讲解分类器(classifier)的三种类型:二分类(如邮件是否为垃圾邮件)、多分类(如文本情感正/中/负)和多标签分类(如电影可同时属于动作、恐怖、喜剧等多类)。
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