【问题标题】:How to interpret Google Cloud ML Prediction results?如何解读 Google Cloud ML 预测结果?
【发布时间】:2017-03-16 15:53:48
【问题描述】:

我完成了 GC ML Census Wide & Deep Learning 示例 https://github.com/GoogleCloudPlatform/cloudml-samples/tree/master/census

给定一个人的人口普查数据,例如年龄、性别、教育和职业(特征),这个 DNNLinearCombinedClassifier 模型应该预测这个人的年收入是否超过 50,000 美元(目标标签)。

我进行了在线预测 gcloud ml-engine predict --model census --version v1 --json-instances ../test.json

使用 test.json 数据 {"age": 25, "workclass": " Private", "education": " 11th", "education_num": 7, "marital_status": " Never-married", "occupation": " Machine-op-inspct", "relationship": " Own-child", "race": " Black", "gender": " Male", "capital_gain": 0, "capital_loss": 0, "hours_per_week": 40, "native_country": " United-States"}

我得到以下结果: {"probabilities": [0.9962924122810364, 0.003707568161189556], "logits": [-5.593664646148682], "classes": 0, "logistic": [0.003707568161189556]}

我该如何解释? 我目前的理解是,logit 是输出层中 sigmoid 二进制分类激活函数的倒数(不确定输出数字表示什么),classes: 0 指的是 = 50,000 美元)

【问题讨论】:

    标签: tensorflow google-cloud-ml google-cloud-ml-engine


    【解决方案1】:

    正确。

    • 概率:是 =$50K 的概率。
    • classes:预测的类(0,即
    • logits: ln(p/(1-p)) = ln(0.00371/(1-.00371)) = -5.593
    • 逻辑:1/(1+exp(-logit)) = 1/(1+exp(5.593)) = 0.0037

    【讨论】:

    • 类标签是如何选择的?是否基于LABELS列表中定义的类标签的索引?
    • @FayazAhmed 没错。所以 LABELS[classes] 给你字符串标签。
    猜你喜欢
    • 2019-09-08
    • 2018-12-09
    • 2019-02-08
    • 2019-01-19
    • 2018-05-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-21
    相关资源
    最近更新 更多