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

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
主站蜘蛛池模板: 澳门| 达拉特旗| 德令哈市| 施秉县| 洛扎县| 新蔡县| 新民市| 株洲县| 文化| 泸溪县| 合作市| 金湖县| 察雅县| 婺源县| 缙云县| 玛多县| 台湾省| 宜春市| 阿荣旗| 左云县| 桂平市| 麻栗坡县| 佳木斯市| 墨脱县| 龙胜| 黄平县| 洛南县| 正蓝旗| 荥经县| 桦川县| 老河口市| 江北区| 西华县| 十堰市| 三河市| 湘潭市| 丹凤县| 仙居县| 永顺县| 五指山市| 滨州市|