feat: tipo datascience OutlierResult (sum)

Tipo suma para clasificar datos como Normal u Outlier con z-score.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-28 02:23:12 +01:00
parent 6242613886
commit b33038e3c8
2 changed files with 35 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
package datascience
// OutlierResult is a sum type representing whether a data point is normal or an outlier.
type OutlierResult interface{ outlierResult() }
// Normal indicates the data point is within expected range.
type Normal struct {
Index int
Value float64
}
// Outlier indicates the data point is anomalous.
type Outlier struct {
Index int
Value float64
ZScore float64
}
func (Normal) outlierResult() {}
func (Outlier) outlierResult() {}
+15
View File
@@ -0,0 +1,15 @@
---
name: outlier_result
lang: go
domain: datascience
version: "1.0.0"
algebraic: sum
definition: |
type OutlierResult interface{ outlierResult() }
type Normal struct { Index int; Value float64 }
type Outlier struct { Index int; Value float64; ZScore float64 }
description: "Tipo suma que clasifica un dato como Normal o Outlier con su z-score. Usado por DetectOutliers."
tags: [datascience, outlier, anomaly, statistics]
uses_types: []
file_path: "types/datascience/outlier_result.go"
---