我知道二元交叉熵與兩類中的分類交叉熵相同。 此外,我很清楚softmax是什麼。 因此,我看到明確的交叉熵懲罰只是將一個部件(概率)應爲1。 但爲什麼,不能或不應我使用二進制交叉熵上一熱載體? Normal Case for 1-Label-Multiclass-Mutual-exclusivity-classification:
################
pred = [0.1
我有一個數據集,每個文檔都有一個標籤,如下例所示。 label text
pay "i will pay now"
finance "are you the finance guy?"
law "lawyers and law"
court "was at the court today"
finance report "ban
import numpy as np
import pandas as pd
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.svm import LinearSVC
from sklearn.linear_mode