首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TFlearn evaluate方法结果含义

TFlearn evaluate方法结果含义
EN

Stack Overflow用户
提问于 2016-12-15 21:31:17
回答 1查看 288关注 0票数 0

我认为TFlearn的evaluate方法返回模型的精度(0到1),但在训练我的模型后,model.evaluate(test_x, test_y)返回值>1 (1.003626),所以现在我不确定我确切地理解了它返回的内容。

有谁能解释一下吗?

EN

回答 1

Stack Overflow用户

发布于 2016-12-16 02:19:46

evaluate方法返回一个dict,因此调用应该是

model.evaluate(test_x, test_y)['accuracy']

但我猜这不是问题所在。如果您正在进行分类,则测试标签必须是整数才能工作。除此之外,如果看不到更多的代码,就很难进行调试。

来自evaluate源代码的注释:

Args: x: Matrix of shape [n_samples, n_features...] or dictionary of many matrices containing the input samples for fitting the model. Can be iterator that returns arrays of features or dictionary of array of features. If set,input_fnmust beNone. y: Vector or matrix [n_samples] or [n_samples, n_outputs] containing the label values (class labels in classification, real numbers in regression) or dictionary of multiple vectors/matrices. Can be iterator that returns array of targets or dictionary of array of targets. If set, input_fn must beNone. Note: For classification, label values must be integers representing the class index (i.e. values from 0 to n_classes-1).

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41165408

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档