代码
const connectionString = '[whatever]'
const env = { connection: acquire (connectionString) }
const output = composition (arg0) (argN) (env)
// then, release the connection
// f :: a -> b -> { connection: DbConnection }
const f = x => y => ({ connection }) =>
doDbStuff (x + y) (connection)
显示曲线
这显然是错误的。我究竟做错了什么?我无法终生解决。目标是“不良”。所以我确定
const withConnection = f => [stuff to acquire the connection, and aftewards, release it]
const env = { withConnection }
const output = composition (arg0) (argN) (env)
// type FnConnection DbConnection c = c -> a
// f :: a -> a -> { connection: FnConnection }
const f = x => y => ({ withConnection }) =>
withConnection (doDbStuff (x + y))
答案 0 :(得分:1)
插入符号将第一个级别视为积极类,如使用时所见
confusionMatrix(..., reference=GermanCredit$Class)
ROCR认为以后的级别为肯定级别。逻辑是1
是肯定类别,0
是否定类别,并且由于0 < 1
和"Bad" < "Good"
,因此ROCR认为"Good"
是肯定类别。 / p>
解决方案是使用显式排序:
pred = prediction(GermanCredit$perfect_prob, GermanCredit$Class, label.ordering = c("Good", "Bad")
perf = performance(pred, "tpr", "fpr")
"Good" < "Bad"
现在将"Bad"
和prediction
视为肯定类别。