官术网_书友最值得收藏!

How it works...

The performance of the model can be evaluated using AUC:

# Performance on Train
library(pROC)
ypred <- sess$run(tf$nn$sigmoid(tf$matmul(x, W) + b))
roc_obj <- roc(occupancy_train[, yFeatures], as.numeric(ypred))


# Performance on test
nRowt<-nrow(occupancy_test)
xt <- tf$constant(unlist(occupancy_test[, xFeatures]), shape=c(nRowt, nFeatures), dtype=np$float32)
ypredt <- sess$run(tf$nn$sigmoid(tf$matmul(xt, W) + b))
roc_objt <- roc(occupancy_test[, yFeatures], as.numeric(ypredt)).

AUC can be visualized using the plot.auc function from the pROC package, as shown in the screenshot following this command. The performance for training and testing (hold-out) is very similar.

plot.roc(roc_obj, col = "green", lty=2, lwd=2)
plot.roc(roc_objt, add=T, col="red", lty=4, lwd=2)
Performance of logistic regression using TensorFlow
主站蜘蛛池模板: 禄丰县| 长岭县| 财经| 常山县| 九江市| 广州市| 枝江市| 芜湖市| 娄烦县| 嘉义县| 桃源县| 政和县| 抚州市| 阿鲁科尔沁旗| 龙岩市| 嵩明县| 烟台市| 尉犁县| 临夏县| 凌海市| 三亚市| 晋中市| 洞口县| 石家庄市| 云安县| 德令哈市| 宝鸡市| 磐安县| 浦县| 阳泉市| 五莲县| 开平市| 襄汾县| 怀来县| 诸暨市| 葫芦岛市| 明溪县| 成都市| 雅江县| 平凉市| 屏边|