<commit_before>-- | Find and fix anomalies in Time Series
module Data.TimeSeries.Anomaly (Model, train, removeOutliers) where

import Prelude
import Data.Array as A 
import Data.Maybe (fromMaybe)
import Data.Tuple (Tuple(..))
import Learn.Unsupervised.OutlierDetection as OD
import LinearAlgebra.Matrix as M

import Data.TimeSeries as TS 


data Model = Model OD.Model

-- | Train Anomaly detection model
train :: TS.Series Number -> Model
train xs = Model $ OD.train ys<commit_msg>Added show instance to the anomaly model<commit_after>-- | Find and fix anomalies in Time Series
module Data.TimeSeries.Anomaly (Model, train, removeOutliers) where

import Prelude
import Data.Array as A 
import Data.Maybe (fromMaybe)
import Data.Tuple (Tuple(..))
import Learn.Unsupervised.OutlierDetection as OD
import LinearAlgebra.Matrix as M

import Data.TimeSeries as TS 


data Model = Model OD.Model

instance showModel :: Show Model where
  show (Model ds)= show ds


-- | Train Anomaly detection model
train :: TS.Series Number -> Model
train xs = Model $ OD.train ys
{'fraction_non_alphanumeric': 0.08026440037771483, 'fraction_numerical': 0.0, 'mean_word_length': 4.353535353535354, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7199241', 'n_tokens_mistral': 335, 'n_tokens_neox': 302, 'n_words': 125}