aboutsummaryrefslogtreecommitdiff
path: root/lib/mining/classifier/stat.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-09-10 22:33:06 +0700
committerShulhan <ms@kilabit.info>2023-09-11 02:26:33 +0700
commit38b25f4d963cb12718b100397e4d0d20085eccdc (patch)
treec18ba632092f69ab0e6f8eb75f01d4a9629a3a5c /lib/mining/classifier/stat.go
parentf4dacb7907fbfc1d05a56dcc4655f4870159d4b7 (diff)
downloadpakakeh.go-38b25f4d963cb12718b100397e4d0d20085eccdc.tar.xz
lib/mining: realign struct for better size allocation
The realignment reduce the cost of the following struct, * classifier/cart.Runtime: from 40 to 16 bytes (-24) * classifier/cart.NodeValue: from 72 to 40 bytes (-32) * classifier.CM: from 184 to 152 bytes (-32) * classifier/crf.Runtime: from 376 to 312 bytes (-64) * classifier/rf.Runtime: from 336 to 304 bytes (-32) * classifier.Runtime: from 256 to 112 bytes (-144) * gain/gini.Gini: from 152 to 104 bytes (-48) * knn.Runtime: from 56 to 32 bytes (-24) * resampling/lnsmote.Runtime: from 232 to 224 bytes (-8) * resampling/smote.Runtime: from 144 to 128 bytes (-16)
Diffstat (limited to 'lib/mining/classifier/stat.go')
-rw-r--r--lib/mining/classifier/stat.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/mining/classifier/stat.go b/lib/mining/classifier/stat.go
index f7aa8a50..514da3bd 100644
--- a/lib/mining/classifier/stat.go
+++ b/lib/mining/classifier/stat.go
@@ -16,39 +16,55 @@ import (
type Stat struct {
// ID unique id for this statistic (e.g. number of tree).
ID int64
+
// StartTime contain the start time of classifier in unix timestamp.
StartTime int64
+
// EndTime contain the end time of classifier in unix timestamp.
EndTime int64
+
// ElapsedTime contain actual time, in seconds, between end and start
// time.
ElapsedTime int64
+
// TP contain true-positive value.
TP int64
+
// FP contain false-positive value.
FP int64
+
// TN contain true-negative value.
TN int64
+
// FN contain false-negative value.
FN int64
+
// OobError contain out-of-bag error.
OobError float64
+
// OobErrorMean contain mean of out-of-bag error.
OobErrorMean float64
+
// TPRate contain true-positive rate (recall): tp/(tp+fn)
TPRate float64
+
// FPRate contain false-positive rate: fp/(fp+tn)
FPRate float64
+
// TNRate contain true-negative rate: tn/(tn+fp)
TNRate float64
+
// Precision contain: tp/(tp+fp)
Precision float64
+
// FMeasure contain value of F-measure or the harmonic mean of
// precision and recall.
FMeasure float64
+
// Accuracy contain the degree of closeness of measurements of a
// quantity to that quantity's true value.
Accuracy float64
+
// AUC contain the area under curve.
AUC float64
}