计算vowp分数

2024-04-23 21:33:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试对vowpal中的一个样本数据进行逻辑回归。我创建了一个示例数据集,如下所示:

 1 1.0  | a:3.28 b:1.5 c:2.0  |example
-1 1.0  | a:1.25 b:0.4 c:1.4  |example
 1 1.0  | a:1.40 b:0.8 c:1.6  |example
 1 1.0  | a:2.00 b:4.2 c:2.1  |example
-1 1.0  | a:2.51 b:2.7 c:1.9  |example
 1 1.0  | a:1.72 b:2.3 c:0.6  |exampleone
 1 1.0  | a:1.81 b:2.1 c:0.9  |example

当我尝试运行logistic时,它显示一个错误“您使用的标签是0而不是-1或1,正如损失函数专家指定的或格式错误的示例”

在这之后,我想计算在最后的分数和如何计算分数或auc曲线在vowpal


Tags: 数据函数示例example格式错误标签逻辑
1条回答
网友
1楼 · 发布于 2024-04-23 21:33:48

确保对Vowpal Wabbit使用正确的input data format。在

如果使用 loss_function=logistic(或 loss_function=hinge),并且某些示例的标签为0,则会出现错误“you are using label 0”。我不能用你提供的样品重现这个错误。在

示例中的“|example”被解释为没有特性的名称空间,这可能不是您想要的。“1.0”被解释为示例重要性权重,但1.0是默认的重要性权重,因此可以忽略它。如果要使用标记,则标记必须位于第一个垂直条之前(该条之前没有任何空格)。所以样品应该看起来像:

1 tag1| a:3.28 b:1.5 c:2.0 -1 tag2| a:1.25 b:0.4 c:1.4 1 tag3| a:1.40 b:0.8 c:1.6 1 tag4| a:2.00 b:4.2 c:2.1 -1 tag5| a:2.51 b:2.7 c:1.9 1 tag6| a:1.72 b:2.3 c:0.6 1 tag7| a:1.81 b:2.1 c:0.9

calculate the score at end and how to calculate the score or auc

什么分数?VW计算渐进的验证丢失(如果使用多个传递而不使用 holdout_off),则会计算持续的验证丢失。 如果你想计算area under ROC curve,你必须使用一些外部工具,例如perf。见Calculating AUC when using Vowpal Wabbit。在

相关问题 更多 >