1

I worked through the GC ML Census Wide & Deep Learning example https://github.com/GoogleCloudPlatform/cloudml-samples/tree/master/census

Given census data about a person such as age, gender, education and occupation (the features), this DNNLinearCombinedClassifier model should predict whether or not the person earns more than 50,000 dollars a year (the target label).

I ran an online prediction gcloud ml-engine predict --model census --version v1 --json-instances ../test.json

using the test.json data {"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"}

I get the following result: {"probabilities": [0.9962924122810364, 0.003707568161189556], "logits": [-5.593664646148682], "classes": 0, "logistic": [0.003707568161189556]}

How do I interpret this ? my current understanding is that logit is the inverse of the sigmoid binary classification activation function in the output layer (not sure what the output numbers signify) and that classes: 0 refers to a binary classification of < $50,000, as opposed to 1 (>= $50,000)

4

1 回答 1

1

正确的。

  • probabilities:是 < $50K vs >=$50K 的概率。
  • classes:预测的类(0,即 < $50K)
  • 对数:ln(p/(1-p)) = ln(0.00371/(1-.00371)) = -5.593
  • 逻辑:1/(1+exp(-logit)) = 1/(1+exp(5.593)) = 0.0037
于 2017-03-16T07:53:48.310 回答