aboutsummaryrefslogtreecommitdiff
path: root/core/model.go
diff options
context:
space:
mode:
authorSam Scholten2025-12-15 19:34:17 +1000
committerSam Scholten2025-12-15 19:34:59 +1000
commit9f5978186ac3de07f4325975fecf4f538fe713b6 (patch)
tree41440b703054fe59eb561ba81d80fd60380c1f7a /core/model.go
downloadscholscan-9f5978186ac3de07f4325975fecf4f538fe713b6.tar.gz
scholscan-9f5978186ac3de07f4325975fecf4f538fe713b6.zip
Init v0.1.0
Diffstat (limited to 'core/model.go')
-rw-r--r--core/model.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/model.go b/core/model.go
new file mode 100644
index 0000000..28f4045
--- /dev/null
+++ b/core/model.go
@@ -0,0 +1,20 @@
+// Model envelope persists trained model to JSON. Contains Vectorizer for IDF values,
+// OrderedVocab for feature ordering, and Weights for logistic regression.
+// To score: recreate TFIDFVectorizer, transform, then PredictScore.
+package core
+
+import (
+ "time"
+)
+
+// ModelEnvelope - complete trained model for scoring articles
+type ModelEnvelope struct {
+ Algorithm string `json:"algorithm"`
+ Impl string `json:"impl"`
+ Version string `json:"version"`
+ CreatedAt time.Time `json:"created_at"`
+ Meta map[string]any `json:"meta"`
+ Vectorizer map[string]float64 `json:"vectorizer"`
+ OrderedVocab []string `json:"ordered_vocab"`
+ Weights []float64 `json:"weights"`
+}