3步掌握SH1106 OLED显示屏:Arduino高效显示方案
2025/12/26 7:43:56
在交通标志识别任务中,一个优秀分类器的目标是使混淆矩阵呈对角化,这意味着每个样本的真实类别(c_true)和预测类别(c_pred)相同。其中,一对一(one - vs - one)策略结合HOG特征表现出色,从得到的混淆矩阵可以看出,大部分非对角元素为零。
def __accuracy(self, y_test, y_vote): """ Calculates the accuracy based on a vector of ground - truth labels (y_test) and a 2D voting matrix (y_vote) of size (len(y_test),numClasses). """ y_hat = np.argmax(y_vote, axis = 1) mask = (y_hat == y_test) return np.count_nonzero(mask)*1./len(y_test)