本文整理汇总了Golang中github.com/shuLhan/tabula.ClasetInterface.DeleteRow方法的典型用法代码示例。如果您正苦于以下问题:Golang ClasetInterface.DeleteRow方法的具体用法?Golang ClasetInterface.DeleteRow怎么用?Golang ClasetInterface.DeleteRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/shuLhan/tabula.ClasetInterface
的用法示例。
在下文中一共展示了ClasetInterface.DeleteRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: refillWithFP
//
// refillWithFP will copy the false-positive data in training set `tnset`
// and append it to `samples`.
//
func (crf *Runtime) refillWithFP(samples, tnset tabula.ClasetInterface,
cm *classifier.CM,
) {
// Get and sort FP.
fpids := cm.FPIndices()
sort.Ints(fpids)
// Move FP samples from TN-set to training set samples.
for _, i := range fpids {
samples.PushRow(tnset.GetRow(i))
}
// Delete FP from training set.
var row *tabula.Row
c := 0
for x, i := range fpids {
row = tnset.DeleteRow(i - x)
if row != nil {
c++
}
}
if DEBUG >= 1 {
fmt.Println(tag, "# FP", len(fpids), "# refilled", c)
}
}
示例2: deleteTrueNegative
func (crf *Runtime) deleteTrueNegative(samples tabula.ClasetInterface,
cm *classifier.CM,
) {
var row *tabula.Row
tnids := cm.TNIndices()
sort.Ints(tnids)
// (1)
if len(crf.weights) <= 1 {
for _, i := range tnids {
crf.tnset.PushRow(samples.GetRow(i))
}
}
// (2)
c := 0
for x, i := range tnids {
row = samples.DeleteRow(i - x)
if row != nil {
c++
}
}
if DEBUG >= 1 {
fmt.Println(tag, "# TN", len(tnids), "# deleted", c)
}
}