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:
@@ -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() {}
|
||||||
@@ -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"
|
||||||
|
---
|
||||||
Reference in New Issue
Block a user