如何解释 Google Cloud ML 预测结果?

How to interpret Google Cloud ML Prediction results?

我完成了 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 的二进制分类,而不是 1( >= 50,000 美元)

正确。

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