“预测"和“预测"之间有什么区别?和"predict_class"喀拉拉邦的功能? [英] What is the difference between "predict" and "predict_class" functions in keras?

查看:68
本文介绍了“预测"和“预测"之间有什么区别?和"predict_class"喀拉拉邦的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

keras中的predictpredict_class函数之间有什么区别?

What is the difference between predict and predict_class functions in keras?

为什么Model对象没有predict_class功能?

推荐答案

predict将返回回归的分数,而predict_class将返回预测的类别.尽管看起来很相似,但还是有一些区别:

predict will return the scores of the regression and predict_class will return the class of your prediction. Although it seems similar there are some differences:

想象一下,您正在尝试预测图片是狗还是猫(您有分类器):

Imagine you are trying to predict if the picture is a dog or a cat (you have a classifier):

  • predict将返回您:例如0.6只猫和0.2只狗.
  • predict_class会把你送回猫咪
  • predict will return you: 0.6 cat and 0.2 dog (for example).
  • predict_class will return you cat

现在,您正在尝试预测房价(您有一个回归指标):

Now image you are trying to predict house prices (you have a regressor):

  • predict将返回预测价格
  • predict_class在这里没有意义,因为您没有分类器
  • predict will return the predicted price
  • predict_class will not make sense here since you do not have a classifier

TL:DR:将predict_class用于分类器(输出是标签),将predict用于回归(输出是非离散的)

TL:DR: use predict_class for classifiers (outputs are labels) and use predict for regressions (outputs are non discrete)

希望有帮助!

这篇关于“预测"和“预测"之间有什么区别?和"predict_class"喀拉拉邦的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆