Currently we have a map of strings to functions which take a specific parameter and return a specific output. Instead we could have an interface like this:
type AnomalyDetection interface{
GetParameters() error
Execute() (*[]system_metrics.AnomalyDetectionOutput, error)
}
type IsolationForest struct{
Data system_metrics.SystemMetric
Host string
Duration string
}
func (i *IsolationForest) GetParameters() error{
//...
}
func (i *IsolationForest) Execute() (*[]system_metrics.AnomalyDetectionOutput, error){
//...
}
This way any AnomalyDetection could specify their own parameters without affecting other algorithms.
Currently we have a map of strings to functions which take a specific parameter and return a specific output. Instead we could have an interface like this:
This way any AnomalyDetection could specify their own parameters without affecting other algorithms.