我已经使用npm安装了'express',我已经成功地在3000上收听了端口号.但过了一段时间我得到了以下错误,
TypeError:res.sendStatus不是函数
我们知道,res.sendStatus(404)与express有关.但是express明确定位.
这是app.js中的源代码
var express = require('express'),
app = express();
app.get('/', function(req, res){
res.send('Hello Worlds');
});
app.use(function(req, res){
res.sendStatus(404);
});
var server = app.listen(3000, function() {
var port = server.address().port;
console.log('Express server listening on port %s', port);
});
Run Code Online (Sandbox Code Playgroud)
这是我的完整cmd输出,
> $ node app.js
Express server listening on port 3000
TypeError: res.sendStatus is not a function
at Object.handle (I:\mongoUniversity\hello_world_templates\app.js:14:9)
at next (I:\mongoUniversity\hello_world_templates\node_modules\connect\lib\proto.js:174:15)
at pass (I:\mongoUniversity\hello_world_templates\node_modules\express\lib\router\index.js:110:24)
at Router._dispatch (I:\mongoUniversity\hello_world_templates\node_modules\express\lib\router\index.js:173:5)
at Object.router (I:\mongoUniversity\hello_world_templates\node_modules\express\lib\router\index.js:33:10)
at next (I:\mongoUniversity\hello_world_templates\node_modules\connect\lib\proto.js:174:15)
at Object.expressInit [as handle] …Run Code Online (Sandbox Code Playgroud) 我正在进行性能测量并尝试绘制ROC曲线,但要绘制ROC曲线我需要TPR和FPR.
据我们所知,
误报率(FPR)= FP /(FP + TN)
我有TN和FP的值都等于0,那么如何计算这种情况下的FPR并输入ROC曲线?