Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

评测有些不明白 #1

Open
StevenLOL opened this issue Dec 3, 2015 · 4 comments
Open

评测有些不明白 #1

StevenLOL opened this issue Dec 3, 2015 · 4 comments

Comments

@StevenLOL
Copy link

评测有些不明白,我看当年最好的AP 都没有过 0.6 比如这个 http://tcci.ccf.org.cn/conference/2014/papers/200.pdf

@intfloat
Copy link
Owner

intfloat commented Dec 3, 2015

�这个是一个课程作业。

当时进行评测的时候,没有找到官方的评测脚本,也没有找到关于AP该怎么计算的公式,当时问了很多人,每个人对AP的理解都不一样。。。我们就自己实现了一个 ranking score https://github.com/intfloat/weibo-emotion-analyzer/blob/master/scripts/model.py#L28, 即使预测结果跟标准答案不完全相同,仍然会有部分分数,这可能是导致结果比相关论文高很多的一个原因,可比性不强。

如果真要比较两个系统的表现优劣,最好的办法是拿到测试数据上的输出,用同一个脚本来评测,而不是每人写一个评测程序。

@StevenLOL
Copy link
Author

  1. 应该是在评测的时候没有按类别求平均,如果按类别平均一下的化会在0.6+
  2. 另外在测试里面有些训练数据
  3. 找到一个计算AP的 http://scikit-learn.org/stable/modules/generated/sklearn.metrics.average_precision_score.html#sklearn.metrics.average_precision_score
...
        # assert(len(x_test) % 2 == 0)
        # get probabilistic values for ranking
        y_pred, prob_val = [], clf.predict_proba(x_test)
        assert(len(prob_val) == len(y_test))
        assert(len(y_test) % 2 == 0)
        y_test = [[y_test[i], y_test[i + 1]] for i in range(len(y_test)) if i % 2 == 0]
        print y_test[0:10]
        prob_val = [prob_val[i] for i in xrange(len(prob_val)) if i % 2 == 0]
        mlb=MultiLabelBinarizer()
        y_test=mlb.fit_transform(y_test)
        print y_test[0:10]
        print y_pred[0:10]
        print average_precision_score(y_test,prob_val)

数值也在 0.6+

@intfloat
Copy link
Owner

intfloat commented Dec 4, 2015

嗯,这个更严谨一点。一个小问题是:任务虽然可以用multi label classification来做,但毕竟是有 主情绪 和 次要情绪 之分,label之间重要性不同,“预测对主情绪,预测错次要情绪” 理应好于 “预测错主情绪,预测对次要情绪”, 但在sklearn这样的计算方法中就抹掉了这种差别。

@StevenLOL
Copy link
Author

你说的是对的,这个主次同等对待

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants