When is a prediction in the top k good enough?
Top-k accuracy counts an example as correct when its true class appears among the k highest scoring candidates.
top_k_accuracy_score in practice
A flower identifier earns a top-three hit when the true species is third. If the app acts on its first suggestion automatically, measure top-one accuracy for that use.
中文
候选列表的 Top-k 准确率怎么算?
真实类别在模型得分最高的 k 个候选中,该样本就计一次命中。
top_k_accuracy_score 应用实例
识别花种的工具一次列三种,正确花种排第三就有一次 Top-3 命中。若系统直接执行第一项,Top-1 才对应实际操作。